Course contentsShow
← Machine Learning and Deep Learning
Lesson 2439 of 3,53853. Speech and Audio ProcessingFree lesson

Mel Scale and Mel-Spectrograms

The perceptually-motivated mel frequency scale and transforming spectrograms to mel-spectrograms.

Mel Scale and Mel-Spectrograms

What you'll learn: How to transform spectrograms into perceptually-meaningful mel-spectrograms that better match how humans actually hear sound.

Why the Mel Scale Matters

You've learned how spectrograms visualize audio frequencies over time. But there's a problem: humans don't perceive frequency linearly. We're much better at distinguishing between 100 Hz and 200 Hz than between 5000 Hz and 5100 Hz—even though both are 100 Hz apart.

The mel scale is a perceptually-motivated transformation that maps physical frequencies to how humans actually experience pitch. Below about 1000 Hz, the mel scale is roughly linear. Above 1000 Hz, it becomes logarithmic, compressing higher frequencies because we perceive them less distinctly.

From Spectrogram to Mel-Spectrogram

A mel-spectrogram transforms a regular spectrogram using mel-frequency bins instead of linear frequency bins:

  1. Start with your STFT spectrogram (frequency × time)
  2. Apply a bank of triangular mel filters that group frequencies according to human perception
  3. Each filter captures energy in a perceptual frequency band
  4. Result: fewer frequency bins focused where human hearing is most sensitive

Think of it like this: if a spectrogram is a photo with even lighting everywhere, a mel-spectrogram is one with spotlight focus on the details your eyes (or ears) care about most.

This representation is crucial for speech recognition, music classification, and any audio task where matching human perception improves performance. Most deep learning audio models use mel-spectrograms as input rather than raw spectrograms.

Key Takeaway: Mel-spectrograms compress frequency information according to human perception, making them more effective inputs for speech and audio deep learning models than linear-frequency spectrograms.