Sketch · 2026-10-26
Spectrogram, from your microphone.
Time runs left to right, frequency bottom to top, loudness is colour. Allow the microphone and whistle, then say a long "aaa" and an "eee" at the same pitch. The stack of harmonics stays put while the bright bands over it move. Audio stays in the browser tab. No microphone? The three test signals show the same things.
Pick a source to start. The microphone asks for permission first.
- sample rate
- -
- bin width
- -
- window length
- -
- loudest peak
- -
- pitch (autocorrelation)
- -
Test signals play through your speakers at low volume. The white dots mark the pitch estimate.
Note
Each column is one Fourier transform of the last N samples. The bins are spaced by the sample rate over N, so at 48 kHz an FFT of 512 points gives bins 94 Hz wide from a window of 10.7 ms. Raise N to 16384 and the bins narrow to 2.9 Hz, but the window now spans a third of a second. You cannot have both. The product of time and frequency spread has a lower bound, the same inequality that appears in quantum mechanics as Heisenberg's.
The "440 + 452 Hz" source makes this concrete. Set the axis to linear and the top to 500 Hz. At 512 and 1024 points both sines fall inside one bin, and the display shows a single band that pulses twelve times a second. The analyser applies a Blackman window, which spreads each pure tone over about six bins, so the two lines only pull apart at 16384 points, once the bins are under 3 Hz wide. By then the pulsing has smeared out. The ear does something similar and hears the pair as one tone with a beat.
Vowels are why speech looks the way it does. The vocal folds produce a buzz with harmonics at whole multiples of the pitch. The throat and mouth then act as filters that boost a few regions, called formants. Changing "aaa" to "eee" moves the formants without moving the harmonics. The pitch readout uses autocorrelation on the raw waveform instead of the spectrum, which is why it can name the fundamental even when a louder harmonic wins the peak readout.
Sources
- W3C. Web Audio API, section on the AnalyserNode: Blackman window, smoothing and FFT sizes from 32 to 32768. w3.org/TR/webaudio/
- Gabor, D. (1946). Theory of communication. Journal of the Institution of Electrical Engineers 93(26), pages 429-457.
- Peterson, G. E. and Barney, H. L. (1952). Control methods used in a study of the vowels. JASA 24(2), pages 175-184.