7.1. Warm-up: a single sinusoid#

When we defined the Discrete Fourier Transform (DFT) (Section 5.5.2), we saw that it exactly encodes the amplitude (\(A\)) and phase (\(\phi\)) of a sinusoidal input, at least when the frequency matches one of the analysis frequencies. Specifically, we saw that (for \(m \notin \{0, N/2\}\)),

\[\blue{x[n] = A\cdot \cos\left(2\pi \cdot \frac{m}{N}\cdot n + \phi \right)} \quad \Rightarrow \quad \darkblue{X[m] = A \cdot \frac{N}{2} \cdot e^{\mathrm{j}\cdot \phi}}.\]

Of course, this doesn’t tell us much if \(\blue{x[n]}\) is not of that particular given form. The DFT is still well defined, even if \(\blue{x[n]}\) is a completely arbitrary set of sample values:

\[\darkblue{X[m]} = \sum_{n=0}^{N-1} \blue{x[n]} \cdot \purple{e^{-2\pi\cdot\mathrm{j}\cdot m\cdot n / N}}\]

This raises the question: how do we interpret the coefficients \(\darkblue{X[m]}\) for arbitrary signals \(\blue{x[n]}\)? We’ll answer this by showing that there exists an inverse DFT, which can reconstruct the input signal \(\blue{x[n]}\) exactly from only its DFT coefficients \(\darkblue{X[m]}\).

7.1.1. Recovering a sinusoid#

Before defining the full inverse DFT, let’s first try to recover a single sinusoid from its DFT spectrum.

Recall from Section 5.6.2 that a sinusoid at an analysis frequency index \(m\) will have two non-zero DFT coefficients: \(\darkblue{X[m]}\) and \(\darkblue{X[N-m]}\), which are complex conjugates of each other: their real parts are the same, and their imaginary parts are opposite:

\[\begin{align*} \darkblue{X[m]} &= A \cdot \frac{N}{2} \cdot e^{\mathrm{j}\cdot \phi}\\ \darkblue{X[N-m]} &= A \cdot \frac{N}{2} \cdot e^{-\mathrm{j}\cdot \phi} \end{align*}\]

Each of these components can be used to produce a complex sinusoid \(z_m[n]\) as follows:

\[\begin{align*} z_m[n] &= \darkblue{X[m]} \cdot e^{2\pi \cdot \mathrm{j} \cdot \frac{m}{N} \cdot n}\\ &= A \cdot \frac{N}{2} \cdot e^{\mathrm{j}\cdot \phi} \cdot e^{2\pi \cdot \mathrm{j} \cdot \frac{m}{N} \cdot n}\\ &= A \cdot \frac{N}{2} \cdot e^{\mathrm{j}\cdot \left(2\pi \cdot \frac{m}{N} \cdot n + \phi\right)} \end{align*}\]

This is demonstrated visually in Fig. 7.1.

a sinusoid and the complex sinusoids derived from its DFT

Fig. 7.1 Top: a sinusoid \(\blue{x[n] = 0.75 \cdot \cos(2\pi \cdot 5 \cdot \frac{n}{N} + \frac{\pi}{3})}\) with \(N = f_s = 25\). Middle: the complex sinusoid corresponding to \(\darkblue{X[5]}\) (real and imaginary portions shown separately). Bottom: the complex sinusoid corresponding to \(\darkblue{X[N-5]}\). For complex sinusoids, the real and imaginary parts are plotted separately.#

Because the imaginary parts of \(\darkblue{X[m]}\) and \(\darkblue{X[N-m]}\) are opposite (\(\darkblue{X[m] = \overline{X[N-m]}}\)), summing the two doubles the real part and cancels the imaginary part, and we’ll be left with a cosine wave at the appropriate phase:

\[\begin{split}z_m[n] + z_{N-m}[n] = A \cdot N \cdot \red{\cos\left(2\pi \cdot \frac{m}{N} \cdot n + \phi \right)}\\\end{split}\]

This is exactly what we started with (\(\blue{x[n]}\)), except there’s an additional scaling of \(N\) in front. So, for at least this simple case of a single sinusoid, we can recover the input signal by generating the corresponding sinusoids with the parameters encoded by the magnitude and phase in the DFT, and dividing out the length of the signal \(N\).

As we’ll see in the next section, this strategy works in general: we don’t need to assume that \(\blue{x[n]}\) is a single sinusoid!