The STFT takes Fourier transforms of successive windowed signal segments. It produces complex coefficients indexed by time and frequency.
Mathematical principle
L is window length, H is hop size, K is transform length, and w[n] is the window.
Input definitions
| Item | Meaning |
|---|---|
| Recording | Samples and sampling rate. |
| Window length | Duration represented in each local spectrum. |
| Hop size | Distance between consecutive windows. |
Analysis choices
| Item | Meaning |
|---|---|
| Window function | Controls the weighting of each segment. |
| Padding | Affects boundaries and frequency-bin sampling. |
| Displayed quantity | Specify magnitude, squared magnitude, or PSD scaling. |
Worked mathematical figure
Interpretation
Longer windows generally distinguish nearby frequencies more finely while averaging over a longer interval. More overlap increases temporal sampling of the representation. Boundary treatment and color scaling should be recorded.
Scientific references
Related major models
From the principle to a scoped workflow
An STFT result needs its window, hop, transform length, boundary handling and displayed quantity. A time–frequency image alone cannot supply those settings or identify whether its color values are magnitude, squared magnitude or density.
| Learning path | What to inspect and what it establishes |
|---|---|
| Record windows, hops and display choices | Use the settings lesson to separate input scope, calculation parameters and display controls. Keep time and frequency units with the selected representation. Evidence scope: This is preparation guidance. Its named FFT/Welch examples do not establish STFT normalization or boundary behavior. |
| Read padded frames and saved STFT arrays | Inspect the named Earthquake spectrogram example: its numerical grid, padded edge frames and complete older export, alongside a separately reviewed current-source zero-power result. Evidence scope: Two bounded synthetic cases on separately identified sources. No complex-coefficient export, current positive-layout acceptance, physical PSD validity or whole-method claim. |
Watch the scientific explanation
Read the video transcript
0:00 The instantaneous frequency of this synthetic chirp is 4 + 8t hertz. Its oscillations become faster over the two-second record.
0:08 A 64-sample Hann window moves through data sampled at 128 hertz, advancing by eight samples at a time. Each window produces a short-time spectrum.
0:16 The spectrogram places those spectra at the window centers. Darker teal indicates greater normalized magnitude. The finite window spreads energy across frequency bins; the plot is not an exact trace of instantaneous frequency.