Convolution Theorem
Convolution in time equals multiplication in frequency, so filtering means transform, scale each tone, and transform back.
Why Does This Exist?
Smoothing, edge detection, and reverberation are all convolutions: each output mixes neighboring inputs through a kernel. Direct sliding costs for samples and kernel length : a -second audio track against a -second reverb needs multiplies. The convolution theorem rewrites the operation as : transform both, multiply pointwise, invert. Cost drops to , and filter design becomes drawing a frequency response instead of tuning taps. Continuous spectra are the parent Fourier page; fast transforms are DFT and FFT.
The one idea you need first
Convolution slides one signal past the other accumulating products. Exponentials are its eigenfunctions: convolving a tone returns the same tone scaled, which is why tones diagonalize the operation.
Think of It Like This
Stamping with shaped sponges
Pressing a star sponge across paper (sliding convolution) paints stars everywhere slowly. Instead, photograph the sponge's pattern once (transform the kernel), photograph the paper once (transform the signal), multiply the photos pixelwise (cheap scaling per tone), and develop the result (invert). Same gallery wall, fraction of the stamping.
Filter design is choosing the sponge photo: keep star pixels (passband), black out the rest (stopband). Deconvolution tries to divide the photos back apart, which blows up where the sponge photo is near black.
How It Actually Works
For suitable : pointwise. Filtering pipeline: FFT both to length , multiply binwise by the frequency response , inverse FFT. Cost versus direct. The crossover sits near taps for typical FFT constants.
Frequency response is the filter's fingerprint: passes tone , stops it. Deconvolution divides by (Wiener adds noise-floor regularization to tame near-zero bins).
Worked example
Signal length , kernel . Direct: million multiplies. FFT route: pad to , two forward plus one inverse FFT at each, plus multiplies: about operations. Ratio : twelve times faster, widening with . A -tap smoother has response : (DC passes), first null where : tone at removed exactly.
Code
def direct_conv(xs: list[float], h: list[float]) -> list[float]: n, m = len(xs), len(h) return [sum(xs[t - s] * h[s] for s in range(m) if 0 <= t - s < n) for t in range(n)]
xs = [1.0, 2.0, 3.0, 4.0, 5.0]print(direct_conv(xs, [1 / 3, 1 / 3, 1 / 3])) # moving average# -> [0.333, 1.0, 2.0, 3.0, 4.0] (edges use fewer taps)Interior outputs average full windows (, , ); edges average available taps, showing boundary handling explicitly.
Watch Out For
Circular versus linear convolution mix-ups
FFT multiplication implements circular convolution: tails wrap around. Forgetting zero-padding to smears the track's end into its start. Symptoms: clicks at block boundaries in audio, glowing frame edges in images. Pad first, always.
Inverting near-zero response bins
Deconvolution divides by where the filter killed tones, amplifying noise thousandfold there. Naive inverses of smoothed observations explode. Regularize (Wiener: divide by ) and distrust recovered bins the forward filter stopped.
The Quick Version
- Convolution in time is multiplication in frequency, pointwise per tone.
- The example runs about times faster via FFT.
- Crossover to FFT methods sits near taps for standard constants.
- Filter design draws the response ; the -tap smoother nulls tone .
- Pad to or circular wrap corrupts boundaries.
- Deconvolution needs Wiener regularization where responses approach zero.