# How can I start learning about pitch detection?

I'm working on a project where my goal is to implement a pitch-detection algorithm (PDA) in a piece of open-source software.

I have very little knowledge of pitch detection at the moment and started my research into it by reading through part of a paper on PDAs.

I wrote a similar post to this one on Music: Practice & Theory Stack Exchange (SE) and the advice I got was to start learning about digital signal processing.

My current plan is to study a set of lecture notes I have on digital signal processing.

I was also directed from Music SE to this SE site. Would any of you suggest a different or potentially better approach to learning about digital signal processing and PDAs (keeping in mind my ultimate aim of implementing my own PDA - I don't want to simply copy or plug in a library of someone else's, but study the pros and cons of other PDAs and then implement my own, with some element of novelty)?

• How about this Coursera course? Pitch detection is part of their syllabus: coursera.org/learn/audio-signal-processing#syllabus Another good resource I've found is here: musicinformationretrieval.com Jul 28, 2017 at 19:24
• What is the goal of your PDA software? Piano tuners may have differing requirements compared to a real-time autotune box. Jul 28, 2017 at 22:39
• @AtulIngle This looks useful.I'll check it out. Jul 29, 2017 at 9:46
• @hotpaw2 The goal of the PDA would be to, in real time, identify the pitch of the user's voice as he/she sings a monophonic melody line. Does that help/clarify? Jul 29, 2017 at 9:48

i have to disagree with

Calculation of the AMDF is less computationally expensive than the ACF due to the lack of multiplication operations (Niesler and Robinson ).

i don't think the cost of a multiplication is considered particularly more expensive than an absolute value. (you might have a multiplier hanging around in your FPGA anyway.)

but this:

is new to me. so they are looking for the value of $\tau$ that maximizes $f(\tau)$.

it looks interesting, but i don't see how it does better regarding the octave problem. you could have a tone at A-440 that sounds like A-440 and then add to that a teeny-weeny (like -40 dB) amount of subharmonic at A-220. the maximum $f(\tau)$ is might happen at $\tau = \frac{f_\mathrm{s}}{220 \text{Hz}}$ when you want it to happen at $\tau = \frac{f_\mathrm{s}}{440 \text{Hz}}$.

but i wonder what dividing by one plus the AMDF does to help. it's something i hadn't thought about before. i have to think about it a little.

• I appreciate the response, but am not sure how it serves to answer the original post. Could you elaborate, please? Jul 29, 2017 at 9:51
• well, everything hot says is true, that pitch is ultimately a psychoacoustic measure. but, for the most part, instruments that sound like they have a pitch will show a modicum of periodicity. the reciprocal of the apparent period is the fundamental frequency. and the base-2 logarithm of the fundamental frequency is normally the perceived pitch in octaves, relative to some reference pitch. but there are human perceptual issues and adding a very tiny amount of subharmonic will not change the perceived pitch, but will often change the mathematical fundamental frequency. Jul 30, 2017 at 11:11
• i am still unsure how this combination of autocorrelation and AMDF helps. i see how $f(\tau)$ will peak at plausible candidates for the period, because the numerator should show a maximum and the denominator should show a minimum. but whatever the "similarity measure" is, you will still need to choose between different candidates for the period, and sometimes the period for an octave lower will look better than the period you want, that corresponds to how the pitch will sound. somewhere in these SE pages is a post of mine dealing a bit with the so-called "octave problem". look for it. Jul 30, 2017 at 11:17
• The elaboration helps. Aug 11, 2017 at 16:32

Pitch perception is a human psychoacoustic phenomena. Thus pitch detection/estimation is not the same as spectral frequency estimation.

To get started with learning about pitch estimation, you might want to take an multi-disciplinary approach: try books on the physics of musical instruments (the many ways pitched sounds can be generated), books on human speech, hearing, audiology and the psychology of music on (how some sounds might be perceived as pitched or not, or somewhere in-between), as well the many resources for learning audio digital signal processing methods (FFT/STFTs, windows, various lag similarity measures, cepstrums/cepstral analysis, and etc.) Technical resources for professional piano tuners might also be of interest.

The MIREX web site has tons of academic papers on pitch detection and estimation.

• I'll look at the suggested resources. This is useful. Jul 29, 2017 at 9:50
• Apart from the papers on the MIREX web site, are there any other resources you'd recommend for learning some of the audio digital signal processing methods you mentioned in your post? Aug 14, 2017 at 8:41