Simcenter Testing Solutions Windows and Spectral Leakage

Simcenter Testlab



Direct YouTube link:

Windows and Spectral Leakage

*** Webinars: Fundamentals of Digital Data Acquisition and Digital Signal Processing ***

This article explains what causes leakage, what it looks like, and how to use windows to mitigate the effects of leakage by smoothing a signal in the time domain before performing a Fourier Transform.

1.  Sine Wave Example
2. Leakage
   2.1 Periodic Signals

   2.2 Non-Periodic Signals
3. Windows
4. Benefit of Reducing Leakage
5. Window Types
6. Conclusions

1. Sine Wave Example

Take an example with a sine wave. Suppose the digital signal processing settings used to measure a Fast Fourier Transform (FFT) that will result in a 1 Hz frequency resolution as shown in Figure 1. The frequency resolution setting means that the data can only be displayed every 1 Hz.


Figure 1: Left – A 3 Hz sine wave has the correct amplitude on a 1 Hz frequency resolution FFT. Right – When the sine wave is not an integer multiple of the frequency resolution

The following can be observed from Figure 1:

  • On the left side, there is no problem to display the three Hertz sine wave in the frequency domain. At the three Hertz spectral line, the amplitude is 5 Volts exactly. Three Hertz is an integer multiple of the frequency resolution of 1 Hz.
  • On the right side, it is not as clear how the 2.5 Hertz sine wave can be represented. The computer, due to the acquisition settings, can only display data every 1 Hz. Displaying data at 2.5 Hertz is not a possibility.

Because data cannot be displayed at 2.5 Hertz, the 2.5 Hertz signal will leak from zero Hertz to the full bandwidth as shown in Figure 2. This might be surprising, as intuitively one might guess that the spectral leakage would be confined to the adjacent frequency lines (2 Hz and 3 Hz in this case).


Figure 2: Frequency spectrum of sine wave aligning with frequency resolution (red) and sine wave not aligning with frequency resolution (green)

A signal with leakage (green in Figure 2) has lower amplitude and a broader frequency response than a signal with no leakage (red in Figure 2). This makes it difficult to quantify the signal properly in the frequency domain.

2. Leakage

Why does leakage effect the entire frequency range? It has to do with whether or not the signal is periodic relative to the measurement time frame.

2.1 Periodic Signals

A signal measured "periodically" has certain characteristics. Consider the measurement in Figure 3.

User-added image
Figure 3: When a signal is measured periodically, repeating and appending captured signal recreates original signal

A measurement of a sine wave is performed. Notice that only a small amount of the original sine wave signal was captured, based on the framesize specified for the acquisition. Any signal that is measured in a data acquisition system is not measured forever, so only a portion of the signal is recorded.  This is called the ‘captured signal’ in Figure 3.

The ‘captured signal’ is then repeated and appended end to end, which is called the ‘repeated signal’ in Figure 3. If the repeated signal looks like the original sine wave, then the captured signal is periodic.

Why copy the captured signal repeatedly? This is due to the interval of the integration on the Fourier Transform (Equation 1) which the FFT is based upon:

Equation 1: The Fourier Transform has integration limits from negative infinity to positive infinity

The interval of the integral goes from negative infinity to positive infinity, so the small snippet must be repeated to satisfy this equation.

So the FFT algorithm takes the small amount of captured data and repeats it, in order to perform the Fourier Transform and produce a frequency spectrum. It assumes this signal repeats for all time before, and all time after.

In this case, the signal is periodic, and the resulting frequency spectrum will have no leakage.

2.2 Non-Periodic Signals

Using the same signal as shown in the previous section, changing the amount of time captured in the measurement creates non-periodic behavior.

By changing the measurement time a small amount, the captured signal is not periodic, as shown in Figure 4.

User-added image
Figure 4: Example of a measurement time of sine signal that results in non-periodic characteristics

There are sudden transitions at the end of each captured signal. These sharp transients, circled in red in Figure 4, have a broad frequency response. Short transient signals in the time domain produce high, broadband frequency content as shown in Figure 5.


Figure 5: Sharp transient in time domain (left) has broad frequency response (right)

So the resulting spectrum will have broadband response as well as a sinusoidal response as shown in Figure 6 in green.

Figure 6: Sharp transients in repeated signal create leakage (green curve)

