Question

Hi I have to draw a spectrum graph for the wav file. I am using the AudioFileGetProperty and I am able to retreive the AudioData for the wav file using

audioData = (SInt16*)malloc( 2 *packetCount); 

from this other question.

Gonna use FFT in accelerate framework. Please do let me know how to get the Frequency. I am not sure how the input for FFT should be. I currently have the SInt16 audio data.

Was it helpful?

Solution

This post on NSBlog describes how to perform an FFT using Apple's vDSP. The result of the FFT doesn't give you "a frequency". It gives you the magnitude and phase of all the frequencies below half the sample rate of your audio. If your input signal is a simple sine wave, just look for the maximum in the magnitude values.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top