Data Lab node
Spectrum
The spectrum of any Signal — a mouse, an EEG channel, a Timeline, an audio band’s rhythm. FFT of the last Size samples (0 = the largest power of two the window holds) with a Hann / Hamming / Blackman / flat-top window; Magnitude in the input’s unit, Power, dB, or a Welch PSD in unit²/Hz. Out: a spectrum Signal that Plot draws against Hz, the bins as an array, the peak, the spectral centroid and Band Levels for ranges like “0-4, 4-8, 8-13”.
Inputs
| Port | Type | Default |
|---|---|---|
| SignalThe Data Lab signal to analyse — a Signal node's output, a Window, or any float array with its sample rate. Multi-channel signals are handled per channel. | structure | — |
| SizeFFT length in samples (rounded down to a power of two, ≤ 16 384); 0 = the largest the window holds. Longer = finer frequency resolution, slower to react. | int | 0 |
| WindowWindow function: Hann for general use, Hamming, Blackman for low leakage, flat top for exact amplitudes, rectangular for none. | int | 0 |
| OutputMagnitude in the input’s unit, Power (unit²), dB, or a Welch PSD (unit²/Hz) averaged over overlapping segments of the whole window. | int | 0 |
| Channel−1 = every channel becomes a channel of the spectrum; otherwise one channel. | int | -1 |
| BandsFrequency ranges in Hz for Band Levels, e.g. “0-4, 4-8, 8-13, 13-30” — the mean level in each. | string | |
| Min FrequencyDrop the bins below this frequency (Hz); the spectrum Signal then starts here and Plot’s axis follows. | float | 0 |
| Max FrequencyDrop the bins above this frequency (Hz); 0 = up to half the sample rate. | float | 0 |
| Update RateHow many times per second the analysis is recomputed (default 10); 0 = every frame. Lower rates save CPU on long windows — a moved parameter always recomputes at once. | float | 20 |
Outputs
| Port | Type |
|---|---|
| Spectrum | structure |
| Bins | float |
| Peak Frequency | float |
| Peak Amplitude | float |
| Centroid | float |
| Band Levels | float |
| Resolution | float |
How It Works
Spectrum is the FFT of anything — a mouse, a Timeline curve, an EEG channel, an audio ring, the rhythm of an audio band. It transforms the last Size samples (0 means the largest power of two the window holds) through a Hann, Hamming, Blackman or flat-top window.
Output chooses the currency: Magnitude in the input's own unit, Power, dB, or a Welch PSD in unit²/Hz — which is the one to use when you need a spectral density rather than a picture.
The result is a spectrum Signal that Plot draws against Hz with correct tick labels, plus the Bins as an array, the Peak Frequency and Peak Amplitude, the Centroid (the spectral centre of mass — brightness), and Band Levels for ranges you simply type: 0-4, 4-8, 8-13. Min/Max Frequency crop the range.
This node replaces the old FFT node, which never processed anything.
Use Cases
- EEG bands — Type
0-4, 4-8, 8-13, 13-30into Bands and get delta, theta, alpha and beta as four numbers. - Audio brightness — Centroid is a single number that tracks timbre and works well as a control.
- Find a periodicity — Peak Frequency of a slow signal answers "how often does this repeat".
- Spectral visuals — The spectrum Signal into Plot, Plot 3D's Surface, or a Points consumer.
- Audio-reactive parameters — Band Levels are the cleanest way to drive several parameters from one sound.
Tips
- Frequency resolution is the window length, not the FFT size: to resolve 0.5 Hz you need two seconds of data.
- Flat-top is the window to use when you care about amplitude accuracy; Hann is the everyday default.
- Detrend the signal first if it has a DC offset or a slow drift, or the low bins will swamp everything.
- Welch PSD is the right output for anything you intend to compare or publish; Magnitude is for looking.
- Cap Update Rate — a big FFT at 120 Hz is wasted work when the plot only needs 20.
Open Spectrum in the interactive catalog →
Spectrum is one of 381 nodes in Grafit Pro.
Free download. Every feature for 7 days, no card. Then €99.99 once — or keep playing your projects as a Player.