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
Reading how the frequency content of a sound changes over time rather than in a single frame
Debugging a synth, a Faust patch or an audio file with a scrolling waterfall view instead of a live bar graph
Spreading the low end out for readability, with the frequency axis on Log
Raw dB numbers for further analysis rather than a 0–1 display range, with Normalize off
| Parameter | Type | Default |
|---|---|---|
spectrum | OneOf([NumberArray, Signal]) | — |
history_frames | Number | 128 |
scale | String | "Linear" |
db_floor | Number | -60 |
normalize | Boolean | true |
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
Add a Spectrogram and wire an Audio Input's spectrum output (or an Audio File's waveform) into
spectrum.Raise
history_framesfor a longer scrolling history, or lower it for a shorter, more responsive window.Switch
scaleto Log if the low end is cramped together.Wire
datainto an image node to draw the resulting matrix, usingwidthandheightas its dimensions.
See also
Audio Analysis · Audio Mixer · Pitch Detect · Numbers, signals & audio