Window Functions in Audacity Plot Spectrum

Audacity's Plot Spectrum tool uses Fast Fourier Transform (FFT) algorithms to convert audio signals from the time domain into the frequency domain for spectral analysis. Because FFT assumes a signal repeats infinitely, applying a windowing function is necessary to taper the edges of audio segments and prevent spectral leakage. This article outlines the specific windowing functions available in Audacity's Plot Spectrum interface, their characteristics, and how to select the right one for your audio analysis.

What Are Windowing Functions?

When an audio segment is extracted for FFT analysis, the arbitrary start and end points can cause abrupt discontinuities, creating artificial high-frequency artifacts known as spectral leakage. Windowing functions apply a mathematical curve to fade the analysis frame in and out smoothly. Each window strikes a different trade-off between frequency resolution (a narrow main lobe) and amplitude accuracy (suppressed side lobes).

Available Window Functions in Audacity

Audacity includes several standard window functions in the Algorithm dropdown of the Plot Spectrum window (Analyze > Plot Spectrum):

How to Choose the Right Window

  1. General Audio and Music Analysis: Hann or Hamming are the standard defaults, providing an optimal compromise between pitch detection and spectral purity.
  2. High Dynamic Range / Low-Level Harmonics: Blackman or Blackman-Harris are preferred when isolating weak harmonic frequencies that might otherwise be masked by the leakage of a loud fundamental frequency.
  3. Strict Frequency Separation: If two pure tones are very close in frequency and roughly equal in amplitude, narrower windows like Hamming or even Rectangular allow for easier separation of the peaks.