On the DFT Leakage

On the DFT Leakage

A phenomenon often overlooked in DSP classes but critically important for practical and accurate spectral analysis is DFT leakage. This occurs in the Discrete Fourier Transform (DFT) when a signal's frequency components fail to align perfectly with the DFT bin frequencies. The result is a smearing or spreading of energy from a single frequency component into adjacent bins, leading to broadened peaks in the frequency spectrum.

Understanding DFT Leakage Through Simple Examples

Consider a discrete-time sinusoidal signal:

Article content

The plot below shows three full cycles of this signal in the time domain:

Article content

In the frequency domain, its Discrete-Time Fourier Transform (DTFT), when windowed by an 8-sample rectangular pulse, produces a sinc-like blue graph below. And the red graph shows its 8-point DFT sequence (which, as expected, includes the frequency domain samples of its DTFT).

Article content

Here, all the signal energy is concentrated at the frequency of 2𝝅/8 rad/sample and its image at -2𝝅/8 (or equivalently as shown above at 14𝝅/8) rad/sample. Remember that any discrete-time frequency spectrum is always periodic with the period 2𝝅 rad/sample.

Now consider another sinusoidal signal:

Article content

The plot below again shows the DTFT of its windowed version by an 8-sample rectangular pulse, as well as its 8-point DFT.

Article content

This signal is still a single-tone signal, and yet, as seen above, its DFT is non-zero at multiple different frequency bins beyond its tone frequency. This is exactly the DFT leakage phenomenon in how the signal energy has leaked into other frequency bins!

So what happened here? What is the difference between our two single-tone signals? In our first example, the signal frequency of 2𝝅/8 happens to fall exactly on top of one of the 8 frequency bins in our 8-point DFT, whereas in our second example, the tone frequency of 3𝝅/8 does not align with any of our 8 DFT frequency bins.

But why does this cause the DFT leakage? What causes this discrepancy? In the first example, the frequency of 2𝝅/8 aligns perfectly with a DFT bin, resulting in an exact number of full cycles within the 8 samples in the time domain. This is not the case with the second tone.

Remember that the DFT is nothing but samples of the DTFT in the frequency domain. Sampling in the frequency domain implies that the time domain signal is getting periodically extended (this is just the dual of how the sampling in the time domain leads to periodically extending the spectrum in the frequency domain). And when you have a full number of cycles within the number of points used in the DFT, periodically extending it will not alter the shape of the tone, and the resulting periodically extended signal will remain as a single tone with the same frequency. In the second example, however, periodically extending the tone distorts its shape, introducing energy at other frequencies, as demonstrated by the non-zero DFT values. Notice that this is not just a pure mathematical artifact in the sense that it is truly reflecting the nature of the discrete-time periodically extended signal which corresponds in the time domain to the DFT sequence in the frequency domain.

Importance of DFT Leakage in Spectral Analysis

To highlight the practical implications, let's consider this signal:

Article content

This signal contains two tones: a strong one at 1300 Hz and a weaker one at 1950 Hz. Sampling at 8 kHz and computing its 128-point DFT reveals severe leakage, nearly burying the second tone in the spectrum. This shows how DFT leakage can obscure smaller frequency components, hampering our spectral analysis.

Article content

Windowing to Mitigate DFT Leakage

When computing an N-point DFT, we take N samples of the signal in the time domain, and as such, the signal is inevitably windowed in the time domain. For a single complex exponential signal:

Article content

The DTFT of the windowed signal becomes:

Article content

where W(ω) is the DTFT of the window. Without special treatment, the window is rectangular, resulting in a sinc-like spectrum. If the frequency ω0 aligns with a DFT bin, the energy will be concentrated in a single bin. However, as already demonstrated above, misalignment (non-integer cycles within the window) will lead to a sinc-shaped DFT magnitude, causing leakage into other bins.

To reduce leakage, one approach is to pre-window the signal with a function that has better spectral properties. Over the years, different window functions with different spectral characteristics have been proposed. The plots below show some of the common windows. Compared to the rectangular window, noticed how the other windows have a wider main lobe but significantly diminished side lobes which help in reducing the DFT leakage.

Article content
Article content

Let's revisit our two-tone example. The figure below shows the signal and its samples windowed with both rectangular and the Hann window.

Article content

And its DFT plot below shows how applying a Hann window before computing the DFT produces a clearer spectrum. Although the wider main lobe increases neighboring DFT components and broadens the main lob associated with the stronger tone at 1300 Hz, the reduced leakage makes it easier to identify the weaker tone at 1950 Hz.

Article content

Conclusion

DFT leakage is a critical concept for anyone performing spectral analysis. By understanding its causes and applying mitigation techniques like windowing, engineers can achieve more accurate and reliable frequency-domain representations. This understanding is essential for applications in signal processing, communications, and beyond.

Chad Walsh

Patent Attorney - semiconductors, medical technologies, AI/ML, software, electronics

8mo

Great article Kambiz! Your students are very lucky to have a Prof so dedicated to providing common sense perspectives (if such a thing is even possible for DT signal processing Lol).

To view or add a comment, sign in

Others also viewed

Explore topics