Nodes/ComfyUI-NoiseGen/πŸ“Š Spectrum Analyzer
ComfyUI Node

πŸ“Š Spectrum Analyzer

The Node That Finally Tells You What Your Noise Actually Sounds Like

By eg0pr0xyΒ·Created about a year agoΒ·Updated about a year agoΒ· 1
πŸ“Š Spectrum Analyzer
  • audio
  • audio
  • spectrum_report
  • peak_frequency
  • spectral_centroid
  • spectral_energy
β—„fft_size2048β–Ί
β—„overlap_factor0.75β–Ί
β—„window_typehannβ–Ί
β—„display_modemagnitudeβ–Ί
β—„frequency_scalelogβ–Ί
β—„frequency_range_low20β–Ί
β—„frequency_range_high20000β–Ί
β—„amplitude0.80β–Ί
β—„gate_threshold-60β–Ί
β—„spectral_gatefalseβ–Ί
β—„smoothing_factor0.10β–Ί
β—„peak_trackingtrueβ–Ί
β—„save_spectrumfalseβ–Ί

You're dialing in a noise wall and you have no idea what frequencies are actually coming out. That's the problem this node solves. SpectrumAnalyzer is the most-searched node in the NoiseGen pack, and for good reason - it's the one that shows you what's really happening instead of leaving you guessing.

What it does

It runs an FFT over your audio, frame by frame, and hands you back three things at once: the audio (optionally noise-gated), a text report of the spectrum, and raw numbers - peak frequency, spectral centroid, and spectral energy - you can feed into other nodes. Think of it as a scope for your audio chain. You drop it between, say, a HarshFilter and your AudioSave, and suddenly "why does this sound muddy" becomes answerable.

How it works

The mechanism is a windowed STFT, the same thing every spectrum analyzer does. Your audio gets chopped into overlapping frames of fft_size (512 to 8192 samples), each shaped by window_type (hann by default), and the overlap between frames is set by overlap_factor. The FFT of each frame becomes the spectrum, which you can view as magnitude, power, log, mel, or bark across a frequency_scale, cropped to your frequency_range_low/high. smoothing_factor averages consecutive frames so the numbers don't jitter, and peak_tracking keeps a lock on the loudest bin.

The interesting part is the spectral gate. Flip spectral_gate on and set gate_threshold (default βˆ’60 dB) and any bins below that level get silenced - so the audio output becomes a de-hissed, noise-gated version of your input. That turns this from a pure meter into a denoiser. Two nodes for the price of one.

The inputs and outputs that matter

You'll set three things: fft_size (2048 is a fine default for music-range material), display_mode, and spectral_gate if you want gating. Everything else has sensible defaults.

The outputs are where it gets useful:

  • audio - pass-through (or gated) audio, so the node can sit inline
  • spectrum_report - a STRING with the frequency breakdown; wire it into a text-display node
  • peak_frequency, spectral_centroid, spectral_energy - FLOATs you can show on screen or use as control signals

save_spectrum exists if you want the analysis written out, but for most workflows the live report is enough.

Install

The whole pack installs the same way:

cd ComfyUI/custom_nodes
git clone https://github.com/eg0pr0xy/comfyui_noisegen.git
cd comfyui_noisegen
pip install -r requirements.txt

On Windows with the embedded Python that's ComfyUI\python_embeded\python.exe -m pip install -r requirements.txt. ComfyUI Manager can also grab it - search "NoiseGen" or the author eg0pr0xy. No model files, no API keys, nothing to download beyond the code itself. Then restart ComfyUI.

Gotchas

Don't skip the pip install step - this pack imports scipy and soundfile at load time, and a stock ComfyUI doesn't ship those. Skip it and the whole pack fails to register, not just this node. And one thing the README glosses over: it references a ./web directory for visualization that doesn't exist in the repo, so don't expect a fancy in-graph plot - the real-time picture is the report string and the FLOAT outputs, not a rendered spectrogram. That's a mild disappointment, but the numbers are honest.

The pack is small and largely untalked-about on the usual channels, which means you're mostly on your own - but this node is simple enough that you won't need a support group.

Category🎡 NoiseGen/Utility

Inputs (14)

NameTypeDefaultDescription
audioAUDIOInput audio for spectrum analysis
fft_sizeCOMBO20485 options: 512, 1024, 2048, 4096, 8192
overlap_factorFLOAT0.750–0.95β€”
window_typeCOMBOhann5 options: hann, hamming, blackman, kaiser, rectangular
display_modeCOMBOmagnitude5 options: magnitude, power, log, mel, bark
frequency_scaleCOMBOlog4 options: linear, log, mel, bark
frequency_range_lowFLOAT201–1000β€”
frequency_range_highFLOAT200001000–48000β€”
amplitudeFLOAT0.800–2β€”
gate_thresholdoptFLOAT-60-120–0β€”
spectral_gateoptBOOLEANfalseβ€”
smoothing_factoroptFLOAT0.100–0.9β€”
peak_trackingoptBOOLEANtrueβ€”
save_spectrumoptBOOLEANfalseβ€”

Outputs (5)

NameTypeDescription
audioAUDIOβ€”
spectrum_reportSTRINGβ€”
peak_frequencyFLOATβ€”
spectral_centroidFLOATβ€”
spectral_energyFLOATβ€”