Time-frequency and images · Definition

Short-time Fourier transform

signal processingtime-frequency and images

Before you start you need to know

A single DFT averages the frequency content over the whole signal and loses time information. The STFT addresses this by analyzing local segments of the signal.

Definition

The short-time Fourier transform (STFT, \( X(\tau,\omega) \)) describes how the frequency content of a signal varies over time using a sliding window.

\[X(\tau,\omega)=\sum_{n} x[n]\,w[n-\tau]\,e^{-j\omega n}\]

The STFT is linear in \( x[n] \), and its squared magnitude is the spectrogram. Shifting the window \( w[n] \) by \( \tau \) yields a family of local spectra indexed by time. Reconstruction is possible under suitable overlap conditions (the COLA condition), and the product of time and frequency resolutions is bounded by the uncertainty principle.

Consider \( x[n]=\cos(2\pi\,0.1\,n)\) for \( n<100 \) and \( x[n]=\cos(2\pi\,0.3\,n)\) for \( n\ge 100 \), with a rectangular window of length 32. STFTs centered at \( n<100 \) show a peak near \( \omega=0.2\pi \), while those centered at \( n\ge 100 \) show a peak near \( \omega=0.6\pi \). The spectrogram thus reveals the frequency change that a global DFT would blend together.

A typical mistake is using a window that is too long, which blurs the temporal change so both frequencies appear mixed in the same frames. Another common error is forgetting that the STFT is redundant when the overlap is large, so not all coefficients are independent.

Think about it

Why does a large overlap make the STFT redundant?

Because consecutive frames share samples, so their coefficients are correlated and not independent.

Exercises 10

References

  • Alan V. Oppenheim, Alan S. Willsky, Signals and Systems, 2nd edition, Pearson, 1996.
  • Alan V. Oppenheim, Ronald W. Schafer, Discrete-Time Signal Processing, 3rd edition, Pearson, 2010.