A spectrogram is a representation of how the frequency content of an audio signal changes over time. It plots time on one axis and frequency on the other, with intensity shown as color or brightness. That turns a one-dimensional waveform into a two-dimensional image showing which frequencies are present at each instant and how strong they are.
How a spectrogram works
To build a spectrogram, you slice the audio into short, overlapping frames and apply a Fourier transform to each one, a procedure called the short-time Fourier transform, or STFT. Each frame reports the energy at each frequency, and stacking the frames in time order produces the full image.
The window length sets a hard tradeoff: a longer window resolves frequency finely but blurs timing, while a shorter window pins down timing but smears frequency. You cannot maximize both at once, so the window is tuned to the signal, and for speech it usually lands around 25 milliseconds with a 10 millisecond step.
A brief history of the spectrogram
The spectrogram descends from the sound spectrograph, an analog machine built at Bell Telephone Laboratories in the 1940s to render speech as a visible image. Ralph Potter, George Kopp, and Harriet Green published that wartime work in the 1947 book "Visible Speech," which set out the time-frequency plot still used today.
Why ASR uses spectrograms
Most speech models work from spectral features rather than the raw waveform, because the structure that separates one sound from another is hard to read directly from a pressure signal.
A spectrogram exposes that structure, the formants, harmonics, and energy patterns that distinguish a vowel from a fricative, in a form both neural networks and trained analysts can work with. It is the natural bridge between raw audio and feature extraction, and it is why so much of speech processing operates in the frequency domain rather than on samples.
Why the spectrogram matters
The spectrogram, and specifically its speech-tuned variant the mel-spectrogram, is the standard input representation for modern recognizers.
Because it is the model's actual input, the spectrogram's settings, window size, frequency range, and normalization, have to match between training and inference. A mismatch there quietly lowers accuracy, which is why the front-end feature is part of a model's contract rather than an afterthought.
Frequently asked questions
How do you read a spectrogram? Read time left to right and frequency bottom to top, with brighter or warmer regions showing more energy. Horizontal bands are steady tones, and the stacked bands in speech are the harmonics and formants of the voice.
What does a spectrogram show? It shows which frequencies are present in a sound at each moment and how strong each one is, so you can see pitch, formants, and noise change over the length of a recording.
How does a spectrogram work? It chops audio into short overlapping frames, runs a Fourier transform on each to measure energy per frequency, then lines those frames up in time to form the image.
What is a spectrogram used for? In speech work it is the input feature for recognition models and a diagnostic tool for inspecting recordings, letting you spot noise, clipping, and frequency loss that plain listening can miss.