DSPRelated.com
Forums

Pitch detection - for a newbi

Started by EagerToLearn January 5, 2007
I am interested in learning about Pitch Detection.  I am a c/c++
programmer (20+ yrs) and am interested in pitch recognition for the
purpose of developing an  ear training program for my grandsons, ie, a
program to help someone develop the ability to play by ear, simple
melodies.

My math skills include the standard 3 calculus for engineers courses
(however I'm not sure how much I remember, 20 yrs ago - never used it
so probably very little.)  No engineering degree and no DSP courses or
experience. BA Psychology. Self-taught programmer.

I have ordered the Lyons book and have downloaded the Stevens book.
Can anybody provide me a roadmap on the concepts/topics I need to
learn about in order to dlo pitch recognition.

Based on my background/experience is my goal a pipe dream ??

Thanks

EagerToLearn wrote:

> I am interested in learning about Pitch Detection. I am a c/c++ > programmer (20+ yrs) and am interested in pitch recognition for the > purpose of developing an ear training program for my grandsons, ie, a > program to help someone develop the ability to play by ear, simple > melodies. >
The Pitch Detection is a vast area. It is simple enough to get something working, but it is difficult to make it work perfect. Before running into the complexities, take a look at the classic book on the speech processing by Rabiner and Shafer. There is a chapter on the pitch detection. Although the methods described there are kind of old fashioned and definitely not the best, it will give you the understanding of how does this stuff work. Vladimir Vassilevsky DSP and Mixed Signal Design Consultant http://www.abvolt.com

EagerToLearn wrote:

> I am interested in learning about Pitch Detection. I am a c/c++ > programmer (20+ yrs) and am interested in pitch recognition for the > purpose of developing an ear training program for my grandsons, ie, a > program to help someone develop the ability to play by ear, simple > melodies. >
The Pitch Detection is a vast area. It is simple enough to get something working, but it is difficult to make it work perfect. Before running into the complexities, take a look at the classic book on the speech processing by Rabiner and Shafer. There is a chapter on the pitch detection. Although the methods described there are kind of old fashioned and definitely not the best, it will give you the understanding of how does this stuff work. Vladimir Vassilevsky DSP and Mixed Signal Design Consultant http://www.abvolt.com

EagerToLearn wrote:

> I am interested in learning about Pitch Detection. I am a c/c++ > programmer (20+ yrs) and am interested in pitch recognition for the > purpose of developing an ear training program for my grandsons, ie, a > program to help someone develop the ability to play by ear, simple > melodies. >
The Pitch Detection is a vast area. It is simple enough to get something working, but it is difficult to make it work perfect. Before running into the complexities, take a look at the classic book on the speech processing by Rabiner and Shafer. There is a chapter on the pitch detection. Although the methods described there are kind of old fashioned and definitely not the best, it will give you the understanding of how does this stuff work. Vladimir Vassilevsky DSP and Mixed Signal Design Consultant http://www.abvolt.com

EagerToLearn wrote:

> I am interested in learning about Pitch Detection. I am a c/c++ > programmer (20+ yrs) and am interested in pitch recognition for the > purpose of developing an ear training program for my grandsons, ie, a > program to help someone develop the ability to play by ear, simple > melodies. >
The Pitch Detection is a vast area. It is simple enough to get something working, but it is difficult to make it work perfect. Before running into the complexities, take a look at the classic book on the speech processing by Rabiner and Shafer. There is a chapter on the pitch detection. Although the methods described there are kind of old fashioned and definitely not the best, it will give you the understanding of how does this stuff work. Vladimir Vassilevsky DSP and Mixed Signal Design Consultant http://www.abvolt.com
EagerToLearn wrote:
> I am interested in learning about Pitch Detection. I am a c/c++ > programmer (20+ yrs) and am interested in pitch recognition for the > purpose of developing an ear training program for my grandsons, ie, a > program to help someone develop the ability to play by ear, simple > melodies. > > My math skills include the standard 3 calculus for engineers courses > (however I'm not sure how much I remember, 20 yrs ago - never used it > so probably very little.) No engineering degree and no DSP courses or > experience. BA Psychology. Self-taught programmer. > > I have ordered the Lyons book and have downloaded the Stevens book. > Can anybody provide me a roadmap on the concepts/topics I need to > learn about in order to dlo pitch recognition.
You might want to add to your reading some books on audio perception and the physics of musical instruments. Pitch is different from spectra is different from pure frequency, especially related to what humans hear. You might also want to look into some of the literature on voice recognition, as humans may also infer pitch from transient information when the spectra is ambiguous, as it often is. I found a lot of the above information explained in the book: Speech and Audio Signal Processing, by Gold & Morgan. Wiley 1999 This book even includes an introduction to cepstral analysis, possibly useful for separating pitch from formant envelopes. IMHO. YMMV. -- rhn A.T nicholson d.0.t C-o-M
Hey, Vladimir,

How about a straight and honest answer ? :-)

