Glossary
Mel spectrogram
A Mel spectrogram is a grid of sound energy over time, with frequency bands spaced to match human hearing. Many speech recognizers compute its logarithm, the log-Mel spectrogram, and feed it to a neural network instead of the raw waveform.
Updated October 17, 20263 cited facts, each traced to its source
Also called log-Mel spectrogram, filter bank features, MFCC.
A Mel spectrogram is a grid of sound energy. Each column is a short slice of time, each row is a band of frequencies, and the bands are spaced on the Mel scale, which spaces them more closely at low pitches, where human hearing is finer. Speech recognizers compute this grid from the waveform before any neural network sees the sound, and many of them take its logarithm, which gives a log-Mel spectrogram.
How a Mel spectrogram is computed
The steps are common across recognizers, even when the numbers change:
- Cut the audio into short, overlapping windows. Whisper uses windows of 25 milliseconds, moved forward every 10 milliseconds 1.
- Measure the energy at each frequency in each window, using a Fourier transform.
- Add up the energy in each Mel band with a filter bank, which is a matrix of weights, one band per row. The Mel scale makes the low bands narrow and the high bands wide.
- Take the logarithm of each band's energy. The log turns loudness into a scale closer to how people perceive it.
The Whisper code uses 80 Mel bands by default and accepts 80 or 128 2. Each band is one row, so one second of audio becomes a grid of 80 rows by 100 columns. The step between windows sets the number of columns: a 10-millisecond stride gives 100 frames for every second of audio 3.
Three names for related features
The terms overlap, and tools use them loosely:
| Feature | What it is | Where you see it |
|---|---|---|
| Mel spectrogram | Sound energy in Mel bands, before the logarithm | Analysis and visualization |
| Log-Mel spectrogram, or filter bank features | The logarithm of those band energies | The input to most neural recognizers, including Whisper |
| MFCC (mel-frequency cepstral coefficients) | A cosine transform of the log-Mel energies, keeping the leading coefficients | Older hidden Markov model systems and some classic pipelines |
The filter bank is the common step. MFCC adds one more transform that decorrelates the bands, which suited older statistical models. Neural networks handle correlated inputs well, so many modern systems skip that step and feed the log-Mel features directly.
Why it matters for dictation
The Mel spectrogram is where the recognizer's view of your voice begins, so its limits set the limits of everything after it:
- Noise shares the same bands. A fan, a keyboard or traffic puts energy into the same frequency bands as your voice. Once they are mixed in the grid, a model has to separate them, so a close microphone and a quiet room often matter more than the choice of model.
- The stride sets the pace. Frames arrive at the stride's rate, so a 10-millisecond stride sets how often new frames can reach a streaming recognizer, and therefore how quickly text can appear. See real-time speech recognition for how latency adds up.
- The features are invisible to you. You never see the grid. You see its result as words, which is why a bad microphone can look like a bad model.
Where it fits in a recognizer
In the classic pipeline, the features feed an acoustic model. In a neural end-to-end system, a network maps the same features to text directly. The guide on how speech recognition works walks through each stage.
Related terms
- Automatic speech recognition (ASR): the full task that these features feed.
- Acoustic model: the model that reads the features in classic systems.
- Voice activity detection (VAD): often uses the same frame energies to decide when speech starts and stops.
- LibriSpeech: the corpus whose audio is usually converted into these features for testing.
Guides that cover it
Evidence
Every number on this page, with where it comes from. Open a fact to see the exact words in its source.
- 1.
- 2.
- 3.With a 10-millisecond stride, Whisper's spectrogram has 100 frames for every second of audio.
Calculated from 1 other fact
Related terms
- Speech Recognition: What It Is and How Well It WorksThe topic this term belongs to
- Acoustic model
- Automatic speech recognition (ASR)
- Conformer
- Connectionist temporal classification (CTC)
- Hidden Markov model (HMM)
- Inverse text normalization (ITN)
- Language model (in speech recognition)
- LibriSpeech
- Real-time factor (RTF)
- RNN transducer (RNN-T)
- Speaker diarization
- Voice activity detection (VAD)