ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

fft express vi

HI all.  New to labview, read: never used before, and I need to generate amplitude and phase plots for a noisy signal, then reconstruct the signal.  So far I have created a VI that will work on a test case of a sine signal with amplitude 10, period of 1 second.  The only issue there is that the phase appears to be output as a magnitude of real+complex values; how do i strip off real values only?

 

In the test case, one colum is given for time, and the next for the signal data.  On the assignment I'm working on, the data is given only in one column, to time column.  questions are a) how does labview know what to use for the xscale in this case, and b) what is output by the Spectral Measurements express vi for amplitude and phase? and c) eventually, this data will need to be used to reconstruct the original signal through iFFT, however the data types don't seem to match going from the output of the express VI to the inputs of the iFFT VI; what is the correct way to use the data to reconstruct the signal?

 

Thanks in advance,

 

Jim

0 Kudos
Message 1 of 7
(4,129 Views)

Hai...answering the questions one by one....

 

1. Inorder to generate any signal e.g. sine wave of 10Hz, 5V amplitude use "Basic function generator.vi" in Signal Processing pallete.

2. Try the "Amplitude and Phase spectrum.vi" which gives the phase in radians.  This VI is found in Signal Processing>>Spectral analysis

3. When a signal is plotted it has a parameter called dt i.e. the time seperation between two points.  Its nothing but the reciprocal of your sampling rate.  Given the data and sampling rate you can fix the seperation between two points as 1/fs (fs-sampling rate) as X-Scale

 


a) how does labview know what to use for the xscale in this case,


4. A waveform consists of three components t0, dt, Y

                t0 - is the time stamp representin the arrival first sampl

                dt - is the seperation between one data point and another

                 Y- array of data points

Use the "Build waveform" function to build a waveform and display it in a graph.  LabVIEW automatically takes t0 and dt as X-scale parameters and plots the Y data wrto. the X scale.

 


 b) what is output by the Spectral Measurements express vi for amplitude and phase

c) eventually, this data will need to be used to reconstruct the original signal through iFFT, however the data types don't seem to match going from the output of the express VI to the inputs of the iFFT VI; what is the correct way to use the data to reconstruct the signal?



5. Out of your FFT is generally magnitude and phase components.  Convert these two outputs into complex number and then feed it to iFFT.vi (select the polymophic instance as 1D complex in this case)

Message Edited by JK1 on 03-02-2009 04:02 AM
With regards,
JK
(Certified LabVIEW Developer)
Give Kudos for Good Answers, and Mark it a solution if your problem is solved.
Message 2 of 7
(4,114 Views)
If you are going to use the iFFT vi you must also have a input type equal to the FFT vi output. The output from the FFT vi is Two-Sided. Read more here http://zone.ni.com/devzone/cda/tut/p/id/4278


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

ok, so here is my code.  i have several different attempts at doing the same thing in it.  it is trying to read in the lvm file, turn it into a signal, run an fft on it, plot phase and amplitude vs freq. the reason for the "build waveform" vi is that this is just a test case, the actual file doesn't have a column for time data and that was the only way i could think of to make that signal.

 

the problem seems to be only the phase - the phase plots don't match up with a working matlab fft program i have, not even close.  I'm thinking that the output of the phase from the vi's is the magnitude of a complex number or something.  can you tell me what the output is for phase from these vi's? (ie. real, imaginary, complex, complex magnitude, etc...) thanks,

 

jim

Download All
0 Kudos
Message 4 of 7
(4,082 Views)

The FFT functions in labview works fine. As a friendly tip you should achieve some better understanding of the FFT concept, before you start to program. I have already given you one tutorial. Please read it, and also this one http://zone.ni.com/devzone/cda/tut/p/id/4541. Just tossing out functions on your diagram will not do you any good.

You should also note that some changes has been made to the FFT function since the latest tutorial was written. Now the FFT output is a complex array. To brake a complex array into rectangular components you have do as shown in the picture

 



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

I appreciate the links and advice.  I think I have a pretty good understanding what the FFT does, and those articles backed up what I thought I knew, I just have zero ability in LabView.  My trouble is still with the phase.  For the test case attached, the output from my program for the phase after the FFT is done doesn't make any sense.  I have split the output into real/im components and attempted to find the phase through the arctan relation and converting to degrees.  This spits out nothing.  I'm sure I'm missing some sort of syntax or something, but the teacher for this class said "here you go, make it work" so I've got nothing coming into this project.  Any more help is appreciated.

 

jim

Download All
0 Kudos
Message 6 of 7
(4,031 Views)
I guess this may push you in the right direction


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