Home▸Articles▸Mathematics

The Short-Time Fourier Transform: A Window into Time-Frequency Analysis

A powerful tool for analyzing non-stationary signals, the STFT reveals how the frequency content of a signal changes over time.

mysimulator teamUpdated June 2026≈ 4 min read▶ Open the simulation

What is the Short-Time Fourier Transform?

The Short-Time Fourier Transform (STFT) is a technique used to analyze how the spectral content of a signal changes over time. Unlike the traditional Fourier transform, which provides frequency information for an entire signal, the STFT breaks down the signal into smaller segments and applies a window function to each segment before performing the Fourier transform.

This method allows us to observe both temporal and spectral characteristics of non-stationary signals, making it particularly useful in fields such as audio processing, speech recognition, and biomedical engineering.

How Does the STFT Work?

The process begins by dividing the signal into overlapping segments using a window function. The most common choice is the Hann window, which tapers the edges of each segment to minimize spectral leakage. Each segment is then transformed using the Fourier transform, resulting in a complex-valued spectrum that represents both frequency and time.

By varying the size of the window (N) and the hop length between segments, we can control the trade-off between time resolution and frequency resolution. Smaller windows provide better time resolution but poorer frequency resolution, while larger windows offer the opposite.

live demo · related simulation● LIVE

Why Does It Matter?

The STFT is crucial in many applications where understanding how a signal’s frequency content changes over time is essential. For instance, in audio processing, it can help identify different sounds or instruments in a mix. In biomedical engineering, it aids in analyzing heartbeats and brain waves.

Moreover, the ability to visualize these transformations through spectrograms (2D representations of STFT results) provides an intuitive way to interpret complex signals.

Real-World Applications

The STFT is widely used in speech recognition systems where it helps in distinguishing between different phonemes. In music analysis, it can identify the pitch and timbre of notes over time. It also plays a vital role in seismic data processing to detect earthquake signals.

In medical applications, such as electroencephalography (EEG), the STFT is used to analyze brain activity patterns, helping in diagnosing neurological disorders.

Frequently asked questions

What is a chirp signal?

A chirp signal is a tone whose frequency changes over time. It starts at one frequency and sweeps up or down to another frequency within the duration of the signal, often used in radar and sonar systems.

How does changing the window size affect the spectrogram?

A larger window size increases time resolution but decreases frequency resolution. Conversely, a smaller window size improves frequency resolution at the cost of reduced time resolution, making it easier to detect short-term changes in the signal.

What is spectral leakage and how does it affect STFT results?

Spectral leakage occurs when the Fourier transform of a finite-length signal segment does not perfectly align with its true frequency components. This can cause energy from one frequency bin to spill into adjacent bins, distorting the spectrum. The Hann window helps mitigate this effect by tapering the edges of each segment.

Can STFT be used for stationary signals?

While the STFT is particularly useful for non-stationary signals where frequency content changes over time, it can also be applied to stationary signals. However, in such cases, simpler methods like the standard Fourier transform may suffice.

Try it live

Everything above runs in your browser — open STFT Spectrogram Visualiser: Time-Frequency Analysis (2D) and change the parameters while it is running. Nothing is installed, nothing is uploaded, the whole model lives in one tab.

▶ Open STFT Spectrogram Visualiser: Time-Frequency Analysis (2D) simulation

What did you find?

Add reproduction steps (optional)