Spectrogram

Visualise audio frequency content as a scrolling spectrogram.

What it does

Spectrogram turns a stream of audio frequency data into a time × frequency matrix: a scrolling history of which frequencies were present, and when. Each frame it receives is converted to decibels, optionally re-binned onto a log frequency axis, and pushed into a rolling history buffer. Input is Audio Input's spectrum, or a raw waveform Signal, which is analysed into a spectrum automatically.

The output is flat numeric data. Wire it into an image or plotting node to draw it. The rolling history is kept on the node, so frames persist across cooks even though each cook sees only the current one.

When to use it

ParameterTypeDefault
spectrumOneOf([NumberArray, Signal])
history_framesNumber128
scaleString"Linear"
db_floorNumber-60
normalizeBooleantrue

Gotchas

Lowering db_floor (more negative) widens the dynamic range shown: quiet detail becomes visible and the display gets noisier. Raise it toward 0 to show only the loudest content.

Normalize is on by default, mapping the dB range to 0–1 for display. Turned off, the output is raw dB values, roughly db_floor to 0. Useful for further maths on the levels, and wrong fed straight into something expecting a normalised 0–1 signal.

width is the runtime length of the incoming spectrum, not a value set directly. It changes when an Audio Input with a different bin count is swapped in, or when a Signal is fed in instead of a precomputed spectrum. height always matches history_frames.

Worked example

  1. Add a Spectrogram and wire an Audio Input's spectrum output (or an Audio File's waveform) into spectrum.

  2. Raise history_frames for a longer scrolling history, or lower it for a shorter, more responsive window.

  3. Switch scale to Log if the low end is cramped together.

  4. Wire data into an image node to draw the resulting matrix, using width and height as its dimensions.

See also

Audio Analysis · Audio Mixer · Pitch Detect · Numbers, signals & audio