LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

FFt

I have a quick question. Assume I have a 20 Hz sine wave with a sampling rate of 1000 Hz and I want to perform an FFT on this. Now, the express VI for FFT is no good because I want the FFT over 2048 points so I just used the basic FFT option. When I try and graph the amplitude vs. frequency on a X-Y graph, my amplitudes look about right but my frequency is way off. I have been using a matrix that starts at zero, and goes in increments of 1000/2048 (sampling rate/number of points in FFT) until it fills a 2048 matrix. That is, the first point is 0 and the second point is 0 +1* (1000/2048) and the third point is 0 + 2*(1000/2048) ect. 
 
 
 Is this false? Is there a method that anyone knows that can help me do this more properly that I am unaware of? Thanks,
 
Cameron
0 Kudos
Message 1 of 3
(2,790 Views)
I'm not sure if I understand why you can't use the express VI. I don't recall seeing a problem with over 2048 data points coming into the spectral measurements express VI, and I have confirmed this as well. Any VI using the FFT algorithm will perform slower when using a number of points that is not a power of 2, but in this case it is still possible to use the FFT VIs.
 
Is there something about your problem I don't understand? Have you tried to use the express VI and gotten an error? Are you experiencing strange results with the express VI?
 
As far as the frequency being incorrect, I suspect this is because your data does not include time information. In other words, what is the time (dt) in between your data points? The easiest way to generate an FFT with accurate frequency is to use the waveform data type, which includes timing information.
 
I hope this helps. I'm sure that we can work on this together and find a solution.
 
Casey Weltzin
National Instruments
0 Kudos
Message 2 of 3
(2,783 Views)
Why are you using X-Y graph ?
You just have to use simple graph, creating a cluster whith your 1D array of
amplitudes (y values) and the df (half of sampling frequency / number of
points in the 1D array).
If your number of points is not a power of 2 you have to use the zero
padding Vi before perform the FFT.
When using the classical FFT, a symetry will appear (with negative
components). You should take the second half of the 1D array or use the
power spectrum Vi.

Jerome




"Cameroon" <x@no.email> a écrit dans le message de news:
1149799210699-376343@exchange.ni.com...
>I have a quick question. Assume I have a 20 Hz sine wave with a sampling
>rate of 1000 Hz and I want to perform an FFT on this. Now, the express VI
>for FFT is no good because I want the FFT over 2048 points so I just used
>the basic FFT option. When I try and graph the amplitude vs.
>frequency&nbsp;on a X-Y graph, my amplitudes look about right but my
>frequency is way off. I have been using a matrix that starts at zero, and
>goes in increments of 1000/2048 (sampling rate/number of points in FFT)
>until it fills a 2048 matrix. That is, the first point is 0 and the second
>point is 0 +1* (1000/2048) and the third point is 0 + 2*(1000/2048)
>ect.&nbsp;
> &nbsp;
> &nbsp;
> &nbsp;Is this false? Is there a method that anyone knows that&nbsp;can
> help me do this more properly that I am unaware of? Thanks,
> &nbsp;
> Cameron


0 Kudos
Message 3 of 3
(2,774 Views)