Performing an FFT on sampled data

  • Thread starter Thread starter gotem3303
  • Start date Start date
  • Tags Tags
    Data Fft
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
1 reply · 3K views
gotem3303
Messages
29
Reaction score
0
Im trying to perform an FFT on a set of sampled data to determine the frequency of a person humming.

Im using the MCF51AC256 on the DEMOACKIT, coding with Codewarrior using Processor Expert which has a FFT bean included, so all I need to do is pass it values and it performs the FFT.

So I am using a microphone breakout board that has a 100x amp and bandpass filter, and I am going to be sending the signal directly to my ADC on my processor.

In my code I am to sample the inputted signal at 40kHz.

The rest may be wrong so correct me if I am wrong.

I now plan on filling a size 512 array with the sampled signal data. I will then feed that array to the FFT function. This is the definition of the bean:

The bean allows compute forward and backward fast Fourier transform.

I have some fields to set:

1. Sin and Cos generating: This property determines what method is used to getting results of sinus and cosinus operation. I can pick from the following, but which of these would I pick??
-Standard C functions
-Full Table
-Half Table
-Buneman's Algorithm
-NumRec

Also, when I actually perform the FFT, I need to cal the function of course, so I am guessing I would be picking the Real Forward FFT right? I know its not backwards and I am pretty sure I don't need a complex FFT right?

And one last thing for now, which I need help on the most, is the return type of the function.

The function is word RealFwdFFT(dword Size, PFFTType Re)
-Size:dword - FFT size (which will be 512 for me correct)
-Re:PFFTType - On input is pointer to array containing data, returning spectrum where first half or array means real spectrum and second half means imaginary spectrum.
-Return: word - possible error codes.

So my main question is when I get my result back from the function call, and I now have a real spectrum and an imaginary spectrum, how do I find the frequency?

Ive tried doing a lot of research on FFT and DFT and I can't seem to find how to realize the answer I need from this data.
 
Engineering news on Phys.org