The operation itself
Convolution takes two functions and produces a third. For discrete signals — the kind a computer actually stores — it is a sliding weighted sum: flip one sequence, slide it across the other one sample at a time, and at every position multiply the overlapping values together and add them up. The result at each shift is one output sample. Written out, the convolution of signal x with kernel h is:
y[n] = Σ x[k] * h[n - k] // sum over all k
// h is flipped and slid across x
That may look abstract, but a concrete case makes it click immediately. Let h be a three-tap kernel of [1/3, 1/3, 1/3]. Convolving any signal with it replaces every output sample with the average of itself and its two neighbours — a moving average, the simplest possible low-pass filter, smoothing away fast wiggles while leaving the slow trend intact.
Why every LTI system is a convolution
Convolution is not just one useful trick among many — it is a theorem in disguise. Any linear, time-invariant (LTI) system — one where doubling the input doubles the output, and delaying the input by any amount delays the output by exactly the same amount, unchanged in shape — is completely characterized by a single function: its response to a single instantaneous impulse, the impulse response. Once you know that one response, the system's output to any input whatsoever is just the convolution of the input with the impulse response. Every fixed linear filter, whether it is smoothing an audio waveform, blurring an image, or modelling how a room's acoustics colour a sound, is, structurally, exactly this same operation.
Kernels you already recognize
Changing the kernel changes what the filter does, without changing the underlying machinery. A kernel that subtracts a shifted, smoothed copy of the signal from itself produces edge detection or sharpening — accentuating fast changes instead of removing them. A Gaussian-shaped kernel produces the smooth, natural-looking blur used throughout image processing, because it has no sharp corners to introduce ringing artifacts. In two dimensions the same sliding-and-summing operation, applied with a small kernel over every pixel neighbourhood, is exactly the convolution layer at the heart of a convolutional neural network — each learned kernel detects a particular local pattern, wherever it appears in the image.
The convolution theorem: multiplication in disguise
Convolution in the time (or space) domain corresponds exactly to ordinary pointwise multiplication in the frequency domain, and vice versa. This convolution theorem is one of the most useful facts in all of signal processing: it means filtering — reshaping a signal by convolving it with a kernel — can be understood equally as reshaping its spectrum by multiplying by the kernel's frequency response. A low-pass kernel's frequency response is large near zero frequency and small at high frequency; multiplying the signal's spectrum by that response is precisely what removes the fast wiggles, seen from the other domain.
convolve(x, h) in time domain ⇔ multiply(X(f), H(f)) in frequency domain, where X, H are Fourier transforms
Fast convolution: why the FFT matters here too
Direct convolution of two length-n sequences costs on the order of n² multiplications — every output sample sums over every kernel tap. For a long kernel or a long signal that is expensive. The convolution theorem hands over an escape route: transform both signals to the frequency domain with the Fast Fourier Transform in O(n log n), multiply them pointwise in O(n), and transform the product back in another O(n log n) — dramatically cheaper than direct convolution once the kernel is long enough to make the crossover worthwhile, which is exactly why audio and image processing libraries switch strategies based on kernel size.
Frequently asked questions
What does it mean for a system to be linear and time-invariant?
Linear means scaling or adding inputs scales or adds the outputs the same way, with no extra cross-terms. Time-invariant means the system behaves the same regardless of when the input arrives — delay the input and the output is delayed by exactly the same amount, unchanged in shape. Only systems with both properties are guaranteed to be fully described by convolution with a single impulse response.
Why is the kernel flipped in the convolution formula?
The flip accounts for causality and ordering: convolution sums the input weighted by how the system responds to something that happened a certain time ago, and flipping the kernel before sliding it makes that time-ordering come out correctly, rather than computing correlation, which does not flip and measures similarity instead of response.
Why does multiplying in the frequency domain make convolution so much faster?
Direct convolution of two length-n sequences costs on the order of n squared multiplications. The convolution theorem says convolution in time equals plain multiplication in frequency, and the Fast Fourier Transform computes each direction in about n log n operations, so transforming both signals, multiplying pointwise and transforming back is far cheaper than direct convolution once n is large.
Try it live
Everything above runs in your browser — open Convolution and change the parameters while it is running. Nothing is installed, nothing is uploaded, the whole model lives in one tab.
▶ Open Convolution simulation