Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iPhone: CPU power to do DSP/Fourier transform/frequency domain?

I want to analyze MIC audio on an ongoing basis (not just a snipper or prerecorded sample), and display frequency graph and filter out certain aspects of the audio. Is the iPhone powerful enough for that? I suspect the answer is a yes, given the Google and iPhone voice recognition, Shazaam and other music recognition apps, and guitar tuner apps out there. However, I don't know what limitations I'll have to deal with.

Anyone play around with this area?

like image 884
mahboudz Avatar asked Sep 15 '09 06:09

mahboudz


4 Answers

Apple's sample code aurioTouch has a FFT implementation.

like image 58
zaph Avatar answered Sep 23 '22 09:09

zaph


The apps that I've seen do some sort of music/voice recognition need an internet connection, so it's highly likely that these just so some sort of feature calculation on the audio and send these features via http to do the recognition on the server.

In any case, frequency graphs and filtering have been done before on lesser CPUs a dozen years ago. The iPhone should be no problem.

like image 36
moogs Avatar answered Sep 22 '22 09:09

moogs


"Fast enough" may be a function of your (or your customer's) expectations on how much frequency resolution you are looking for and your base sample rate.

An N-point FFT is on the order of N*log2(N) computations, so if you don't have enough MIPS, reducing N is a potential area of concession for you.

In many applications, sample rate is a non-negotiable, but if it was, this would be another possibility.

like image 41
Overdrive Avatar answered Sep 19 '22 09:09

Overdrive


I made an app that calculates the FFT live

http://www.itunes.com/apps/oscope

You can find my code for the FFT on GitHub (although it's a little rough)

http://github.com/alexbw/iPhoneFFT

Apple's new iPhone OS 4.0 SDK allows for built-in computation of the FFT with the "Accelerate" library, so I'd definitely start working with the new OS if it's a central part of your app's functionality.

like image 24
alexbw Avatar answered Sep 22 '22 09:09

alexbw