views:

224

answers:

2

Hi Guys, I'm looking for an Objective-C class that allows me to get the frequency of a live input sound on the iPhone. Didn't find anything useful.

Before you ask: the frequency will not change for 0.1 seconds.

Thanks for answers, Christian

+4  A: 

Do you mean frequency or pitch ? If it's just a pure sinusoid and you want the frequency then you can just measure the time between zero crossings (crude) or use an FFT to get the power spectrum and then find the peak (more complex, more reliable).

Paul R
+1  A: 

Hi Christian,

I created an open source library to do just that. You can find it here. http://bonkel.wordpress.com/2010/03/03/frequency-detection-using-fourier-transform/

The link to the code is at the bottom of that blog post.

I've used it to create a chromatic instrument tuner. Tune Kitten Free that you can find on the app store.

Kind Regards Jared Kells

Jared Kells