AUD · Audio tools

Pitch Detector

Median pitch
Pitch tracknote / time

Shareable link

Settings are written to the URL as you change them. Nothing differs from the defaults yet.

Pitch is periodicity. The detector looks for the shift at which the waveform best matches a delayed copy of itself, and the length of that shift is the period.

YIN, not plain autocorrelation

Raw autocorrelation is always largest at zero lag, so a naive search reports whatever the smallest allowed shift is. YIN uses a difference function instead, then divides each value by the running mean of everything before it. That normalisation is what stops the reading from collapsing to the top of the range, and it is why octave errors are the exception here rather than the rule.

The chosen minimum is refined by fitting a parabola through its neighbours, which gets the frequency well inside a cent even though the shift itself is a whole sample.

The pitch track

The plot puts time on the horizontal axis and pitch on a semitone grid, so a drift of one tone looks the same anywhere on the range. Octave lines are labelled.

A steady note draws a flat line. Vibrato draws a ripple. A slide draws a ramp. A gap means nothing periodic was found.

Median rather than mean

The headline figure is the median of the voiced readings. A mean would be dragged by the octave errors and the transitions between notes; a median ignores both.

For a single sustained note the two agree. For a melody the median tells you the centre of the range, which is not the same as the note the piece is in.

Cost on a long file

The signal is decimated to roughly 12 kHz before analysis, since pitch lives far below that and the difference function is quadratic in the window length. Readings are then spaced by the file’s own duration, so a three minute take and a three hour one produce about the same number of points.

Chords report a note nobody played

Feed it a C major triad and it reports 65 Hz. That is not a bug and it is not the loudest note: 261.63, 329.63 and 392 Hz all divide into roughly 65.4 Hz, so the summed waveform genuinely repeats at C2. Periodicity is what the method measures, and a chord is periodic at the pitch its notes have in common.

This is the same effect that lets a small speaker suggest a bass note it cannot reproduce. It is also why the tool is only useful one voice at a time.

Where else it fails

Heavily distorted guitar has a fundamental that is often quieter than its harmonics. Whispered speech has no fundamental at all. Anything below 55 Hz or above 1500 Hz is outside the search range and reads as the nearest thing inside it.

Frequently Asked Questions

The fundamental frequency between 55 Hz and 1500 Hz, sampled across the whole file, plus the median pitch as a note name and its offset in cents. It reads WAV, MP3, M4A, AAC, Ogg, Opus, FLAC, AIFF, and WebM audio.

It will produce numbers, but they describe the repeat rate of the combined waveform rather than any note in it. A C major triad of C4, E4 and G4 reports 65 Hz, which is C2: the pitch those three frequencies all divide into, and a note nobody played. Use it on one instrument or one voice at a time.

How far the median sits from the nearest equal-tempered note. 100 cents is a semitone. Beyond about 20 cents the difference is audible against another instrument, and beyond 50 cents the nearest note has changed.

Those windows had no periodic content, so no pitch is reported rather than a guess. Breaths, consonants, rests, and percussion all read as unvoiced.

A waveform that repeats every period also repeats every two periods, so octave errors are the classic failure of every autocorrelation method. The cumulative mean normalisation used here suppresses most of them, but a signal with a weak fundamental and strong second harmonic can still read high.

Explore Our Tools

Browse all tools