Window functions for FFT spectrum analysis.
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:
Additional resources: AudioListener.GetSpectrumData, AudioSource.GetSpectrumData.
| Property | Description |
|---|---|
| Rectangular | Rectangular (no) window for FFT spectrum analysis. |
| Triangle | Triangular (Bartlett) window for FFT spectrum analysis. |
| Hamming | Hamming window for FFT spectrum analysis. |
| Hanning | Hanning (Hann) window for FFT spectrum analysis. |
| Blackman | Blackman window for FFT spectrum analysis. |
| BlackmanHarris | Blackman-Harris window for FFT spectrum analysis. |