Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


FFTWindow

Window functions for FFT spectrum analysis.
Read time 1 minuteLast updated 5 days ago

Definition

  • Type: Enum
  • Namespace: UnityEngine
  • Assembly: UnityEngine.AudioModule
public enum FFTWindow

Remarks

Pass a value from this enum to the
window
parameter of AudioListener.GetSpectrumData or AudioSource.GetSpectrumData. Unity applies the window to the time-domain samples before the FFT to reduce spectral leakage (energy spreading from one frequency bin into neighboring bins).
Stronger windows taper the signal more at the edges of the analysis block, which typically lowers sidelobe leakage but widens the effective main lobe and can reduce frequency resolution. A more complex window can also be less efficient. For background on the tradeoff, see the notes on AudioSource.GetSpectrumData.
Typical choices:

Fields

Value

Description

BlackmanBlackman window for FFT spectrum analysis.
BlackmanHarrisBlackman-Harris window for FFT spectrum analysis.
HammingHamming window for FFT spectrum analysis.
HanningHanning (Hann) window for FFT spectrum analysis.
RectangularRectangular (no) window for FFT spectrum analysis.
TriangleTriangular (Bartlett) window for FFT spectrum analysis.