# Understanding Pitch Detection with Autocorrelation Methods

I've been reading through A Smarter Way to Find Pitch, describing its pitch detection algorithm using autocorrelation.

I've been having trouble understanding the accuracy claims. It says:

MPM runs in real time with a standard 44.1 kHz sampling rate. It operates without using low-pass filtering so it can work on sound with high harmonic frequencies such as a violin and it can display pitch changes of one cent reliably.

I cannot fathom how detecting changes of one cent is possible. Considering a note played at 441Hz, sampled at 44.1kHz, one would measure a first peak at tao=100 samples (delay space).

The next closest note which could be measured, by my understanding, would have a peak at the 101st sample. This would be a frequency of 437Hz, or about 16 cents lower than the first note. What am I missing here?

## 2 Answers

For higher resolution periodicity estimation, given properly band-limited data, the data can be upsampled (interpolated) before autocorrelation, and/or, the autocorrelation results can be interpolated (Sinc kernel or some order of polynomial).

This, of course, assumes the signal has a high enough S/N, and that the periodicity itself is unmodulated in timbre(harmonic content), phase, frequency, or amplitude, which isn’t always true of real-world pitched sounds. Thus a larger number of periods may be needed for a some desired statistical error bound on the pitch estimation.

• That makes sense, thanks. I'm still unclear on whether or not this is what the researchers intended, however. They explicitly describe calculating the pitch, making no mention of those methods: The pitch period is equal to the delay, τ, at the chosen key maximum. The corresponding frequency is obtained by dividing the sample rate by the pitch period (in samples). In which case I am still confused as to where the aforementioned accuracy would come from. – Joel Tecson Aug 3 at 6:33

to add to hot's answer, when using autocorrelation or an equivalent method like AMDF or ASDF, although the autocorrelation $$R_x[k]$$ is evaluated only at integer values of lag $$k$$, which means the peak value and initial period length will be an integer number of samples, you can use quadratic interpolation using the point at the peak and the two neighboring values, to get the location of the "true" peak. That will give you a precision (not the same as "accuracy") of better than an integer number of samples lag.

take a look at those two other linked answers to get a sorta formal mathematical expression of the problem and how i approached solving it.