LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Fourier Transform and the DAQ Assistant

Hi,

 

I'm trying to take the fourier transform of a analog voltage measurement in Labview 8.6 and I'm having a problem with the data.

 

The measurement is an anaolog input voltage signal taken using the USB-6211 box.  I am acquiring the signal on ports 15 and 16 (differential) with the DAQ Assistant at a rate of 5KHz, 200 samples.  The setup works perfect thankfully, and a very nice waveform plot is generated on the VI.  I would now like to add a fourier transform of this plot to do some frequency analysis.

 

I found the FFT function, but when I tried to add the DAQ output to it, I got an error about dynamic data.  It takes me to a screen which I don't understand about dynamic data conversion, and I'm not sure what to do from this point.  My FFT graph is basically just a flat white line, which is wrong.

 

How can I just take the basic fourier transform of a waveform in this setup?

0 Kudos
Message 1 of 14
(4,799 Views)
You can use the Convert from Dynamic Data node. Is it possible to post a screenshot so we can visualize the issue?
Adnan Zafar
Certified LabVIEW Architect
Coleman Technologies
0 Kudos
Message 2 of 14
(4,778 Views)

Yup, attached is a screen shot.  As for the FFT output, that's easy - it's just a while line at zero...

 

I think Labview by default added the dynamic data node, I just don't know how to use it or what signal to select.  This approach will work I suppose, if somebody would be kind enough to walk me through it.

Message Edited by nyair24 on 04-28-2009 08:40 AM
0 Kudos
Message 3 of 14
(4,774 Views)
Double-click on the Convert from Dynamic Data node and choose the datatype that your FFT.vi expects.
Adnan Zafar
Certified LabVIEW Architect
Coleman Technologies
0 Kudos
Message 4 of 14
(4,767 Views)

Thanks for the replies.  I did that but there are a lot of options and I'm not sure which data type the FFT takes, and why it can't just take the data type I'm giving it.  The graph has time on the x-axis and voltage on the y-axis - I just want to do a normal fourier transform of this, nothing exotic.  I don't understand why I even need to convert anything.  Which data type should I select?

 

 

0 Kudos
Message 5 of 14
(4,757 Views)

The FFT takes a 1D DBL array as an input. The context help tells you that.

 

There should not be an issue with the way you have it wired. Can you post the actual vI with some data? Run the VI until you see something in your graph. Stop the VI and go to the Edit menu and select Make Current Values Default. Save the VI. Attach that.

0 Kudos
Message 6 of 14
(4,751 Views)

Hi Dennis,

 

Thanks for your post - attached is the VI and a screen shot.

 

I've got it set to 1D scalers, floating point double, automatic right now...I think that's what you meant by 1D DBL.  It was on 1D array (double by default) but the graph isn't any different.

Download All
0 Kudos
Message 7 of 14
(4,734 Views)
You should remove the significant dc component from the signal.
0 Kudos
Message 8 of 14
(4,718 Views)

Hi

Your thinking is not bad. You have only some scaling problems. You may toy with the vi I am sending. Change the log/linear control and see the result.

You will find all information you need here http://zone.ni.com/devzone/cda/tut/p/id/4541 and http://zone.ni.com/devzone/cda/tut/p/id/4541. The dt value is the reciprocal of the sample frequency(1/x) The unit is second, and it will give you the time interval between two samples.

Also note how I use the "Dynamic To Waveform Array.vi" to convert the dynamic data. This VI is not documented by NI, but you find it here ...vi.lib\express\express shared\transition.llb\Dynamic To Waveform Array.vi

Good luck



Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 9 of 14
(4,709 Views)

Hi Coq Rouge, thanks so much for posting your VI.  I've hooked my data intake up to your program and I changed all of the inputs to read from my DAQ.  There aren't any errors, but I don't see that the graph ever updates - how can I get it to give me the FFT in real time as the data comes in?

 

Really I'm disappointed with Labview, this is such a simple task.  If I plot the output from the Labview stock FFT functions, it tries to give me a graph of data in the time domain... :smileysad:

0 Kudos
Message 10 of 14
(4,685 Views)