Convolution Length Calculator

Find the output length of a linear convolution, the FFT size needed to compute it, and whether direct or FFT-based convolution is faster.

🔗 Convolution Length Calculator
Signal length (Lx)1000
samples
2100,000
Kernel (filter) length (Lh)50
samples
120,000
Convolution output length
Required FFT size
Direct convolution ops
FFT-based ops (est.)
Recommended method
Step-by-step working

🔗 What is Convolution Length?

Convolution length is the number of output samples produced when a signal of length Lx passes through a filter (convolution kernel) of length Lh. It always works out to Lx + Lh minus 1, a fixed relationship that governs every buffer allocation and FFT-size decision in a real-time or offline DSP pipeline.

Audio plugin developers size their output buffers using this formula before running an FIR filter or a convolution reverb impulse response. Image processing engineers apply the same 2D generalization when convolving an image with a blur or edge-detection kernel. Communications engineers use it to size the FFT in an OFDM or channel-equalization block, since undersizing the transform corrupts the tail of every processed block with wraparound error.

A common misconception is that convolving two signals of length Lx and Lh gives back a signal of length Lx (or Lx + Lh). Neither is correct: the true output is one sample shorter than the sum of the two lengths, since the sliding kernel only fully overlaps the signal for a specific, calculable number of positions.

This calculator also compares the two standard ways to compute that convolution, direct time-domain multiplication and accumulation versus an FFT-based approach, and tells you which one needs fewer arithmetic operations for your specific signal and filter lengths.

📐 Formula

Ly = Lx + Lh − 1
Lx = length of the input signal (samples)
Lh = length of the filter or convolution kernel (samples)
Ly = length of the linear convolution output (samples)
Direct cost ≈ Lx·Lh; FFT cost ≈ 3N·log2N, where N is the next power of 2 ≥ Ly
Example: Lx = 1,000, Lh = 50 → Ly = 1,049 samples, direct convolution is cheaper.

📖 How to Use This Calculator

Steps

1
Enter the signal length. Type in the number of samples in your input signal.
2
Enter the kernel length. Type in the number of samples (taps) in your filter or convolution kernel.
3
Read the output length and recommended method. Click Calculate to see the convolution output length, the required FFT size, and whether direct or FFT-based convolution is cheaper.

💡 Example Calculations

Example 1 — Short Audio FIR Filter

Lx = 1,000 samples, Lh = 50 samples

1
Ly = 1,000 + 50 − 1 = 1,049 samples; FFT size N = 2,048
2
Direct = 1,000 × 50 = 50,000 ops; FFT ≈ 3×2,048×11 = 67,584 ops
Output length = 1,049 samples, recommended method = Direct convolution
Try this example →

Example 2 — Long Convolution Reverb

Lx = 100,000 samples, Lh = 5,000 samples

1
Ly = 100,000 + 5,000 − 1 = 104,999 samples; FFT size N = 131,072
2
Direct = 100,000 × 5,000 = 500,000,000 ops; FFT ≈ 6,684,672 ops
Output length = 104,999 samples, recommended method = FFT-based convolution
Try this example →

Example 3 — Equal-Length Block Convolution

Lx = 10,000 samples, Lh = 10,000 samples

1
Ly = 10,000 + 10,000 − 1 = 19,999 samples; FFT size N = 32,768
2
Direct = 10,000 × 10,000 = 100,000,000 ops; FFT ≈ 1,474,560 ops
Output length = 19,999 samples, recommended method = FFT-based convolution
Try this example →

❓ Frequently Asked Questions

