Skip to content
ExtendedSource checked

Short-Time Fourier Transform

Analyzes frequency content over short moving windows of time.

Quick Facts

Compact metadata for implementation and discovery.

Category
Signal Processing
Difficulty
Intermediate
Family
Time-Frequency Analysis
Tier
Extended
Status
Verified
Review
Source Checked
Sources
1
Formulas
1
Relationships
4
Code example
Not ready
Visualization
Ready
Aliases
STFT

Overview

The Short-Time Fourier Transform applies a window to signal segments and computes a Fourier transform for each segment.

Core Concepts

signal samplestime-frequency windowfrequency-domain transformwindow weightingtime-frequency analysissample windowsignal transformnoise handling

Quick facts

Complexity

Runtime and memory behavior at a glance.

Best

O(w log w)

Average

O(m w log w)

Worst

O(m w log w)

Space

O(m w)

When to Use

  • Use Short-Time Fourier Transform when you need to split a signal into overlapping windows.
  • Use it for spectrograms with inputs like signal.
  • Use it when sampled data needs filtering, transformation, smoothing, or frequency analysis.
  • Use it when the Time-Frequency Analysis tradeoff is acceptable for the problem size.

When Not to Use

  • Avoid it when sample rate, window size, or boundary handling is not defined.
  • Avoid it when the required output is not time-frequency representation.

What It Does

  • Splits a signal into overlapping windows
  • Computes frequency content for each time slice

Use Cases

  • Spectrograms
  • Speech analysis
  • Music feature extraction

Inputs

  • Signal
  • Window function
  • Hop size

Outputs

  • Time-frequency representation

Key Formulas (1)

Windowed transform

X(window, k) = DFT(signalsegment · windowfunction)
X(window, k) = DFT(signal_segment * window_function)

Computes frequency content over short overlapping time windows.

Pseudocode

  1. 1.Choose a window length and hop size
  2. 2.Multiply each segment by a window function
  3. 3.Run an FFT on the segment
  4. 4.Store the spectrum for that time position
  5. 5.Advance by the hop size

Canonical Example

Input
samples = [1, 2, 3, 2, 1]
Output
transformed or filtered samples
Explanation
Short-Time Fourier Transform: The algorithm reads local or frequency structure from the sample sequence.

Implementation Notes

  • Keep the input contract explicit: Signal; Window function; Hop size.
  • Use this step as the implementation spine: Choose a window length and hop size.
  • Then preserve the next state change: Multiply each segment by a window function.
  • Test with simple signals such as constants, impulses, and single-frequency waves.

Common Pitfalls

  • Short windows improve time detail; long windows improve frequency detail.
  • Interpreting transformed values without accounting for scale, phase, or edge effects.
  • Returning time-frequency representation without handling empty, invalid, or boundary inputs.

Interactive Mechanism Walkthrough

Iterative Convergence & State Trajectory

Show a waveform becoming a time-frequency heat map.

Short-Time Fourier Transform mechanism walkthrough step 1 of 5x₀x₁x₂x*
Step 1 of 5: Choose a window length and hop size
spectrogram

Notes

Short-Time Fourier Transform operates in O(m w log w) time and O(m w) space within the Time-Frequency Analysis family. Key governing relation: X(window, k) = DFT(signal_segment * window_function). Often compared with Fast Fourier Transform and Windowing.

Sources (1)

What each reference supports for this entry.

Discrete-Time Signal Processing

Book

Signal-processing reference covering windowed Fourier analysis and time-frequency views.

Open source

Explore Next

Good next jumps from the relationship graph, ranked for useful discovery.

The short-time Fourier transform applies Fourier transforms to overlapping windowed signal frames.

Tags

Signal ProcessingTime FrequencyFrequency DomainWindow Function