Pitch detection problem is solved on the basic level, isn't it ?

What is left is just implementation details, and those are different
for different types of applications.

And the final solution to this fundamental problem of signal processing
attaches to the prestige of a certain educational institution which you
happened to attend in the past...

And BTW, the book by Rabiner and Schaefer is an excellent book, but the
author himself was honest enough to endorse my solution, although not
in public...

Vladimir Vassilevsky wrote:
> EagerToLearn wrote: > > > I am interested in learning about Pitch Detection. I am a c/c++ > > programmer (20+ yrs) and am interested in pitch recognition for the > > purpose of developing an ear training program for my grandsons, ie, a > > program to help someone develop the ability to play by ear, simple > > melodies. > > > > The Pitch Detection is a vast area. It is simple enough to get something > working, but it is difficult to make it work perfect. Before running > into the complexities, take a look at the classic book on the speech > processing by Rabiner and Shafer. There is a chapter on the pitch > detection. Although the methods described there are kind of old > fashioned and definitely not the best, it will give you the > understanding of how does this stuff work. > > Vladimir Vassilevsky > > DSP and Mixed Signal Design Consultant > > http://www.abvolt.com

fizteh89 wrote:

> Hey, Vladimir, > > How about a straight and honest answer ? :-)
I am not particularly enthusiastic about your solution.
> Pitch detection problem is solved on the basic level, isn't it ?
????
> What is left is just implementation details, and those are different > for different types of applications.
The best way of the implementation of the pitch detector depends on the goal. I.e. what is this pitch value is going to be used for (optimized for what?), how much of computation is affordable, how much of the buffering delay is affordable. The most common method for the pitch computation is by normalized autocorrelation in the time domain. Reason: it is dead simple and good enough for most of applications. For my tasks, I prefer frequency domain perceptually optimized methods.
> > And the final solution to this fundamental problem of signal processing > attaches to the prestige of a certain educational institution which you > happened to attend in the past...
????
> And BTW, the book by Rabiner and Schaefer is an excellent book,
It is a good book for the basic knowledge however it is very outdated. but the
> author himself was honest enough to endorse my solution, although not > in public...
Modesty is the virtue of mediocrits, isn't it? Vladimir Vassilevsky DSP and Mixed Signal Design Consultant http://www.abvolt.com
I wonder how close Pitch Detection is to the techniques I use for the
detection of tones in underwater sonar?

Here, I perform short, 50% ovelapped FFTs, and determine detections based
on consistency (or trend) of phase-differences between FFTs, at each bin
(there are as many 'detectors' as there are 'bins of interest' within the
spectrum). Accurate frequency determination is made by observing the mean
phase differences as each bin progresses over time (similar to vocoder).

This results in a very sensitive and accurate tone detector. FFT sizes are
varied according to the duration of the tones i.e. 'pulses' are
accommodated. In a real sonar, several FFT sizes are employed, working in
parallel, to cover a range of pulse durations as well as constant tones,
but this may not be necessary in the case of music. I have never tried
playing music into one of my sonar processors.

Jeff
> I am not particularly enthusiastic about your solution.
Well, you should be if you do speech processing...
> The most common method for the pitch computation is by normalized > autocorrelation in the time domain. Reason: it is dead simple and good > enough for most of applications.
It is NOT good enough, and everybody knows it... (Otherwise why would they invent all sorts of artificial nonlinear tricks like center-clipping ?) But again, it depends on your goals.
> > For my tasks, I prefer frequency domain perceptually optimized methods. >
Frequency domain pitch detection cannot be used for pitch tracking in highly-nonstationary signals such as speech, and everybody knows it..
> Modesty is the virtue of mediocrits, isn't it?
Well, in order to critisize and downplay other people's achievements you'd better first show some real contribution of your own. Do you have something to show, Vladimir ?