DFT Leakage
Understand how the Discrete Fourier Transform (DFT) frequency index relates to real-world frequencies and why fractional frequency components cause energy leakage across DFT bins. This lesson explains the difference between integer and fractional discrete frequencies and their impact on spectral analysis, helping you grasp the phenomenon of DFT leakage common in real-world signals.
We'll cover the following...
The DFT frequency index represents the pointer to the real-world frequency of the signal. This has been established through the relation
where is the DFT size and is the sample rate. Since is a continuous variable (e.g., 1.5 GHz, 2.4 GHz), the frequency index can be an integer or a fractional number.
Integer discrete frequency
For an integer , sinusoids with analysis frequencies of complete an integer number of cycles within a given duration. For example, implies one cycle per interval that consists of samples (which is why the frequency is cycles/sample). In this case, limiting the sinusoid in a duration of seconds is the same as multiplying an infinitely long sinusoid with a rectangular signal of seconds. This results in a spectrum that has a sinc signal at the location of that frequency. The reason behind this will be discussed later.
Let’s see an example. At , we can see that the sinusoid and the DFT-analysis frequency corresponding to completes four cycles in a given interval. The shape is still a sinc signal. However, the spectrum is sampled at the peak of this sinc signal at index while remaining at zero-crossings for all other values of . This is why we see perfect impulses in the spectrum for integer .
We can change a few values and run the code below to verify the results.
Fractional discrete frequency
For a fractional value, say , everything stays the same but the input frequency does not complete an integer number of cycles in the given interval. The correlation result for this sinusoid and all DFT-analysis frequencies are nonzero, causing the energy to leak into all the remaining bins! In other words, the spectrum is still a sinc signal, but it is not sampled at integer spectral locations.
Let’s test this by changing different values in the code below:
Clearly, the number of cycles in the time-domain signal is not an integer, which is why no DFT-analysis frequency would perfectly match this input. A sudden truncation at the endpoint causes all frequencies to contribute in the formation of this signal, giving rise to leakage in those frequencies.
Since almost all real-world signals are not perfect sinusoids, we encounter DFT leakage in spectral analysis.