ComfyUI Node

Plot MelFilterBank

See the mel filters before you trust a mel spectrogram

By kale4eat·Created 2 years ago·Updated about a year ago· 23
Plot MelFilterBank
    • graph_image
    n_fft256
    n_mels64
    sample_rate32000
    titleFilter bank

    Most of this pack's visualize nodes plot a piece of audio you fed in. This one doesn't take audio at all - it draws the shape of the mel filterbank itself, the bank of triangular filters that SDT_MelSpectrogram uses to warp a linear-frequency spectrum into the mel scale. It's a parameters-only diagnostic: pick your n_fft, n_mels, sample_rate, and this shows you exactly what those triangles look like before you commit to them on a real spectrogram computation.

    How it works

    A mel filterbank is a set of overlapping triangular weighting curves spread across the frequency axis, spaced more tightly at low frequencies and more loosely at high ones - the whole point of the mel scale is that spacing mimics how human hearing perceives pitch. This node generates that filterbank from your three numeric parameters and renders it directly as an image, with no waveform involved anywhere in the computation.

    The inputs and outputs that matter

    • n_fft (default 256) and n_mels (default 64) - the same two knobs SDT_MelSpectrogram exposes, but note the defaults here don't match: that node defaults to n_fft=400, n_mels=128. If you're using this node to sanity-check what your real mel spectrogram settings will look like, you have to set these three fields to match your actual SDT_MelSpectrogram node by hand - there's no link between them, just two separate sets of number fields.
    • sample_rate (default 32000) - also worth double-checking against reality. Most speech pipelines in this pack run at 16kHz (see SDT_MakeSilenceAudio's default); if your real audio is 16kHz but you leave this at 32000, the filter shapes you're looking at won't reflect the frequency range your actual clips cover.
    • title (default "Filter bank") - cosmetic label only.
    • graph_image (output, IMAGE) - the rendered filterbank plot.

    How to install it

    Via ComfyUI Manager: search ComfyUI-speech-dataset-toolkit, install, restart. Manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/kale4eat/ComfyUI-speech-dataset-toolkit
    cd ComfyUI-speech-dataset-toolkit
    pip install torchaudio --index-url https://download.pytorch.org/whl/cu121
    pip install -r requirements.txt
    

    No extra dependencies beyond the pack baseline - this is pure signal-processing math and plotting, nothing to download.

    Common issues & troubleshooting

    Plot doesn't match what you expect from your real mel spectrogram. Check all three numeric fields against whatever you've actually set on SDT_MelSpectrogram - this node has no automatic link to it, and the default values genuinely differ (256/64 here vs. 400/128 there).

    Set sample_rate and aren't sure what to use. Match it to your real audio's sample rate - check with SDT_AudioProperty if you're not sure what your clips are actually running at. Getting this wrong doesn't error, it just shows you filter shapes for the wrong frequency range.

    Filters look degenerate - mostly empty or oddly narrow. Usually n_mels set too high relative to n_fft (too many filter bins crammed into too few frequency bins to work with) or sample_rate set far outside your real audio's range. Bring the numbers back toward the sane defaults and adjust one at a time.

    Categoryspeech-dataset-toolkit/visualize

    Inputs (4)

    NameTypeDefaultDescription
    n_fftINT2560–4294967296
    n_melsINT640–4294967296
    sample_rateINT320000–4294967296
    titleSTRINGFilter bank

    Outputs (1)

    NameTypeDescription
    graph_imageIMAGE