The Inverse DFT
Contents
7.2. The Inverse DFT#
Generalizing the strategy used in the previous section’s example, we get the following definition for an inverse Discrete Fourier Transform (IDFT).
Definition 7.1 (The Inverse DFT)
Let
Intuitively, this says that the
Before proving the correctness of this definition, we should highlight the three key ways that it differs from the forward DFT defined by equation (5.12):
There is a global scaling of
;The sign of the complex exponent is flipped: positive for inverse transform, negative for the forward transform;
The summation ranges over
(frequencies), rather than (samples). Note that the number of frequencies (and samples) is still , so the summation still ranges from to .
The proof of DFT invertibility makes no assumptions about
Proof. Plugging in the definition of the DFT
Now, there are two cases to consider. If
If
The entire summation, therefore, has
This is exactly what we needed to show: the
7.2.1. The IDFT in practice#
Like the forward DFT, the inverse DFT (IDFT) is implemented by most signal processing packages.
In Python, we have two ways to invert a DFT, depending on whether we have the full spectrum or only the real part:
# Full spectrum, all N analysis frequencies
X = np.fft.fft(x)
# Full inverse, should produce x_inv == x
x_inv = np.fft.ifft(X)
# Real-part only, 1 + N//2 analysis frequencies
Xr = np.fft.rfft(x)
# Real-part inverse, again produces x_inv == x
x_inv = np.fft.irfft(Xr)
7.2.2. Discussion#
Nowhere in the proof of the inverse DFT did we assume anything about the signal contents
The inverse DFT gives us an alternative representation of signals: every signal
The summation in the inverse DFT
represents the “combination”;The coefficient
encodes the amplitude and phase of the th sinusoid;The complex exponential
represents the th sinusoid itself.
Up until this point, we’ve occasionally had to assume that such a representation exists. But now we’ve proven that it exists.
Aside from analysis and theoretical properties, the inverse DFT gives us tools to modify signals. Rather than operating on individual samples, we can alter the DFT coefficients to produce desired effects, and then take the inverse DFT to recover the time-domain signal. We’ll have more to say about the frequency domain view of filtering in later chapters, but in the next section, we’ll see how to use this insight for synthesizing signals directly.