mahboudz
mahboudz

Reputation: 39376

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?

Upvotes: 8

Views: 6277

Answers (5)

alexbw
alexbw

Reputation: 2038

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.

Upvotes: 1

Overdrive
Overdrive

Reputation: 121

"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.

Upvotes: 2

yan bellavance
yan bellavance

Reputation: 4850

You cant just port FFT code written in C into your app...there is the thumb compiler option that complicates floating point arithmetic. You need to put it in arm mode

Upvotes: 0

zaph
zaph

Reputation: 112875

Apple's sample code aurioTouch has a FFT implementation.

Upvotes: 3

moogs
moogs

Reputation: 8202

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.

Upvotes: 3

Related Questions