Im trying to perform an FFT on a set of sampled data to determine the frequency of a person humming.(adsbygoogle = window.adsbygoogle || []).push({});

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 Im using a microphone breakout board that has a 100x amp and bandpass filter, and Im going to be sending the signal directly to my ADC on my processor.

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

The rest may be wrong so correct me if Im 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 Im guessing I would be picking the Real Forward FFT right? I know its not backwards and Im pretty sure I dont need a complex FFT right?

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

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.

**Physics Forums | Science Articles, Homework Help, Discussion**

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Performing an FFT on sampled data

Can you offer guidance or do you also need help?

Draft saved
Draft deleted

**Physics Forums | Science Articles, Homework Help, Discussion**