Hi fruki,

You are very nearly there, but I think you may have just had a slight problem in determining the frequency value out of your complex array.

I assume that when you say your spikes are at '52Hz' and '124Hz' that you mean the spikes were at the 52nd and 124th indexes into your complex array?

This is correct as the frequency resolution of your FFT is equivalent to sample frequency divided by fft size:

freq_res = Fs / FFT_SIZE;

or approximately 0.9766 in this case (1000/1024).

The first value in your array is the DC component, the second value represents the frequency 0.9766 Hz, the third represents 2*0.9766 etc.

So for the 52nd and 124th:

52nd = 51*0.9766 = 49.8047 Hz

124th = 123*0.9766 = 120.1172 Hz

Which is what you were expecting.

Cheers

Rod

## 1D real FFT help

Hi everyone,I've been

trying to build a simple FFT program to analyze different frequencies in a simple wavewith no luck. It's tough because I'm fairly new to DSP and I haven't been able to find sample code to do it with IPP. Anyway, this is my shot at it. The problem is that the spikes of the FFT show up in wrong frequencies. In the example I constructed a signal in matlab like so:Basically a

two sine waves added together at 50Hz and 120Hz. I then copy the output and place it in my code.The problem is I get the spikes at 52Hz and 124Hz. It's pretty frustrating as I need it as accurate as I can.Maybe I can't interpret the output, I don't know.My attempt at doing an FFT goes like this:Any help/advice will be greatly appreciated. (Even if you see other errors! I'm willing to learn)Thank you very much.