09-03-2008 10:40 AM
Hi,
Ive created a sine wave by creating an array of x values and y values, I have then tried to find the FFT (fast fourier transform) of the y values. As you can see from my graph I get two peaks as expected on my FFT graph.
What I dont understand is why the amplitude is not 1 for these peaks but instead it is 1.57 (pi/2). I would expect the amplitude to be the same as the peak amplitude of the sine wave. As it is pi/2 and not some random number I imagine there is a simple explanation, does anybody know the reason for this? Am I doing something wrong?
I have included the VI I have written.
Thank you,
Mark
09-03-2008 02:18 PM
Hi Mark,
There are a few issues here. First, you are passing a complex data type into a DBL graph, so you're actually seeing the real part of the FFT output instead of the magnitude. Use Complex To Polar to get the magnitude values. These should read 128 (N/2) due to the scaling in the definition of the FFT. Yours are slightly off because your sine period includes 0 twice and is not exactly on-bin.
Take a look at the diagram of one of the higher-level functions like FFT Spectrum (Mag-Phase).vi to get an idea of the operations involved to get an answer scaled to the peak or RMS units you desire.
Jim