Convolution Formula
Convolution computes the output of an LTI system given its impulse response and input.
Used in signal processing, image filtering, and neural networks.
The Formula
Discrete: (f * g)[n] = Σk=−∞∞ f[k] g[n − k]
Convolution is the mathematical operation that describes how an input signal is transformed by a linear time-invariant (LTI) system. If you know a system's impulse response h(t), then the output y(t) to any input x(t) is simply y(t) = x(t) * h(t) — the convolution of the input with the impulse response. This is one of the most important operations in all of engineering and applied mathematics.
Properties
| Property | Statement |
|---|---|
| Commutative | f * g = g * f |
| Associative | (f * g) * h = f * (g * h) |
| Distributive | f * (g + h) = f * g + f * h |
| Convolution Theorem | F{f * g} = F{f} × F{g} (convolution ↔ multiplication in frequency domain) |
| Identity | f * δ = f (the impulse δ is the identity for convolution) |
Example 1 — RC Circuit Output
An RC low-pass filter has impulse response h(t) = (1/τ)e^(−t/τ)u(t). What is the output to a unit step input x(t) = u(t)?
y(t) = x(t) * h(t) = ∫0t (1/τ) e^(−(t−τ)/τ) dτ
= (1/τ) e^(−t/τ) ∫0t e^(τ/τ) dτ
= (1/τ) e^(−t/τ) × τ(e^(t/τ) − 1)
y(t) = 1 − e^(−t/τ) for t ≥ 0 — the classic capacitor charging curve! Convolution gives the circuit's step response automatically.
Example 2 — Discrete Convolution (Signal Processing)
Convolve the signal x = [1, 2, 3] with the filter h = [1, 0, −1] (finite difference approximation).
y[n] = Σ x[k] h[n−k]
y[0] = 1×1 = 1
y[1] = 2×1 + 1×0 = 2
y[2] = 3×1 + 2×0 + 1×(−1) = 2
y[3] = 3×0 + 2×(−1) = −2
y[4] = 3×(−1) = −3; full output y = [1, 2, 2, −2, −3] — this is a simple edge-detection filter in 1D
When to Use It
Convolution is used whenever:
- Computing the output of any LTI system given its impulse response
- Image processing — blurring, sharpening, and edge detection are all convolutions (2D)
- Audio processing — reverb is modeled as convolution with a room impulse response
- Convolutional neural networks (CNNs) — each layer performs discrete 2D convolutions
- Radar and sonar signal processing — matched filtering is cross-correlation (related to convolution)
The convolution theorem is especially powerful: convolution in the time domain equals multiplication in the frequency domain. This means you can compute convolution by: (1) FFT both signals, (2) multiply element-wise, (3) inverse FFT. For large signals, this "fast convolution" is much more efficient than direct convolution.