When we select a segment of a real-world signal to transform with the DFT, it will likely not be periodically continuous at its boundaries (in the way that sinusoids are).
Discontinuous signal boundaries produce a “smearing” of the frequency content estimation of the DFT.
One way to reduce some of these problems is to multiply the extracted audio signal by a time-domain function (called a window), which itself is smooth and continuous at its edges.
The most commonly used windows include the Rectangular, Triangular, Hanning, Hamming, and Blackman types.
Important differentiating aspects of these windows are the main lobe width and sidelobe magnitudes of their spectra.
The Rectangular window and its associated spectrum (interpolated) are shown in Fig. 6.
Figure 6:
The Rectangular window and its associated spectrum.
In the heterodyning interpretation of the DFT, a rectangular window functions as a corresponding very narrow-band frequency-domain lowpass filter (the main lobe), as seen in Fig. 6.
The Triangular window and its associated spectrum (interpolated) are shown in Fig. 7.
Figure 7:
The Triangular window and its associated spectrum.
The Triangle window can be computed as:
(14)
The Hanning window and its associated spectrum (interpolated) are shown in Fig. 8.
Figure 8:
The Hanning window and its associated spectrum.
The Hanning window can be computed as:
(15)
The Hamming window and its associated spectrum (interpolated) are shown in Fig. 9.
Figure 9:
The Hamming window and its associated spectrum.
The Hamming window can be computed as:
(16)
The Blackman window and its associated spectrum (interpolated) are shown in Fig. 10.
Figure 10:
The Blackman window and its associated spectrum.
The Blackman window can be computed as:
(17)
In all cases, the smooth, tapering time-domain windows produce wider frequency-domain main lobes, which allow more spurious surrounding spectral components to leak into an estimate of a sinusoidal weight.
At the same time, however, these smooth time-domain windows have lower side-lobe levels, which help attenuate the amount of spectral “splatter” across the spectrum and promote a more accurate frequency estimation.