DSPRelated.com
Forums

Reference implementation of pitch detection

Started by Elizabeth August 23, 2003
Could someone point me to a reference/example implementation of pitch
detection?



In article XkK1b.4677$lq.4197@fe04.atl2.webusenet.com, Elizabeth at
pleasedont@goaway.net wrote on 08/23/2003 10:06:

> Could someone point me to a reference/example implementation of pitch > detection? >
my wavetable synthesis 101 paper that you can find at harmony-central.com has both a method outlined and a few references to others. don't have the URL handy but start at http://www.harmony-central.com/, click on synthesis and see what you get. r b-j
> > Could someone point me to a reference/example implementation of pitch > > detection? > > > > my wavetable synthesis 101 paper that you can find at harmony-central.com > has both a method outlined and a few references to others. don't have the > URL handy but start at http://www.harmony-central.com/, click on synthesis > and see what you get.
Robert, Thanks for the link, but my problem is that I have no background in the necessary math. What I'm looking for is a basic source code sample that demonstrates the fundamentals. Elizabeth
In article hBN1b.5413$lq.3211@fe04.atl2.webusenet.com, Elizabeth at
pleasedont@goaway.net wrote on 08/23/2003 13:48:

>>> Could someone point me to a reference/example implementation of pitch >>> detection? >>> >> >> my wavetable synthesis 101 paper that you can find at harmony-central.com >> has both a method outlined and a few references to others. don't have the >> URL handy but start at http://www.harmony-central.com/, click on synthesis >> and see what you get. > > Robert, > > Thanks for the link, but my problem is that I have no background in the > necessary math. What I'm looking for is a basic source code sample that > demonstrates the fundamentals. > > Elizabeth >
hi E, i would send this directly to you (not comp.dsp) just to allow us to be frank which is difficult in a public environment, but with a return address of <pleasedont@goaway.net>, i am skeptical that it would make it. what is the math you don't understand? integrals? (they're just summations.) perhaps the better question is: what is the math you *do* understand? it's not a silly question because you must be able to understand some if you're gonna code anything having to do with audio signal processing. just curious. i might be able to walk you through some simple pitch detection technique but you have to be able to access the audio samples, know which samples you are looking at and code the computer to perform some simple things like subtracting, absolute value, adding, and maybe multiplication. i sure do hope that you can do that. regards, r b-j
Actually, any explanation that doesn't resort calculus would be fabulous.



Elizabeth wrote:
> > Actually, any explanation that doesn't resort calculus would be fabulous.
Elizabeth, There may be one, but I haven't thought of it yet. One of my armchair pleasures is solving calculus problems without calculus. I started, as far as I know, in the seventh grade. Another -- you might call it a hobby horse that I ride -- is maintaining that calculus is one of the liberal arts, and that an appreciation of calculus is as important as familiarity with music, history, and literature. Such notions as "point of diminishing returns", "rate of progress", and "average temperature" can be appreciated only dimly without it. If your search for pitch-detection algorithm you can understand leads you to an understanding of principles of elementary calculus, you will find that bonus far more enlightening than you now imagine. Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
In article 3F4A2F2F.EEA60C51@ieee.org, Jerry Avins at jya@ieee.org wrote on
08/25/2003 11:45:

> Elizabeth wrote: >> >> Actually, any explanation that doesn't resort calculus would be fabulous. > > Elizabeth, > > There may be one, but I haven't thought of it yet.
i'm working on it (in my spare moments in the evening). it'll be only about the AMDF or ASDF method. r b-j
"Jerry Avins" <jya@ieee.org> wrote in message
news:3F4A2F2F.EEA60C51@ieee.org...
> Elizabeth wrote: > > > > Actually, any explanation that doesn't resort calculus would be
fabulous.
> > Elizabeth, > > There may be one, but I haven't thought of it yet. One of my armchair > pleasures is solving calculus problems without calculus. I started, as > far as I know, in the seventh grade.
Let me put it another way. I as I understand it, the sanskrit looking formulae that I've been reading about recently are nothing more than algorithms. However complex, they can be broken down into a series of steps that can surely be explained without resorting to symbolic means. For purely illustrative purposes, something akin to: 1. for each peak frequency with an amplitude greater than X add cosine(frequency) to a running total 2. Divide running total by number of peaks 3. Multiple result by Pi See what I mean?
> i would send this directly to you (not comp.dsp) just to allow us to be > frank which is difficult in a public environment, but with a return
address
> of <pleasedont@goaway.net>, i am skeptical that it would make it.
lol. Good catch.
> what is the math you don't understand? integrals? (they're just > summations.) > > perhaps the better question is: what is the math you *do* understand?
it's
> not a silly question because you must be able to understand some if you're > gonna code anything having to do with audio signal processing.
Actually, you've hit on the head. It's the symbolic language I don't understand. To give you some background, I've been a programmer for about ten years, and a couple of years ago I wrote an application to price options using black scholes and monte carlo simulations. The nasty looking formulas were driving me nuts until I found a link that explained that the black scholes method was simply: DoubleVar1 = Log(Price/Strike) + (RiskFreeRate + ( Volatility * Volatility) / 2) * TimeToExpire) / (Volatility * Sqrt(TimeToExpire)) DoubleVar2 = DoubleVar1 - Volatility * Sqrt(TimeToExpire) if CallOption then Return Price * CumDistributionNorm(DoubleVar1) - Strike * Exp(RiskFreeRate * -1 * TimeToExpire) * CumDistributionNorm(DoubleVar2) Simple, right? ;-)
> i might be able to walk you through some simple pitch detection technique > but you have to be able to access the audio samples, know which samples
you
> are looking at and code the computer to perform some simple things like > subtracting, absolute value, adding, and maybe multiplication. i sure do > hope that you can do that.
I'll surely get stumped occasionally ( or frequently ) along the way, but I would greatly appreciate anything you could do to help translate. If you want to go off group, feel free to reply to estonecypher@hotmail.com Thanks E
In article <XkK1b.4677$lq.4197@fe04.atl2.webusenet.com>,
Elizabeth <pleasedont@goaway.net> wrote:
>Could someone point me to a reference/example implementation of pitch >detection?
Detection of the pitch of what kind of signal? The answer could be as simple as counting zero crossings, to something far more complicated, depending such things as the signal-to-noise ratio, harmonic content, signal duration, signal evolution over time, and the time/frequency resolution required. The answer may also require you to precisely specify what you mean by "pitch", as psychoacoustics and such might be required to model your problem (people sometimes "hear" the pitch of "notes" which don't actually "exist"). In many cases, the solution can be expressed in a simple algorithm, but, which only makes sense if you understand mathematical concepts such as convolution with a trigonometric function. Using an algorithm without understanding what's behind it is like copying the answer from the textbook; this only works if the instructor doesn't modify the question slightly. The real world is often an excellent instructor. IMHO. YMMV. -- Ron Nicholson rhn AT nicholson DOT com http://www.nicholson.com/rhn/ #include <canonical.disclaimer> // only my own opinions, etc.