Vision & Audio Intermediate

Spectrogram

A picture drawn so you can see sound with your eyes

Key points
  • A spectrogram is a picture that spreads sound out so you can see it. Left to right is time, top to bottom is pitch, and how dark a spot is means loudness.
  • For every short slice of sound, it measures how much of each pitch is present at that instant, stacks that as one vertical strip, and lines the strips up in time order.
  • Transcription, pitch detection, source separation, and sound generation all happen on top of this picture.
  • Cut the slices shorter and time gets sharper while pitch gets blurry. You can't have both sharp at once.
  • The picture is missing some information, so you can't turn it straight back into the original sound from the picture alone.
Contents

1The analogy

An old library card catalog keeps one card per item. Each card has the item's traits written out field by field, and filed in order, the whole drawer shows a pattern at a glance when you open it. Any single card looks unremarkable, but lined up in a row they become something you can read.

A spectrogram is a card catalog like that, built for sound. Sound gets cut into very short slices, and one card gets written for every slice. Each card lists boxes from the lowest pitch to the highest, marked for how dark each box is at that instant. File these cards in time order, packed tight, and look at the row from the side — that's the sound picture.

2In detail

The waveform alone is hard to read

Open a recording and the wavy shape you see plots how hard the air was shaking, moment by moment. Whether the sound is loud or soft, and when it starts and stops, shows up right there.

But the thing you actually want to know is hidden. Whether it's a low hum or a high screech, a human voice or a door closing, is buried in how tightly packed the wiggles are. Layer several sounds together and the wiggles merge into one line, making it even harder to tell apart.

That's why most work with sound doesn't look at the raw waveform at all — it converts to a picture split out by pitch first.

One card per short slice

Measure the pitch content of a whole sound at once and you only learn which notes were present across the entire piece — when they happened is gone. So it's measured in very short slices instead. One slice runs about a few dozen milliseconds — short enough that the sound barely changes within it.

Measuring the strength of every band from low to high within one slice gives a single vertical strip. Slide the slice a little to the side and repeat, and stitching the resulting strips together in time order completes the picture. The slices overlap as they slide, so the seams don't come out choppy.

The scale of the pitch bands is usually tuned to match human hearing. People notice small differences well at the low end and poorly at the high end, so the bands are split fine at the bottom and coarse at the top.

How to read the picture

Left to right is time, top to bottom is pitch, and darkness is loudness. A voice shows up in this picture as horizontal stripes running side by side. The lowest stripe is the base pitch the vocal cords vibrate at, and evenly spaced stripes stack up above it. Raise the note being sung, and this whole band of stripes shifts upward.

Consonant sounds like final stops or a hissing "s" show up not as stripes but as a blurred smear spread across the upper range. A clap or a door closing spreads short and wide like a vertical line. A quiet stretch is just blank space. Even the same word said by different people produces different stripe spacing and smear shapes, which is why this pattern acts like a voiceprint.

Picking a sharpness trades something away

Cut slices shorter and it becomes clearer exactly when something happened. But there's less wave packed into each slice, so the pitch bands blur together. Cut them longer and pitch splits out cleanly, but the moment a sound changed gets smeared over.

You can't make both sharp at the same time. You have to pick based on what you're trying to see. Transcribing speech uses short slices, since speech changes fast; studying musical chords uses somewhat longer ones.

This is where the work happens

Once sound is converted to a spectrogram, a sound problem becomes a picture problem. There's already a huge stock of methods for recognizing patterns in pictures, and those can be brought over as-is.

Transcription reads the pattern each sound makes in this picture and turns it into letters. Pitch detection means pinpointing one reference stripe among the bands. Source separation means splitting the overlapping patterns apart by instrument. Sound generation runs the other way — it draws this picture first, then converts it into a waveform.

3More precisely

The method is to cut the signal into short windows and compute the frequency content of each window, a process called the short-time Fourier transform. A smoothing window is applied at each cut to soften the edges and cut down on noise from the seams. The loudness is usually shown on a compressed log scale rather than raw, since the gap between loud and quiet sounds is so large that quiet sounds would vanish entirely if drawn as-is. Re-splitting the pitch bands to match how human hearing perceives them produces what's called a mel spectrogram, and speech work uses this version far more often, since it packs detail where the ear actually needs it.

The analogy breaks down in one place. A library card is filled out by a person who decides what matters; a spectrogram fills in every single box by fixed calculation, no picking and choosing. But one thing never makes it onto the card — exactly where each frequency's wave starts is thrown away. So recovering the original waveform from this picture alone means guessing at what was lost, and that job falls to a vocoder.

4Try it yourself

5Common misconceptions

  • It's easy to think a spectrogram holds the sound itself, but actually it's a summary with some information discarded, so sound recovered from it differs subtly from the original.

  • It's easy to think it's the same as the wavy line in a recording program, but actually it's a picture with a pitch axis added that the waveform never had.

  • It's easy to think a finer-grained picture is always better, but actually sharpening time blurs pitch, so the choice has to match what you're trying to see.

7One-line summary

In shortA spectrogram is a sound picture built by filing one card per short slice in time order, and most work with sound happens on top of this picture.

Spotted an error or have a better analogy? Suggest an edit · Last updated2026-09-02