LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Axis Issues in labview

Solved!
Go to solution

I have a real time data. I read it in Labview and did a FFT on it which was then connected to a waveform graph. Now I tried plotting it and I got the expected graph shape. 

I tried doing the same thing with "Origin Lab" software and it also gave me the same graph(same in shape). However, the X-axis units were completely different for both. In origin I get the peak frequency as 550 Hz where as Labview gives me something like 4 or 5 units in the x axis. I got to know that the Origin result is right and the labview result is wrong. Only if I change the multiplier value in the graph properties in Labview, I get the required result.Why is that? How do I correct this error? I want to correct this error as it is much easier to collect and store data using Labview. 

I have attached my VI here(It might look messy,but you only need to check two graphs: Fast  Fourier Transform( Scaled) and Fast  Fourier Transform(Unscaled).

Also, I have attached the Origin Lab graph.

 

 

Download All
0 Kudos
Message 1 of 9
(2,575 Views)

Hi Akaash,

 

unfortunately you didn't attach your measurement data file nor did you attach a screenshot of the LabVIEW results…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 9
(2,564 Views)

Sorry. I have uploaded them here. 

0 Kudos
Message 3 of 9
(2,551 Views)
Solution
Accepted by topic author Akaash_Dragon

You converted your dynamic data type signal (blue wire) which contains all of the timing information of the raw signal to just an array of values.  The FFT doesn't know what the dT was of the original signal, it just assumes it is one second.

 

Refer back to what I told you in this message https://forums.ni.com/t5/LabVIEW/Graph-Units-in-Labview/m-p/3802856#M1073408

Message 4 of 9
(2,532 Views)

Thanks a lot! I will try rectifying this issue and get back to you.

0 Kudos
Message 5 of 9
(2,496 Views)

How do I make LabVIEW understand that my dt= 1/20000 of 0.02 seconds?

0 Kudos
Message 6 of 9
(2,459 Views)

Hi Akaash,

 

create a waveform and set dt to 1/20000…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 9
(2,452 Views)
Solution
Accepted by topic author Akaash_Dragon

Following up on GerdW's comment, an Array is just a series of numbers.  Data Samples are more than that -- they are a series of numbers taken at equally-spaced units of time.  LabVIEW is one of the few Programming Environments that treats time as an integral part of the paradigm, having Time functions and Data formats (the Waveform) that explicitly include Time.

 

If you look in the Signal Processing Palette, you should see the Wfm Measure sub-palette.  Here you can find Spectrum routines that take Waveforms as their input (so "dt" is known) and return scaled spectra (with "df" returned).

 

If you are serious in learning how to use LabVIEW to solve Engineering problems, you should try to avoid Express VIs (which lock you into a limited set of choices) and also avoid Dynamic Data Wires, which similarly "bury the details" and tend to throw them away when you need to use the data.  For example, you used "Convert from Dynamic Data", but chose the default, a simple Array, losing the timing properties buried in the Dynamic Data.  If you started with Waveforms and kept them throughout, your code would be much easier to understand and would be more likely to work.

 

Bob Schor

Message 8 of 9
(2,447 Views)

Thank you so much. I will keep that in mind! I guess ill have to make lot of modifications to my program.

0 Kudos
Message 9 of 9
(2,430 Views)