Convolution

Convolution is a mathematical operation that combines two signals to produce a third. In digital signal processing, it is the foundation of filtering, system analysis, and correlation. It is often described as "overlap and add" — one signal is reversed, shifted, and multiplied with the other at each position.

The convolution of two discrete signals $x[n]$ and $h[n]$ is defined as:

$(x * h)[n] = \sum_{m=-\infty}^{\infty} x[m] \cdot h[n - m]$

In this equation, $h$ is typically the impulse response of a system. The output $y[n]$ is the sum of all past inputs weighted by the impulse response — this is how a system "remembers" its input history.

The plot above shows how convolution works. A short pulse train (blue) is passed through a system with an exponential impulse response (orange). The output (green) is the sum of scaled and shifted copies of the impulse response — one for each input pulse. This is exactly what happens when a signal passes through a filter.

Convolution has several important properties:

  • Linear: $x * (ay + bz) = a(x * y) + b(x * z)$
  • Time-invariant: shifting the input shifts the output by the same amount
  • Associative: $(x * y) * z = x * (y * z)$
  • Commutative: $x * y = y * x$

The most powerful insight in DSP is the convolution theorem: convolution in the time domain is equivalent to multiplication in the frequency domain. This is why the Fourier transform is so useful — it turns a complex integral into a simple product:

$x[n] * h[n] \longleftrightarrow X[k] \cdot H[k]$

Convolution appears in many areas of engineering:

  • Digital filters — the output is the convolution of the input with the filter's impulse response
  • Image processing — blurring, edge detection, and sharpening are all convolution operations
  • Correlation — convolution with a reversed signal is used for pattern matching
  • System identification — measuring the impulse response reveals how a system behaves

The length of the convolution is the sum of the lengths of the two signals minus one: $N_x + N_h - 1$. This is why the green output in the plot is longer than either input.

See also: Fourier Transform | Convolution Implementation Guide