Advanced Octave A76 — 3D spectrogram of a varying signal

by Giux GX-TXT, octave-en, scripts-en 2 min read

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

  1. What size is the height of the surface?
  2. How long does the window last?
  3. Why isn’t the map shown alone reading precise numerical values?

Worked solution

  1. The spectral density of power in V²/Hz.
  2. 0.5 s.
  3. In the observed yield there is a numerical bar of the colors; the matrix data are consulted.

Download the Module 13 scripts (ZIP)

#GNU Octave #GX-TXT #GX-TXT public APIs

Other steps of this project

Leave a Reply

Your email address will not be published. Required fields are marked *