9.5 Linear, time-invariant filters

9.5 Linear, time-invariant filters#

We have been calling convolution an LTI filter without justifying the name. Now we can. LTI stands for two properties, linearity and time-invariance, and convolution has both.

Important

The single most important property of LTI filters, and the main reason they are the workhorse of computer music, is that they cannot add any new frequency content to a signal. An LTI filter can only boost or attenuate the frequencies that are already present. This is exactly what makes their effect predictable, and it is why “shaping the spectrum” is a complete description of what they do.

These are properties of a filter in general, so we state them for an arbitrary filter \(g\) first, then show that convolution satisfies them.

A filter \(g\) is linear if it respects scaling and addition:

  1. Consistency over gain. Scaling the input scales the output by the same factor: \(\;g(A \cdot x) = A \cdot g(x)\) for any constant \(A\).

  2. Consistency over mixtures. The response to a sum of inputs is the sum of the responses: \(\;g(x_1 + x_2) = g(x_1) + g(x_2)\).

A filter \(g\) is time-invariant if delaying the input merely delays the output by the same amount, without otherwise changing it. Writing \(\Delta_d = [\underbrace{0, 0, \ldots, 0}_{d\text{ zeros}}, 1]\) for the impulse response that delays a signal by \(d\) samples (so \(\Delta_d * x\) is \(x\) delayed by \(d\)),

\[g(\Delta_d * x) = \Delta_d * g(x) \quad \text{for all } d \ge 0.\]

In words, it makes no difference whether you delay first and then filter, or filter first and then delay.

Non-LTI filters#

Not every filter is LTI. Two familiar operations fail the tests above. The first is clipping, which hard-limits a signal to \([-1, 1]\) (as in Chapter 1):

\[y[n] = \min\big(\max(x[n], -1),\, 1\big).\]

Clipping is not linear. Take the quiet signal \(x = [0.5]\): doubling the input doubles the output, since \(g(2x) = [1] = 2\,g(x)\). But for the loud signal \(x = [1]\), the output is already at the limit, so doubling the input leaves the output unchanged: \(g(2x) = [1] \ne 2\,g(x) = [2]\). Consistency over gain fails.

The second is time reversal, which flips a length-\(N\) signal back to front:

\[y[n] = x[N-1-n].\]

Reversal is linear but not time-invariant. Take \(x = [1, 2, 3]\) and a one-sample delay \(\Delta_1\). Delaying first and then reversing gives \(g(\Delta_1 * x) = g([0, 1, 2, 3]) = [3, 2, 1, 0]\), whereas reversing first and then delaying gives \(\Delta_1 * g(x) = \Delta_1 * [3, 2, 1] = [0, 3, 2, 1]\). The two disagree, so consistency over delay fails.

LTI filters#

Convolution satisfies both properties, so it is a linear, time-invariant filter. This follows directly from the algebraic properties we established earlier, rather than needing any new argument.

Convolution is linear because of its distributivity and scaling. Distributivity, \(h * (x_1 + x_2) = h * x_1 + h * x_2\), is exactly consistency over mixtures, and \(h * (A x) = A (h * x)\) is exactly consistency over gain.

Convolution is time-invariant because delaying a signal is itself a convolution, with the delay impulse \(\Delta_d\). So by associativity and commutativity, \(h * (\Delta_d * x) = \Delta_d * (h * x)\): filtering then delaying gives the same result as delaying then filtering.

In fact, the converse is also true, though we will not prove it: every LTI filter can be written as a convolution with some impulse response, one that may be infinitely long (as we will see with recursive filters just below). This is a remarkably strong statement. It means the humble convolution sum captures the entire universe of LTI filters, and it is why the impulse response is such a powerful tool.