01-13-2017 12:03 AM
01-12-2017 11:54 PM
Hi,
I used fft.vi to get the fft of a sine wave. A shot of my simple code is attached. My question is what does the y axis represent?Values in y axis change when values of amplitude,sampling rate and number of samples are changed.
01-13-2017
02:15 AM
- last edited on
11-14-2024
04:32 PM
by
Content Cleaner
First of all there is not attachment in your posting.
Next all your observations are expected behavior.
There are many tutorials about FFT 'out there' that can teach you the basics of FFT, have you even tried to Google 'FFT' ?
An example of such presentation is:
http://www.ni.com/webcast/209/en/
01-13-2017 04:46 AM
01-13-2017 04:52 AM
01-13-2017 05:49 AM
Still no attachment and please do a little of research on your own as suggested. Try for example to search for 'FFT Tutorial' on Youtube.
01-13-2017 05:51 AM
01-13-2017 07:55 AM
Merged the duplicate thread since that is the one that had the attachment.
01-13-2017 08:39 AM
Hi jenifermaria
Let me give you the 5 minute crash intro to FFT
Please right-click on your FFT icon and select Help. This should open the help window for your sub-VI.
Scroll down to the section named FFT Details 1D FFT
There it tells you that the frequency resolution of your result array is Fs/N that is 1000/1000 = 1 Hz in your case.
Therefore you'll see 'activity' for the 10th array element if your frequency is 10 Hz and so on.
The FFT output is complexe and represents the amplitude and phase of your signal where the real values represents the 'cosine' and the imaginary values the 'sine' parts of your signal, that is why you see near zero (calculation noise) in the real array when your tone phase is a 0 (sine) and in the imaginary array when your tone phase is 90 deg (cosine).
Any phase in between gives you non-zero values in both real and imaginary arrays.
If you scroll all the way down in your Help window you can access the link Output Units for FFT-Based VIs
The first row in the table tells you that the scaling for non-DC is N/2, that is 500 in your case where your amplitude is 1. That explains the value of 500 you were asking about.
If your frequency is not an exact multiple of 1 Hz, the energy corresponding to your 'amplitude of 500' gets spread across multiple output array elements (called bins) and therefore you see lower values than 500 in the different bins.
So thing 'energy' and remember that the total energy of your signal may be distributed in both the real and imaginary arrays and over multiple bins. Try to replace your Complex to Re/Im primitive with the Complex to Polar one. It may be easier to understand the two output since r will represent your signal amplitude and Theta the phase (in radians)
From here it becomes more complicated and you'll have to find appropriate tutorials if you need more details on how to correctly use and interpret FFT.
Hope this helps as a kick-off for you to move on.