← All nodes
Audio Analysis

Log-Mel Spectrogram

Turns each clip into a log-mel spectrogram — frequency bands over time, in dB — saved as a NumPy matrix (.npy) and as an image (.png) for image models such as CNNs.

When to use it

Feed spectrograms to your own image classifier, inspect recordings visually, or build a training set for a sound model.

In a pipeline

Settings

SettingTypeRequiredDefault or hint
Mel bandsnumber—64
Window (ms)number—25
Hop (ms)number—10
Lowest frequency (Hz)number—0
Highest frequency (Hz, 0 = half the sample rate)number—0
Dynamic range (dB)number—80
Save the matrix (.npy, bands × frames)checkbox—true
Save an image (.png)checkbox—true
Image coloursselect—magma

Example

64 bands, 25 ms windows every 10 ms

  • Mel bands=64
  • Window (ms)=25
  • Hop (ms)=10
Paths to the saved files
File NameMel BandsFramesImage Path
engine.wav64501…/engine_logmel.png

Worth knowing

  • The .npy holds bands × frames as 32-bit floats: numpy.load(path) reads it back as is.
  • In the image, low frequencies are at the bottom and loud is bright.
  • Dynamic range floors everything more than that far below the loudest point, as librosa's top_db does.

Others in Audio Analysis