Instrumentation

What is an FFT window function, and how does it reduce spectral leakage?

Short answer

Spectral leakage is the spreading of a peak's energy into neighboring frequency bins when the record does not hold a whole number of periods. A window function tapers the record edges, which reduces that spreading. Hann suits general vibration, flat-top suits amplitude accuracy, and the rectangular window suits whole-period or transient records.

Where leakage comes from

The FFT treats the record as if it repeats. With a whole number of periods, the start and end match and the peak stays in one bin. Otherwise a discontinuity forms between the ends, and energy spreads into neighboring bins. This is spectral leakage.

A window function multiplies the record by weights that taper toward zero at the edges, which reduces the discontinuity. It has a cost: the peak widens and close components become harder to separate. The Hann window is a balanced choice for general vibration. The flat-top window gives accurate peak amplitudes but makes peaks wide. The rectangular window, meaning no window, suits only whole-period or transient records.

A worked example with a 30.5 Hz tone

Consider a hypothetical record with fs = 1,024 Hz and a duration of 1 second, so N = 1,024 and the bin width is 1 Hz.

  • A 30 Hz tone completes exactly 30 cycles and lands on bin 30. Leakage is low.
  • A 30.5 Hz tone completes 30.5 cycles, so its energy spreads over two neighboring bins.
  • Extend the record to 2 seconds (bin width 0.5 Hz): 30.5 × 2 = 61 cycles, a whole number, so a rectangular window gives no leakage for this tone.

A real machine has several frequencies and changing speed, so no single record length suits every component; that is why windows are used. The Welch method averages overlapping segments. For an 8,192-sample record with 1,024-sample segments and 50 percent overlap, the segment count is (8,192 − 1,024) / 512 + 1 = 15.

Common mistakes

Window choice is often done badly:

  • Applying a rectangular window to every measurement. A record without whole periods leaks energy across the whole spectrum.
  • Using flat-top to separate two close peaks. Flat-top gives accurate amplitudes but wide peaks, so close components can merge.
  • Averaging with Welch and losing transient events. Averaging dilutes short impacts; a single segment or a spectrogram is needed for those.
  • Reading amplitudes from a windowed spectrum without correction. The window changes the scaling; check the software's window correction.

Follow-up questions

Should I choose Hann or flat-top?

For locating peaks and separating close components, Hann is usually the balanced choice. If you must report the amplitude of one peak accurately, use flat-top. In either case, record which window was used in the report.

Do windows change the amplitude values?

Yes. A window changes the weight of each sample, so amplitude scaling is affected. Check whether your software applies the window correction factor. The simplest test is a sinusoid of known amplitude.

Sources

Example numbers are hypothetical, not measured field results.

Related questions

All questions