Quite often a measurement signal is not periodic with the acquisition time. A running motor or pump does not normally produce frequency content that is an exact integer multiple of the measurement time. The motor or pump operation is not influenced by the acquisition settings.

In controlled experiments, like a modal analysis with a shaker, a measurement can be synchronized with a source to eliminate leakage.

Because the vast majority of measurements will have non-periodic signals, the question is how to minimize leakage in these cases?

3. Windows

To reduce leakage, a mathematical function called a window is applied to the data. Windows are designed to reduce the sharp transient in the re-created signal as much as possible.

Windows are typically shaped as functions that start at a value of zero, move to a value of one, and then return to a value of zero over one frame. The captured signal is multiplied by the window as shown in Figure 7.

Figure 7: A signal (top) is multiplied by a window (middle) resulting in windowed signal (bottom)

The windowed signal is then repeated and appended and shown in Figure 8. Notice that the sharp transients are eliminated (circled in gold) and smoothed out, even though the repeated signal does not match the original signal.

User-added image
Figure 8: After applying a window to the captured signal, the sharp transients are eliminated

Because the sharp transients are reduced and smoothed, the broadband frequency of the spectral leakage is also reduced.

4. Benefit of Reducing Leakage

Why go through the trouble of multiplying the signal by a window if it does not match the original signal?

The benefit is not that the captured signal is perfectly replicated. The main benefit is that the leakage is now confined over a smaller frequency range, instead of affecting the entire frequency bandwidth of the measurement.

The improvement of this reduced frequency range for the leakage is shown in Figure 9.

Figure 9: Periodic sine wave without leakage (red), non-periodic sine wave with leakage (green), and windowed non-periodic sine wave with reduced leakage (blue)

With the leakage spread over a smaller frequency range, doing analysis calculations like RMS yields more accurate results.

In Simcenter Testlab, double X cursors can be used to calculate RMS. Because spectral leakage is reduced, it is easier for an operator to place the cursors over a narrower frequency range.

In Figure 10, it is impossible to calculate the proper RMS amplitude estimate from the double X cursor over a limited frequency range of the un-windowed sine wave, since the leakage is over the full frequency range. Therefore the RMS amplitude is not correct.

Figure 10: Determining the RMS amplitude of periodic sine waves (red) and windowed sine waves (blue) is much easier than calculating RMS from a non-periodic signal with leakage (green)

In real life measurements, there are often many different frequencies present. Without a window being applied, these frequencies would leak into each other, making determining the true amplitude of individual peaks very difficult, if not impossible. In Figure 11, the leakage of two tones with and without a window are overlaid.


Figure 11: Two tones with leakage (green) and with window applied (blue)

In the case of two closely spaced sine tones, the window makes it easier to separate and distinguish each tone so a proper analysis could be performed.

5. Window Types

There are many different windows. Some windows include:

  • Hanning – Used for general data analysis, good tradeoff between frequency and amplitude accuracy
  • Flattop – Excellent accuracy for amplitude, often used in calibration
  • Tukey – Used for transient events
  • Exponential – Used in impact hammer modal testing, be careful of adding artifical damping to measurement
  • Uniform – Another way of saying “no window”

Depending on the measurement situation, the appropriate window can be applied.

See the knowledge article: "Window Types: Hanning, Flattop, Uniform, Tukey, Exponential" for more information.

6. Conclusions

Spectral leakage is a challenge in digital signal processing, which can be addressed by applying windows:

  • Leakage is created by a digital Fourier transform of non-periodic data
  • Leakage causes a redistribution of the signal over the entire frequency range of the measurement
  • Windows can help minimize the effects of leakage by smoothing the time domain signal, but cannot entirely eliminate leakage

Questions? Email or contact Siemens Support Center.

Note: Because windows alter the amplitude and frequency content of a signal, there are ‘correction factors’ which are applied to compensate for the changes created by applying the window. In this article, amplitude corrections were used in the frequency spectrum graphs. There is more information about correction factors in the Window Correction Factors knowledge base article.


Related Links

KB Article ID# KB000032748_EN_US



Associated Components

Simcenter Testlab Digital Image Correlation Testlab Environmental Testlab Acoustics Testlab Data Management Testlab Desktop Testlab Durability Testlab General Acquisition Testlab General Processing & Reporting Testlab Rotating Machinery & Engine Testlab Sound Designer Testlab Structural Dynamics Testlab Turbine