Window Types: Hanning, Flattop, Uniform, Tukey, and Exponential
There are several different types of windows used to reduce spectral leakage when performing a Fourier Transform of time data into the frequency domain.
In this article, the following windows will be discussed:
This article explains some of the details and tradeoffs of using each of these windows.
In the article, the term ‘measurement time’ refers to the time acquired for a single average or FFT of data. Sometime this is also referred to as ‘frame size’.
In several of the examples provided in the article, a frequency domain plot of the effects of a window on periodic and non-periodic data is shown. In the case of the non-periodic data, it is created with a sine wave half way between two spectral lines to illustrate the worst case amplitude error.
To better understand the terms periodic and non-periodic, reading the Knowledge Base article 'Leakage and Windows' is recommended before reading the rest of this article.
When doing noise and vibration measurements, the Hanning window is commonly used. It is especially useful for random signals that are not periodic as shown in Figure 1. Examples of random signals can include sound generated by driving on a road, or vibration while a pump/motor is running.
Random data can have severe leakage. Because the signal is not synced with the measurement, it can be cutoff abruptly at the beginning and end of the time block. This cutoff creates leakage, which a window will minimize.
Hanning windows are often used with random data because they have moderate (compared to other windows) impact on the frequency resolution and amplitude accuracy of the resulting frequency spectrum. The maximum amplitude error of a Hanning window is 15%, while the frequency leakage is typically confined to 1.5 Δf, or bins, to each side of the original signal.
The Hanning window starts at a value of zero and ends at a value of zero (Figure 2). In the center of the window, it has a value of one. This gradual transition between 0 and 1 ensures a smooth change in amplitudes when multiplying the measured signal by the window, which helps reduce the spectral leakage.
The maximum amplitude error can be seen when viewing the spectrum of a non-periodic sine wave. Using a RMS calculation around the frequency peak yields the correct value.
The Flattop window has a better amplitude accuracy in frequency domain compared to the Hanning window (Figure 3). The maximum amplitude error of a Flattop window is less than 0.01%. By contrast, the Hanning window maximum amplitude error is 15%.
A Flattop window confines leakage to 3.43 Δf to each side of the original signal. This is a wider frequency range than the 1.5 Δf width of the Hanning window.
Like a Hanning window, the Flattop window begins and ends with a value of zero. The center of the window has a value of one (Figure 4).
The frequency accuracy of the Flattop window is more coarse compared to a Hanning window. As a result, the Flattop window is typically employed on data where frequency peaks are distinct and well separated from each other.
One common application for a flattop window is performing calibration. For example, a sound pistonphone only produces one single and distinct frequency during microphone calibration. In the ‘AC Calibration’ worksheet of LMS Test.Lab, pressing on the ‘Measurement Info’ shows that a Flattop window is being used (Figure 5).
To ensure amplitude accuracy, the calibration window type cannot be changed by the user. A Flattop will always be used, even if a different window is selected for measuring.
A Uniform window has a value of 1.0 across the entire measurement time as shown in Figure 6. In reality, a Uniform window could be called “no window”. Depending on the data acquisition system used, sometimes the term “Rectangular” window is also used.
A Uniform window creates no frequency or amplitude distortion when the measured signal is periodic. When a measured signal is not periodic, the amplitude is reduced by a maximum of 36% and the frequency content is spread over the entire bandwidth of the measurement.
Whenever a measurement signal is periodic, a Uniform window is preferred. Applying a Hanning or Flattop window to a periodic signal will actually create amplitude and frequency distortion.
Periodic signals can include:
However, if the signal cannot be guaranteed to be periodic, a Uniform window should be avoided.
A Tukey window is very flat in the time domain, close to a value of 1.0 for a majority of the window. A ‘Taper Length’ can be specified which determines the amount of time that the window maintains a value of one (Figure 7). The lower the taper length, the longer the Tukey has a value of one over the measurement time.
Typically, Tukey windows are used to analyze transient data. The advantage of a Tukey window is that the amplitude of transient signal in the time domain is less likely to be altered compared to using Hanning or Flattop (see Figure 8). In a Hanning or Flattop window, the value of the window equals one for a shorter span compared to the Tukey window.
Typical impact events may last a few milliseconds. Examples include vibration from jackhammers, bumps in the road, or diesel engine clatter.
Exponential windows are often used in modal impact testing. They are used to ensure the accelerometer response decays to zero (Figure 9) within the measurement time to avoid leakage issues.
An exponential window starts with a value of 1. The exponential decay parameter, a value between 0% and 100%, determines how much the initial value of the exponential window is reduced by the end of the measurement. For example, a decay parameter of 25% means that the window decays to a quarter of the original amplitude by the time the measurement is finished, as shown in Figure 10.
An exponential decay parameter of 100% is the same as a Uniform window (or not applying a window). When doing modal impact testing, a decay of 100% is preferred if the signal decays to zero in the measurement time frame.
When an exponential window is applied, the measured signal appears to decay more quickly than the original signal (Figure 11).
By decaying faster, artificial damping is added to the resulting measurement. Using the exponential decay parameter recorded in the data, modal curvefitters in LMS Test.Lab can remove the effects and report the correct modal damping values.
Selecting a window to match the measurement data circumstances is important to get accurate and useful data. For example, a Flattop window is ideal for performing a calibration, while an Exponential window is not appropriate.
Hopefully this article provides useful guidance on which windows to use and under what circumstances.
Note: Windows affect both the amplitude and frequency content of a signal. In this article, all spectral data had an amplitude correction factor applied. Read the knowledge base article ‘Amplitude and Energy correction factors’ to learn more about amplitude and energy correction due to windows.
Questions? Call us!