6.1. Linearity#

The first major property of the DFT that we’ll cover is linearity. We’ve already seen linearity in the context of LSI systems, where we used it to understand what happens when you convolve a filter h with a mixture of signals.

Here, we’ll use linearity slightly differently, but the basic idea is the same.

Property 6.1 (DFT Linearity)

For any pair of signals x1[n] and x2[n] of the same length, and real numbers c1,c2, the following holds:

DFT(c1x1+c2x2)=c1DFT(x1)+c2DFT(x2).

We’ll prove this property algebraically, starting from the definition of the DFT (5.12):

X[m]=n=0N1x[n]exp(j2πmNn)

Proof. Let 0m<N be any frequency index. Using x=c1x1+c2x2 as our input signal, its mth DFT component is

n=0N1(c1x1[n]+c2x2[n])exp(j2πmNn)=n=0N1(c1x1[n]exp(j2πmNn)+c2x2[n]exp(j2πmNn)mn)=c1n=0N1x1[n]exp(j2πmNn)+c2n=0N1x2[n]exp(j2πmNn)=c1X1[m]+c2X2[m].

So if we scale and mix two input signals, the resulting DFT component is the same scaling and mixing of their individual DFT components X1[m] and X2[m]. Since this holds for any m it must hold for all m, so the entire DFT sequence of the mixture is the mixture of the DFT sequences. This is what we set out to prove.

What does linearity buy us?

DFT linearity is important because most interesting signals are not just simple sinusoids. What DFT linearity says is that if we can represent an arbitrary signal x as a weighted combination of sinusoids, then we can reason about its DFT in terms of its constituent sinusoids.

As we will see in the next chapter (and as we’ve hinted at earlier), it turns out that all signals can be represented as a weighted combination of sinusoids.

6.1.1. Magnitude is not linear#

Note that DFT linearity applies to the complex numbers X[m] which encode both magnitude and phase. There is nothing wrong with adding complex numbers, provided it is done correctly, keeping the real and imaginary parts separate.

However, it is a common mistake to add magnitudes rather than the full complex numbers.

Magnitude is not linear.

If signals x1[n] and x2[n] have DFT series X1[m] and X2[m], then the sum y[n]=x1[n]+x2[n] has DFT series Y[m]=X1[m]+X2[m].

But remember,

|Y[m]|=|X1[m]+X2[m]||X1[m]|+|X2[m]|.

Example

For an extreme case, consider x2[n]=x1[n] for some arbitrary, non-empty signal x1. DFT linearity says that X2[m]=1X1[m], so the spectra X1 and X2 are opposites. However, the spectral magnitudes are identical:

X2[m]=X1[m]|X2[m]|=|1X1[m]|=|X1[m]|.

If we were to add the magnitude spectra, we’d get

|X1[m]|+|X2[m]|=|X1[m]|+|X1[m]|=2|X1[m]|.

However, if we mix the two signals in the time domain, we get the empty signal:

y[n]=x1[n]+x2[n]=x1[n]x1[n]=0.

The empty signal has an empty spectrum: Y[m]=0 for all m, but

|Y[m]|=02|X1[m]|

in general.

What this says is that mixing signals does not equate to mixing DFT magnitudes.

../../_images/1f05e6164ecb060c879ba36805f536d0974272c942e376918454072310aee84c.svg

Fig. 6.1 Complex numbers z and w=z have the same magnitude |z|=|w| but different phase. The sum of their magnitudes |z|+|w| is not the same as the magnitude of their sum |z+w|=0.#