In Section 5.3.4, we used windows to smooth out the truncated impulse response of
an ideal filter for designing an FIR filter. In this section, we showed that those window
functions can also be used to modify the spectrum estimated by the DFT. If the window
function, w(n), is applied to the input signal, the DFT outputs are given by
, k 0, 1, . . . , N À 1:
The rectangular window has the narrowest mainlobe width, thus providing the best
spectral resolution. However, its high-level sidelobes produce undesired spectral leak-
age. The amount of leakage can be substantially reduced at the cost of decreased
spectral resolution by using appropriate non-rectangular window functions introduced
in Section 5.3.4.
As discussed before, frequency resolution is directly related to the window's mainlobe
width. A narrow mainlobe will allow closely spaced frequency components to be
identified; while a wide mainlobe will cause nearby frequency components to blend.
For a given window length N, windows such as rectangular, Hanning, and Hamming
have relatively narrow mainlobe compared with Blackman or Kaiser windows. Unfor-
tunately, the first three windows have relatively high sidelobes, thus having more
spectral leakage. There is a trade-off between frequency resolution and spectral leakage
in choosing windows for a given application.
Example 7.10: Consider the sinewave used in Example 7.9. Using the Kaiser
window defined in (5.3.26) with L 128 and b 8:96, the magnitude spectrum
is shown in Figure 7.11 using the MATLAB script Exam7_10.m included in the
Figure 7.11 Effect of Kaiser window function for reducing spectral leakage: (a) rectangular
window, and (b) Kaiser window