3.5. Properties of convolution#

As stated earlier in this chapter, convolution acts like a kind of abstract multiplication between signals. Making this statement more precise will have to wait until we’ve developed the Fourier transform, but for now we can end this chapter by showing some of the properties that convolution shares with multiplication.

Note: we’ll assume for now that all convolutions are full mode. With appropriate trimming, you can extend these properties to the other modes, but the notation will get a bit more complicated.

3.5.1. Commutative property#

Convolution is commutative, which is a fancy word for saying that order doesn’t matter. Precisely, commutativity is the property that for any \(x\) and \(h\), the following holds:

Property 3.1 (Commutativity of convolution)

If \(\blue{x}\) is a signal and \(\red{h}\) is an impulse response, then

\[\red{h}*\blue{x} = \red{x}*\blue{h}.\]

What this says in words is that there is no difference between signals and filters: any sequence of numbers can be interpreted as either (or both)!

3.5.2. Associative property#

Convolution is also associative, which means that if we’re chaining a series of convolutions together, it doesn’t matter which one you do first. Imagine that we convolve \(x *h\) and then convolve the result by some other filter \(g\). Associativity says that we could equivalently convolve \(h\) with \(g\) first, and then convolve the result with \(x\). Formally, we have

Property 3.2 (Associativity of convolution)

If \(\blue{x}\) is a signal and \(\red{h}\) and \(\red{g}\) are impulse responses, then

\[\red{g}*(\purple{h*x}) = \red{(g*h)}*\blue{x}\]

Why does this matter? Imagine that \(h\) and \(g\) are both short (maybe a dozen samples) and \(x\) is long (millions of samples). Computing \(h*x\) would take work proportional to the length of \(x\), as would convolving the output with \(g\): you’d have to step through large arrays twice. However, if you convolve \(g*h\) first, that only takes work proportional to the length of the filters (which are small), and then you’d only have to step through the large array once. Reasoning about filters in this way can help you develop more efficient processing chains without changing the calculations.

By combining associativity with commutativity, it turns out that a sequence of convolutions \(x * h * g * \dots\) can be equivalently computed in any order! This fact can be exploited to find the most efficient possible order (e.g. by ordering the inputs from short to long).

3.5.3. Distributive over addition#

Imagine we have two signals \(x_1\) and \(x_2\) that we’d like to filter by \(h\) and then mix. The distributive property says that we can equivalently mix the signals first, and then convolve by \(h\):

Property 3.3 (Distributivity of convolution)

If \(\blue{x_1,x_2}\) are signals and \(\red{h}\) is an impulse response, then

\[\red{h}*\blue{x_1} + \red{h}*\blue{x_2} = \red{h}*\blue{(x_1 + x_2)}.\]

Like the associative property, the distributive property can be used to reduce the amount of computation needed to produce a particular output. Note that the left-hand side of the equation has two convolutions, and the right-hand side has only one.

As we’ll see later, this property can be generalized slightly to show that convolution is a linear operator.

3.5.4. Proving these properties#

To prove that one of these properties holds, one would generally proceed by using the formal definition of convolution, and then applying a sequence of algebraic manipulations until we arrive at the desired result.

As an example, here’s how one could prove the distributive property (Property 3.3).

Proof. Let \(\purple{y} = \red{h}*\blue{(x_1+x_2)}\). Then the \(n\)th sample of \(y\) is

\[\begin{align*} \purple{y[n]} &= \sum_{k=0}^{K-1} \red{h[k]} \cdot \blue{\left(x_1[n-k] + x_2[n-k]\right)} & \text{by definition of } y\\ &= \sum_{k=0}^{K-1} \left(\red{h[k]} \cdot \blue{x_1[n-k]} + \red{h[k]} \cdot \blue{x_2[n-k]}\right) & \text{pull }h[k]\text{ into sum}\\ &= \left(\sum_{k=0}^{K-1} \red{h[k]} \cdot \blue{x_1[n-k]}\right) + \left(\sum_{k=0}^{K-1} \red{h[k]} \cdot \blue{x_2[n-k]}\right) & \text{re-arrange the sum}\\ &= (\red{h}*\blue{x_1})[n] + (\red{h}*\blue{x_2})[n] & \text{ by definition of }*. \end{align*}\]

And since this holds for all \(n\), we get

\[\red{h}*\blue{(x_1+x_2)} = \purple{y} = (\red{h}*\blue{x_1}) + (\red{h}*\blue{x_2}).\]

Similar types of arguments to the one above can be used to show that commutativity or associativity hold. For the mathematically inclined reader, this can be a good exercise. However, this style of proof can be tedious. For the time being, we’ll assume that these properties hold without giving explicit proofs.

In chapter 10, we’ll see some mathematical tools that make it much simpler to show these properties of convolution from (more or less) first principles, without relying on so much algebra.