There are different types of window functions available, each with their own advantage and preferred application. To show the difference between common windows, we will start by looking at an example.
Example of a window:
Applying a 4-term Blackman-Harris window before the FFT greatly reduces the side lobes, although the main lobe's -3 dB bandwidth has increased from about 1 bin to about 2 bins (compare figure 5 with figure 1). The extra width is usually worth the trade-off.
Figure 5. A window (4-term Blackman-Harris) reduces the side lobes in the frequency-domain
Figure 6 shows the time-domain plot of some common windows. Most windows begin and end at zero and rise to unity in the middle. The narrowest windows in the time domain have the widest main lobes in the frequency domain, and vice-versa.
Figure 6. The time-domain plot of some common windows
- Because of the high side lobes, using the FFT with a rectangular window function (or no window function) is normally not recommended.
- The Hann (also called "Hanning") window function is useful for noise measurements where better frequency resolution than some of the other windows is desired but moderate side lobes do not present a problem.
- The 4-term Blackman-Harris window function is a good general purpose window, having side lobe rejection in the high 90s dB and having a moderately wide main lobe.
- The 7-term Blackman-Harris window function has all the dynamic range you should ever need, but it comes with a wide main lobe.
- The Kaiser-Bessel window function has a variable parameter, beta, which trades off side lobes for main lobe. It compares roughly to the Blackman-Harris window functions, but for the same main lobe width, the near side lobes tend to be higher, but the further-out side sidelobes are lower.
As computers get faster and come with more memory, tolerable FFT sizes grow accordingly. Even back in 2000, large FFTs could be computed fast enough that the 7-term Blackman-Harris window provided quite good frequency resolution and, of course, extremely good dynamic range. Future computing horsepower will favor the windows with the highest dynamic range.
Figure 7. The frequency-domain response of the windows from figure 6
Selecting a window function is not a simple task. Each window function has its own characteristics and suitability for different applications. To choose a window function, you must estimate the frequency content of the signal.
- If the signal contains strong interfering frequency components distant from the frequency of interest, choose a smoothing window with a high side lobe roll-off rate.
- If the signal contains strong interfering signals near the frequency of interest, choose a window function with a low maximum side lobe level.
- If the frequency of interest contains two or more signals very near to each other, spectral resolution is important. In this case, it is best to choose a smoothing window with a very narrow main lobe.
- If the amplitude accuracy of a single frequency component is more important than the exact location of the component in a given frequency bin, choose a window with a wide main lobe.
- If the signal spectrum is rather flat or broadband in frequency content, use the uniform window, or no window.
- In general, the Hanning window is satisfactory in 95% of cases. It has good frequency resolution and reduced spectral leakage. If you do not know the nature of the signal but you want to apply a smoothing window, start with the Hanning window.
To get an overview of the what window function to choose with certain signal types and applications, refer to the list in figure 8.
|Type of Signal
|Transients whose duration is shorter than the length of the window
|Transients whose duration is longer than the length of the window
|Spectral analysis (frequency-response measurements)
||Hanning (for random excitation), Rectangular (for pseudorandom excitation)
|Separation of two tones with frequencies very close to each other but with widely differing amplitudes
|Separation of two tones with frequencies very close to each other but with almost equal amplitudes
|Accurate single-tone amplitude measurements
|Sine wave or combination of sine waves
|Sine wave and amplitude accuracy is important
|Narrowband random signal (vibration data)
|Broadband random (white noise)
|Closely spaced sine waves
|Excitation signals (hammer blow)
Figure 8. Recommendations for different window types