What is the length of a linear convolution?+
The output of convolving a signal of length Lx with a filter (kernel) of length Lh has exactly Ly = Lx + Lh - 1 samples. This comes directly from the convolution sum's index range: the first nonzero output sample occurs at index 0 and the last at index Lx + Lh - 2.
Why is convolution length Lx + Lh - 1 and not just Lx + Lh?+
Convolution slides the flipped kernel across the signal one sample at a time. The overlap starts with just 1 sample touching and ends with just 1 sample touching, giving Lx + Lh - 1 total positions where at least one product is nonzero, one fewer than the naive sum of the two lengths.
Why do I need to round the FFT size up to a power of 2?+
The fast Fourier transform (FFT) algorithm's classic radix-2 implementation only runs at full efficiency when the transform length is a power of 2. Rounding the required length up to the next power of 2 guarantees the FFT can represent the full linear convolution without wraparound while staying on the algorithm's fast path.
What happens if my FFT size is too small?+
If the chosen FFT length is smaller than Lx + Lh - 1, the result wraps around the end of the buffer and adds back onto the beginning, corrupting the last few samples with wraparound from the first few (circular convolution aliasing). Always pick an FFT size at least as large as the linear output length.
When is direct convolution faster than FFT-based convolution?+
Direct convolution costs roughly Lx times Lh multiply-adds, while FFT-based convolution costs on the order of N log2(N) where N is the FFT size. For short filters (small Lh) or short signals, the direct method's simpler per-sample cost usually wins; FFT-based methods pull ahead once both lengths grow large enough that N log2(N) drops below Lx times Lh.
What is overlap-add and why does it matter here?+
Overlap-add breaks a very long signal into shorter blocks, convolves each block with the filter using an efficient FFT size, and stitches the overlapping tails back together. It lets you get FFT-based efficiency on an arbitrarily long streaming signal without ever needing one enormous FFT sized to the whole recording.
Does this calculator compute the actual convolved values?+
No, this calculator only estimates the output length, the required FFT size, and the relative computational cost of the two standard methods. Computing the actual convolved samples requires the full signal and kernel data, not just their lengths.
How accurate is the FFT operation-count estimate?+
It is an order-of-magnitude engineering estimate (2 forward transforms, 1 inverse transform, 1 pointwise complex multiply, each FFT costing about N log2 N operations), the standard textbook comparison. Real-world libraries (FFTW, cuFFT, etc.) use different constant factors and mixed-radix algorithms, but the underlying N log2 N growth rate is the same.
Does the filter length or the signal length matter more for the crossover point?+
The filter length Lh sets the slope of the direct method's cost (Lx times Lh grows linearly in Lx with slope Lh), so a longer filter pushes the crossover to a shorter signal length. A very short filter (a few taps) may never make FFT-based convolution worthwhile at ordinary signal lengths.
Is this the same length formula used for circular convolution?+
No. Circular convolution wraps around at whatever length N you choose, and only equals the true linear convolution when N is at least Lx + Lh - 1. The Circular vs Linear Convolution Calculator on this site covers exactly that distinction and the zero-padding needed to avoid aliasing.

What is the length of a linear convolution?

The output of convolving a signal of length Lx with a filter (kernel) of length Lh has exactly Ly = Lx + Lh - 1 samples. This comes directly from the convolution sum's index range: the first nonzero output sample occurs at index 0 and the last at index Lx + Lh - 2.

Why is convolution length Lx + Lh - 1 and not just Lx + Lh?

Convolution slides the flipped kernel across the signal one sample at a time. The overlap starts with just 1 sample touching and ends with just 1 sample touching, giving Lx + Lh - 1 total positions where at least one product is nonzero, one fewer than the naive sum of the two lengths.

Why do I need to round the FFT size up to a power of 2?

The fast Fourier transform (FFT) algorithm's classic radix-2 implementation only runs at full efficiency when the transform length is a power of 2. Rounding the required length up to the next power of 2 guarantees the FFT can represent the full linear convolution without wraparound while staying on the algorithm's fast path.

What happens if my FFT size is too small?

If the chosen FFT length is smaller than Lx + Lh - 1, the result wraps around the end of the buffer and adds back onto the beginning, corrupting the last few samples with wraparound from the first few (circular convolution aliasing). Always pick an FFT size at least as large as the linear output length.

When is direct convolution faster than FFT-based convolution?

Direct convolution costs roughly Lx times Lh multiply-adds, while FFT-based convolution costs on the order of N log2(N) where N is the FFT size. For short filters (small Lh) or short signals, the direct method's simpler per-sample cost usually wins; FFT-based methods pull ahead once both lengths grow large enough that N log2(N) drops below Lx times Lh.

What is overlap-add and why does it matter here?

Overlap-add breaks a very long signal into shorter blocks, convolves each block with the filter using an efficient FFT size, and stitches the overlapping tails back together. It lets you get FFT-based efficiency on an arbitrarily long streaming signal without ever needing one enormous FFT sized to the whole recording.

Does this calculator compute the actual convolved values?

No, this calculator only estimates the output length, the required FFT size, and the relative computational cost of the two standard methods. Computing the actual convolved samples requires the full signal and kernel data, not just their lengths.

How accurate is the FFT operation-count estimate?

It is an order-of-magnitude engineering estimate (2 forward transforms, 1 inverse transform, 1 pointwise complex multiply, each FFT costing about N log2 N operations), the standard textbook comparison. Real-world libraries (FFTW, cuFFT, etc.) use different constant factors and mixed-radix algorithms, but the underlying N log2 N growth rate is the same.

Does the filter length or the signal length matter more for the crossover point?

The filter length Lh sets the slope of the direct method's cost (Lx times Lh grows linearly in Lx with slope Lh), so a longer filter pushes the crossover to a shorter signal length. A very short filter (a few taps) may never make FFT-based convolution worthwhile at ordinary signal lengths.

Is this the same length formula used for circular convolution?

No. Circular convolution wraps around at whatever length N you choose, and only equals the true linear convolution when N is at least Lx + Lh - 1. The Circular vs Linear Convolution Calculator on this site covers exactly that distinction and the zero-padding needed to avoid aliasing.