Real-time pitch detection using FFT [closed]
Asked Answered
R

3

9

I'm trying to do real-time pitch detection using C++. I'm testing some code from performous (http://performous.org/), because everything else hasn't worked for me. I know for sure that this works, but i just cant get it to work. I've been trying this for a few weeks now, and I haven't been able to get any pitch detection code working.

Runny answered 23/9, 2009 at 16:1 Comment(4)
"can't get to work" means ??? (won't compile? won't run? turns your computer into a ball of flame?)Fungus
it compiles, but outputs frequencies running from 0 to about 1024Runny
Take a look at the FMOD library. One of their samples does realtime pitch detection IIRC. The library is free for open source, and moderately priced for commercial applications. Even if you don't want to use the library, perhaps it will provide some insight.Vincentvincenta
and what's wrong with that? Middle C is 440 Hz, so that range seems reasonable if sampling your mic. What frequencys do you expect?Landsknecht
S
11

Instead of using input from the mic, you should create data of a known single frequency and run that through the program and see if it gets you the correct result. Then you can add harmonics to it and see if that works. Real world data is just too variable for initial testing.

Safko answered 24/9, 2009 at 13:16 Comment(0)
D
1

Performous audio code has some optimizations, frequency limits and heuristics that make it only suitable for singing (and other similar tones). The optimal range is around 80-600 Hz.

Disject answered 23/1, 2010 at 15:56 Comment(0)
S
1

C/C++/Obj-C Real-time algorithm to ascertain Note (not Pitch) from Vocal Input

Check the accepted answer on this link.

I have scoured SO for an answer to this problem, and this is the most useful resource I have found.

It appears that Performous uses this algorithm, but it's hard to make out from the Performous code

EDIT: I have finally managed a working solution. e-mail me if interested sunfish|gmail|c0m

Siclari answered 19/11, 2010 at 1:10 Comment(1)
can you tell me how did oyu solve it?Yanirayank

© 2022 - 2024 — McMap. All rights reserved.