Advanced Octave A76 — 3D spectrogram of a varying signal
Advanced GNU Octave with GX-TXT · Module 13
The same time-frequency matrix can become a surface or a chromatic map. We compare the two representations for a synthetic chirp and see what each makes easy or difficult to read.
Objectives and prerequisites
Let’s retake the STFT and A47’s chirp. The test uses GX-TXT dev112-P011-bis and GNU Octave 9.4.0. Import spettro_tempo.m, register it and run it in the Runner. The Dataset octave_chirp_3d_atlas is created-only: to repeat, use a new session or change the ID.
The same estimate in two views
The signal is sampled at 128 Hz; a window Hann from 64 samples advances of 16 samples. The 29 windows last 0.5 s, progress of 0.125 s and have 2 Hz distant frequency points. The script publishes 957 one-sided PSD values in V²/Hz, associated with window centers and frequencies.
The surface variant uses PSD as height:
The heatmap variant features the same values with color on one floor in the three-dimensional viewer:
The coloured strip follows the increase in frequency over time. In this rendering, the map is tilted to the scene and does not show a color numerical bar: use it to locate the trend and consult the dataset values for quantitative readings. The top is a chromatic representation, not a surface whose height corresponds to the PSD.
Resolution and interpretation
The instantaneous frequency of the synthetic signal grows from about 5 to 25 Hz. The apparent amplitude of the track depends on the duration and shape of the window, as well as the frequency grid; the shortest time of the window indicates overlap, not independent observations. A chromatic scale or a different normalization changes perception, thus documenting together with units and data.
Exercise
- What size is the height of the surface?
- How long does the window last?
- Why isn’t the map shown alone reading precise numerical values?
Worked solution
- The spectral density of power in V²/Hz.
- 0.5 s.
- In the observed yield there is a numerical bar of the colors; the matrix data are consulted.
Other steps of this project
- Advanced Octave A75 — Dynamical systems in phase space
- Advanced Octave A81 — Geography of the waves and a 3D surface
- Advanced Octave A82 — Age, sex and demographic inequalities
- Advanced Octave A83 — All-cause mortality, certified COVID deaths and surveillance
- Advanced Octave A84 — A reproducible public account
- Advanced Octave A73 — Optimization landscapes and 3D trajectories