Reputation: 119
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.
Upvotes: 0
Views: 1844
Reputation: 10708
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.
Upvotes: 1