How big a spectrogram is: frames and bins for standard settings, computed two ways
Our own computation, 7 November 2026, for the article "Spectrograms reveal sound patterns for audio models". Every count below is computed two ways: by the formula frames = 1 + floor((clip - frame) / hop), and by stepping a 25 ms frame through the clip in 10 ms hops and counting; the two agree in every row.
Inputs (standard speech settings, stated)
- Frame length 25 ms, hop 10 ms (the common speech setting; the article's source for it is the short-time Fourier transform entry).
- Sample rates 16,000 Hz (speech) and 44,100 Hz (CD audio). The FFT length is the frame in samples: 400 at 16 kHz, 1,102.5 taken as 1,102 at 44.1 kHz (in practice 1,024 or 2,048 is used; the bin count then is 513 or 1,025).
- Frequency bins = FFT length / 2 + 1, up to half the sample rate (8,000 Hz at 16 kHz; 22,050 Hz at 44.1 kHz).
What we found
- A 5-second clip at 16,000 Hz with 25 ms frames and 10 ms hops gives 498 frames and 201 frequency bins, a grid of 100,098 cells; 1 + floor((5 - 0.025) / 0.010) = 1 + 497 = 498, and stepping the frame through the clip counts 498 as well.
- A 1-second clip at the same settings gives 98 frames; 10 seconds 998; 30 seconds 2,998: about 100 frames per second of audio, one fewer than 100 per second because the first frame needs 25 ms before it is full.
- At 44,100 Hz the frame holds 1,102 samples, so a 25 ms frame has 552 bins up to 22,050 Hz, and the same 5-second clip becomes a 552 by 498 grid of 274,896 cells.
- Time resolution is the hop, 10 ms; frequency resolution is the sample rate divided by the FFT length, 40 Hz at 16 kHz with a 400-sample frame, which is why a 25 ms frame cannot separate two tones 20 Hz apart.
- The grid holds magnitudes only: phase is dropped, so the audio cannot be rebuilt exactly from the picture.
Check it yourself
| Sample rate | Clip | Frames | FFT length (samples) | Bins | Cells |
|---|---|---|---|---|---|
| 16,000 Hz | 1 s | 98 | 400 | 201 | 19,698 |
| 16,000 Hz | 5 s | 498 | 400 | 201 | 100,098 |
| 16,000 Hz | 10 s | 998 | 400 | 201 | 200,598 |
| 16,000 Hz | 30 s | 2,998 | 400 | 201 | 602,598 |
| 44,100 Hz | 1 s | 98 | 1102 | 552 | 54,096 |
| 44,100 Hz | 5 s | 498 | 1102 | 552 | 274,896 |
| 44,100 Hz | 10 s | 998 | 1102 | 552 | 550,896 |
| 44,100 Hz | 30 s | 2,998 | 1102 | 552 | 1,654,896 |
Second way for the 5 s row: start at 0 ms, the last frame starts at 4,970 ms (4,970 + 25 = 4,995 <= 5,000; 4,980 + 25 = 5,005 > 5,000), and 0 to 4,970 in steps of 10 is 498 starts. Same.
What this cannot tell you: which settings a given model used (AST and MAST read mel spectrograms, a frequency axis spaced by pitch, so their grids differ from these); whether a model works better on this grid than on the raw waveform, which the sources do not compare.