Process / pipelineSignal ProcessingSpectral analysisPipeline

Short-Time Fourier Transform

Also known as: STFT, Windowed Fourier Transform, Time-Frequency Analysis

OriginatorDennis GaborYear1946Sources2Related methods7

The Short-Time Fourier Transform (STFT) is a fundamental signal analysis technique that computes the frequency content of a signal as it evolves over time by applying the Fourier transform to short, overlapping windows of the signal. Introduced conceptually by Dennis Gabor in 1946, the STFT provides a time-frequency representation essential for analyzing non-stationary signals where frequency content changes over time.

Key highlights

  • Provides joint time-frequency representation showing how signal frequency content evolves over time
  • Straightforward computation using standard FFT algorithms with O(N log N) complexity
  • Flexible window function and length choice allows tuning of time-frequency resolution trade-off
  • Well-understood visualization via spectrograms, providing intuitive interpretation of signal characteristics
  • Foundation for many audio and speech processing techniques (pitch detection, speech recognition, music analysis)

Intuition

This section is available to Pro members. Upgrade to Pro

How it works

This section is available to Pro members. Upgrade to Pro

When to use it

Use STFT for analyzing non-stationary signals such as music, speech, and biomedical signals where frequency content changes over time. It is ideal for spectrogram visualization, feature extraction for machine learning, and understanding transient events. Avoid STFT when you need very fine frequency resolution with stationary signals—use longer FFTs or Welch's method instead. Also consider wavelets as an alternative with adaptive time-frequency resolution.

Strengths & limitations

Strengths
  • Provides joint time-frequency representation showing how signal frequency content evolves over time
  • Straightforward computation using standard FFT algorithms with O(N log N) complexity
  • Flexible window function and length choice allows tuning of time-frequency resolution trade-off
  • Well-understood visualization via spectrograms, providing intuitive interpretation of signal characteristics
  • Foundation for many audio and speech processing techniques (pitch detection, speech recognition, music analysis)
Limitations
  • Subject to time-frequency uncertainty principle: cannot achieve arbitrarily fine resolution in both time and frequency
  • Longer windows improve frequency resolution but reduce time localization of transients
  • Shorter windows improve temporal resolution but reduce frequency resolution, unable to resolve closely-spaced frequencies
  • Spectral leakage and windowing artifacts must be managed through proper window function selection
  • Computationally expensive for very long signals or real-time processing with high time-frequency resolution

Common pitfalls

This section is available to Pro members. Upgrade to Pro

Applications

This section is available to Pro members. Upgrade to Pro

Frequently asked

How do I choose the STFT window length?

Window length determines the time-frequency trade-off. A rule of thumb is that you need at least 2-3 cycles of the lowest frequency of interest. For music, 512-2048 samples is typical; for speech, 256-512 samples. Shorter windows preserve temporal events; longer windows provide better frequency resolution. Experiment with different lengths and visualize the resulting spectrograms to find the optimal balance for your application.

What window function should I use?

Hann and Hamming windows are good general-purpose choices with reasonable trade-offs between main lobe width and side lobe levels. Blackman windows have lower spectral leakage at the cost of wider main lobe. Rectangular windows should be avoided unless you specifically need frequency response peaks. Choose based on whether you prioritize frequency resolution (wider main lobe acceptable) or spectral leakage reduction (lower side lobes needed).

What is the optimal overlap percentage for STFT?

50% overlap is a common baseline that provides smooth time evolution without gaps or redundancy. For synthesis applications like phase vocoder, 75% overlap (hop size = window/4) often works better. Higher overlap increases computational cost but improves temporal smoothness. Lower overlap reduces computation but may create discontinuities. The optimal choice depends on your specific application and processing needs.

How does STFT relate to spectrograms and other time-frequency representations?

A spectrogram is the magnitude-squared (power) visualization of the STFT. Other time-frequency methods like continuous wavelet transform and Wigner-Ville distribution exist but have different trade-offs. Wavelets adapt resolution to frequency (lower frequencies get better frequency resolution), while STFT maintains fixed resolution. STFT is simpler and computationally more efficient; choose wavelets if you need frequency-dependent resolution.

Sources

  1. 1.
    Gabor, D. (1946). Theory of Communication. Journal of the Institution of Electrical Engineers, 93(3), 429–457.
  2. 2.
    Oppenheim, A. V., Schafer, R. W., & Buck, J. R. (1999). Discrete-Time Signal Processing (2nd ed.). Prentice Hall.

You have read it. What now?

Cite this page

ScholarGate. (2026, June 3). Short-Time Fourier Transform. ScholarGate. https://scholargate.app/signal-processing/short-time-fourier-transform

Short-Time Fourier Transform | ScholarGate