Keyboard shortcuts

Press ← or β†’ to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Spectrogram πŸ”’

License Required: The Spectrogram window requires a valid LinFIR license.

The Spectrogram visualises the time-frequency energy distribution of the impulse response as a 2-D colour map, making it easy to spot resonances, ringing, and temporal smearing that are difficult to see in a standard frequency response plot.

  • Loudspeaker Design mode β€” shows the predicted sum impulse response for the currently selected angle (on-axis by default); when a non-zero angle is selected in the angle selector the spectrogram updates to reflect that off-axis response, and the window title shows the active angle (e.g. Spectrogram β€” Predicted Sum β€” +15Β°H +0Β°V)
  • Room Calibration mode β€” shows the averaged measurement impulse response

Accessing the Spectrogram

Menu: View β†’ Spectrogram
Keyboard shortcut: W

Spectrogram Spectrogram


Layout

The window is divided into two panels:

  • Main plot β€” the colour-mapped spectrogram
  • Colorbar (right edge) β€” dB scale matching the current colormap range

A control bar above the plot exposes all parameters.


Controls

Transform Algorithm

Two algorithms are available, selectable via the CQT (Morlet) / STFT (Fourier) toggle buttons:

CQT β€” Constant-Q Transform (default)

Implemented as a frequency-domain Morlet (analytic Gaussian) filter bank:

  1. The IR is forward-FFT’d once into an analytic spectrum.
  2. For each log-spaced frequency fβ‚€, the spectrum is multiplied by a Gaussian window of relative bandwidth 1/Q and inverse-FFT’d.
  3. The magnitude of the result is the instantaneous amplitude (envelope) at fβ‚€.

This gives constant relative bandwidth β€” better frequency resolution at low frequencies and better time resolution at high frequencies β€” which matches the logarithmic frequency axis used throughout LinFIR.

STFT β€” Short-Time Fourier Transform

A Gaussian-windowed STFT (75% overlap) with linear frequency bins interpolated onto the log display grid. Provides uniform frequency resolution across the spectrum; the window size controls the time/frequency trade-off. The Gaussian window (Οƒ = 0.4 Β· N/2) offers very low spectral sidelobes, reducing frequency leakage.


Resolution Preset

A ComboBox selects the resolution preset for the active algorithm:

AlgorithmPreset controlsEffect
CQTQ factor (4 – 64)Higher Q β†’ sharper frequency bands, longer time smear
STFTWindow size in samples (128 – 32768)Larger window β†’ better frequency resolution, worse time resolution

The time–frequency trade-off

Any time-frequency transform faces a fundamental constraint: you cannot simultaneously have perfect time resolution and perfect frequency resolution. Improving one always degrades the other. This is the acoustic equivalent of the Heisenberg uncertainty principle.

CQT Q factor

The Q factor defines the ratio of centre frequency to bandwidth for each analysis band:

$$Q = \frac{f_0}{\Delta f}$$

A band centred at \(f_0=1000, \text{Hz}\) with \(Q = 10\) has a bandwidth of \(\Delta f = 100,\text{Hz}\). The corresponding time resolution (temporal smear) is approximately:

$$\Delta t \approx \frac{Q}{f_0} = \frac{1}{\Delta f}$$

QFrequency resolutionTime resolutionTypical use
4 – 8CoarseSharp β€” short smearTransient analysis, impact events
12 – 24ModerateModerateGeneral loudspeaker IRs (default Q = 12)
32 – 64FineBlurred β€” long smearResonance identification, room modes

Because the CQT uses a constant relative bandwidth, low frequencies always have more time smear than high frequencies β€” this is physically correct and matches how we perceive sound.

STFT window size

The STFT divides the IR into short overlapping frames of fixed length N (in samples). Within each frame, the spectrum is computed with a uniform frequency resolution of \(\Delta f = f_s / N\):

$$\Delta t = \frac{N}{f_s}, \quad \Delta f = \frac{f_s}{N}$$

WindowΞ”f at 48 kHzΞ”tTypical use
128 – 512375 – 94 Hz1 – 11 msFast transients, HF detail
1024 – 204847 – 23 Hz21 – 43 msBalanced (default)
4096 – 819212 – 6 Hz85 – 170 msFine frequency detail, room modes (default 8192)

Unlike the CQT, the STFT resolution is the same at all frequencies β€” which can make low-frequency detail easier to read at the cost of poor high-frequency time resolution.


Colormap Range

ControlDescription
Min dB (drag-value)Lower saturation β€” anything at or below this level renders as cold blue
Max dB (drag-value)Upper saturation β€” anything at or above this level renders as hot red
Reset buttonRestores min to βˆ’60 dB and max to 0 dB

Narrowing the range highlights low-level detail (resonances, room modes, late decay). Widening it shows the full dynamic range at a glance.


Normalize (per-band)

The Normalize toggle scales each frequency band independently so that its peak amplitude equals 0 dB.

Without normalization, the colormap is referenced to the global maximum of the entire spectrogram β€” bands with inherently lower energy (e.g. very low or very high frequencies) may appear entirely blue even if they contain meaningful decay structure.

With normalization enabled:

  • Every frequency band fills the full colormap range from its own peak (0 dB) down to the configured minimum.
  • Decay tails, resonances, and room modes become visible across the entire frequency range regardless of the relative SPL of each band.
  • The colormap controls (Min dB / Max dB) still apply β€” they define the dynamic range displayed within each normalized band.

Note: Normalize is a purely visual operation. It does not affect the underlying computation or the impulse response data.


Axis Swap

The Freq Γ— Time / Time Γ— Freq button swaps the horizontal and vertical axes:

  • Time Γ— Freq (default) β€” time on X (ms), frequency on Y (Hz, log)
  • Freq Γ— Time β€” frequency on X (Hz, log), time on Y (ms)

Swapping the axes resets the zoom to fit the new layout.


Plot Interaction

ActionEffect
DragPan
Scroll / pinchZoom
Box zoom (right-click drag)Zoom to selection
Double-clickReset to full view

Interpreting the Spectrogram

The colour follows a rainbow-like gradient:

ColourRelative level
Red / yellowHigh (near 0 dB β€” main energy)
GreenMid-level
BlueLow (well below 0 dB)

What to look for:

  • Narrow bright and straight red band β€” clean, impulse-like response; energy decays quickly at all frequencies
  • Horizontal smearing at low frequencies β€” expected due to the longer wavelengths; the CQT’s time-smear is proportional to 1/f
  • Persistent bright regions after t = 0 β€” cabinet resonances, port resonances, or room reflections; the frequency and decay time are directly readable from the plot
  • Vertical stripes of colour in the axis-swapped view β€” resonant modes (a single frequency ringing for an extended time)

Pre-roll: The spectrogram always shows 200 ms before t = 0 (pre-padded with zeros). This prevents the CQT/STFT pre-ringing from being cropped and ensures the t = 0 onset is clearly visible.