Confused about data returned from an FFT for a AU
Confused about data returned from an FFT for a AU
- Subject: Confused about data returned from an FFT for a AU
- From: email@hidden
- Date: Fri, 13 Mar 2009 03:38:55 +0000
Hello all,
I apologize in advance, I'm a bit new to this so hopefully this makes sense. I'm trying to make an AU plug-in that does some processing in the frequency domain. I'm confused on how to manipulate data once I get to the frequency domain because I'm not getting the results I would expect. Maybe I should just go over what I have done so far and make sure I'm doing it right.
float *data = "" malloc(N * Stride * sizeof * dataMem);
DSPSplitComplex data = { dataMem, dataMem + N/2 };
// split to real and imaginary numbs
vDSP_ctoz((DSPComplex *) signal , Stride, &data, 1, N/2);
// Perform a real-to-complex FFT.
vDSP_fft_zrip(Setup, &data, 1, Log2N, FFT_FORWARD);
// do processing in here.....
// get back original data, do ifft
vDSP_fft_zrip(Setup, &data, 1, Log2N, FFT_INVERSE);
// put real and imaginary back to interleaved
vDSP_ztoc(&data, 1, (DSPComplex *) destP, Stride, N/2);
I'm passing the whole signal through the FFT that is passed by the Process function (1024 samples). I'm confused about the data thats returned after doing the fft forward(where I want to do the processing). It looks like if I looped through it, say to get the magnitudes it would be something like this.
for(int i=0; i<N/2; i++) {
printf("mag: %f \n", sqrt(data.realp[i]* data.realp[i]+ data.imagp[i]* data.imagp[i]);
}
By doing that, am I looping through a snapshot of 1 frame, getting the magnitude from each bin? Or is that all the data from the whole signal (more than just 1 frame, like an average), or am I missing something?
Thanks in advance, any insight is greatly appreciated.
Ryan
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden