• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Confused about data returned from an FFT for a AU
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Confused about data returned from an FFT for a AU
      • From: tahome izwah <email@hidden>
    • Re: Confused about data returned from an FFT for a AU
      • From: Volker in Lists <email@hidden>
    • Re: Confused about data returned from an FFT for a AU
      • From: Brian Willoughby <email@hidden>
  • Prev by Date: Re: How to fill the ioData parameter in the Audio Unit rendering call back?
  • Next by Date: Record and playback at the same time
  • Previous by thread: Re: RenderCallbacks Disconnecting
  • Next by thread: Re: Confused about data returned from an FFT for a AU
  • Index(es):
    • Date
    • Thread