The scientific question
When does a frequency component occur within a recording?
A single spectrum summarizes a whole record. A spectrogram adds time information by placing the spectrum of each short window at that window’s center.
Mathematical example
Data and analysis settings
| Setting | Definition |
|---|---|
| Sampling frequency | 128 Hz; 256 samples over a two-second record. |
| Window | 64-sample symmetric Hann window; 0.5 s duration. |
| Hop | 8 samples; 0.0625 s between windows. |
| Transform size | 64 points; frequency bins separated by 2 Hz. |
| Magnitude | 2|DFT(window × segment)| / sum(window); displayed as a relative magnitude map. |
| Window placement | 25 full windows; center times from 0.24609375 to 1.74609375 s. No padding. |
1. Inspect the signal
Compare signal_au with instantaneous_frequency_hz. The latter is the analytic phase derivative, not a frequency estimated from the data.
2. Move the window
Use complete 64-sample segments, starting at samples 0, 8, 16, and so on through sample 192. Multiply each segment by the same symmetric Hann window.
3. Place the spectra
Take the 64-point DFT of each windowed segment. Display magnitude against frequency, with each column placed at its window center.
4. Interpret the band
The ridge moves upward as the chirp accelerates. A finite time window blends information within that interval, so the colored band has a width and does not reproduce the instantaneous frequency exactly.
Expected result
| Check | Expected result |
|---|---|
| Known frequency | 4 Hz at t = 0; 19.9375 Hz at the final sampled time. |
| Displayed range | 0–32 Hz; the full real-transform output extends to 64 Hz. |
| Edges | The ends of the record have no full centered window and are left unfilled. |
Scope of this example
The animation is a teaching implementation with its own explicit magnitude convention. It is not a calibrated power spectral density or a specification of a Pop Lab app’s defaults.
Further method reading
Related models
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.
Read and keep this CSV
This is a synthetic teaching dataset. The file contains 256 data rows plus one header row. Its first and last saved timestamps are 0.0 s and 1.9921875 s. Column order is shown below.
| Exact CSV column | Meaning and units |
|---|---|
time_ | Time in seconds. |
signal_ | Synthetic chirp; arbitrary amplitude units. |
instantaneous_ | Analytic instantaneous frequency in Hz, not an estimate from the signal. |
Show the CSV file identity
linear-chirp.csv · 9290 bytes
SHA-256: d74ad7955625b89c
These identifiers describe the retained CSV bytes; they do not establish scientific validity or an application import contract.
Continue with a scoped workflow guide
Compare the scoped Earthquake STFT guide
The Earthquake guide uses different recorded scaling and boundary conventions. Keep its dated source, zero-input and drawing limits separate from this teaching animation.