Performing an FFT on sampled data

  • Thread starter gotem3303
  • Start date
  • Tags
    Data Fft
In summary, the person is trying to use the MCF51AC256 on the DEMOACKIT to perform an FFT on a set of sampled data in order to determine the frequency of a person humming. They are using Codewarrior with Processor Expert, which includes a FFT bean that allows for compute forward and backward fast Fourier transform. They have some fields to set, including choosing a method for getting results of sinus and cosinus operations and picking the Real Forward FFT when performing the FFT. They also need help understanding the return type of the function and how to find the frequency from the real and imaginary spectrums. The page provided may have the answers they need.
  • #1
gotem3303
29
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
  • #2
gotem3303 said:
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?
I think all your questions are answered in this page.
https://www.mathworks.com/help/matlab/ref/fft.html
 

1. What is an FFT?

An FFT, or Fast Fourier Transform, is a mathematical algorithm used to convert a signal from its original domain (often time or space) to a representation in the frequency domain. It is commonly used in signal processing and data analysis to identify the frequencies present in a signal.

2. Why is an FFT commonly used on sampled data?

Since sampled data is typically discrete rather than continuous, an FFT can be used to convert the data from the time domain to the frequency domain. This allows for easier analysis and identification of patterns or frequencies present in the data.

3. How is an FFT performed on sampled data?

An FFT is typically performed by using a computer program or software that implements the mathematical algorithm. The sampled data is input into the program, which then applies the FFT algorithm to the data, producing a frequency spectrum as the output.

4. What are the advantages of using an FFT on sampled data?

One of the main advantages of using an FFT is that it allows for a more efficient and accurate analysis of the frequencies present in the data. It also allows for the identification of hidden or underlying patterns that may not be easily observable in the original time domain data.

5. Are there any limitations to using an FFT on sampled data?

While an FFT can be a powerful tool for analyzing sampled data, it does have some limitations. For example, an FFT assumes that the data is periodic, which may not always be the case in real-world scenarios. Additionally, the accuracy of the results may be affected by factors such as the sampling rate and the length of the data being analyzed.

Similar threads

Replies
6
Views
971
  • Electrical Engineering
Replies
8
Views
924
  • Electrical Engineering
Replies
17
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
1K
  • Programming and Computer Science
Replies
5
Views
2K
  • Set Theory, Logic, Probability, Statistics
Replies
10
Views
2K
Replies
1
Views
892
  • Programming and Computer Science
Replies
3
Views
2K
  • Electrical Engineering
Replies
3
Views
6K
Back
Top