LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how do I graph an FFT output

I would like to graph my FFT output to a (frequency vs. power graph).  My input file is simply an array of 1' and 0's (actually +1 and -1's).  What labview block should I be hooking up to,  is there something that will let me enter my sampling rate?  Also, how is the output (y) axis represented (as power), if so these numbers do not make much sense??  Any help here would be great.

 

 

0 Kudos
Message 1 of 13
(4,385 Views)

Jeff,

 

You can wire your array of data directly to the input of the FFT VI.  It accepts numeric arrays. Its output is an array of complex doubles.  You can actaully wire that directly to a waveform graph terminal.  It only plots the real part, but that may be alll you are looking for anyway.  Or you can use the complex number functions in the Numeric palette to format the data.

 

If you look at the detailed help for the FFT VI it will tell you how to calculate the df or frequency increment from the sampling rate and the nunber of data samples.  You can then use property nodes to scale the frequency axis of the graph.  The detailed help also discusses the vertical scaling.

 

Lynn

0 Kudos
Message 2 of 13
(4,380 Views)

Hi Lynn,

 

I read through the detailed help, I still do not understand the Y axis values that the FFT outputs.  I am attaching my Vi so maybe you can make some sense of it for me.

 

thanks

Jeff

0 Kudos
Message 3 of 13
(4,347 Views)

Using an XY graph in the way you have is not correct, I think. Try a normal graph and see if it makes more sense.

0 Kudos
Message 4 of 13
(4,340 Views)

I found a graph that outputs the data "shape" correctly,  I now just have to figure out the units.

 

thanks

0 Kudos
Message 5 of 13
(4,333 Views)

Jeff,

 

The output magnitude units are the same as the input units.   From the help yk = Sum over n (xn*exp(-j2pikn/N)).  The exponential has no units so the units of yk are the same as the units of xn.

 

That is a very interesting signal. When you do an FFT on the entire dataset, it has peaks spaced 11520 index units but only the first six and last six are above the noise.  There is also a substantial DC offset.  Limitng the FFT size to 16384 tends to suppress the lower frequency peaks.

 

Lynn.

 

 

0 Kudos
Message 6 of 13
(4,321 Views)

Hi Lynn,

 

Still trying to get to the bottom of the Y scale on the FFT.

 

from the Detailed Help "Output Units for FFT-Based VI's"  it says the FFT Non-DC Unit is "V" and the DC Unit is "V" and the Non-DC Scale Factor is N/2

and the DC Scale Factor is N.  With that being said, do I take my DC FFT value (my first Bin) and divide it by my sample size?  That appears to work correctly,

when I perform that function I get my correct output value.  The Non-DC Scale Factor is a bit different.  The scale factor is N/2,  to scale my frequency Bins of

k>0, would I take my FFT value (for each Bin) and divide is by N/2?  This is what I'm attempting to do but my power levels at each bin appear too high......

 

any thoughts on this??

 

thanks

Jeff

0 Kudos
Message 7 of 13
(4,295 Views)

Hi,

 

I believe I have got to the bottom of understanding the FFT magnitude,  please correct me if my understanding is incorrect. 

 

FFT:  outputs (V), for both Non-DC and DC values.  If I want the magnitude scaled, I merely take my FFT output and divide it by my sample size (N)

         To calculate my PSD, I would take the square root of the sum of the squares for my entire sample (if I wanted the PSD for the whole sample)

 

Power Spectrum:  outputs(V)^2 for both Non-DC and DC values.  If I want the magnitude scaled, I can just take the square root of the Power Spectrum Output.

                           To calculate my PSD, I would take the square root of the sume of my entire sample (if I wanted the PSD for the whole sample)

 

 

Any suggestions on performing this math and outputing it to display (real time)?  I am currently just outputing it to excel and post processing it.

 

thanks

0 Kudos
Message 8 of 13
(4,260 Views)

Jeff,

 

The simple calculations are readily done in LabVIEW. Just insert the functions in the wire between the FFT and the graph terminal.

 

Try it.  If you have more questions, please post your latest attempt with some typical values saved as default.

 

Lynn

0 Kudos
Message 9 of 13
(4,256 Views)

 Edit: removed duplicate.  Browser double posted for me.

 

Lynn

0 Kudos
Message 10 of 13
(4,256 Views)