LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to add 3 component waveforms to obtain 1 resultant waveform?

Hi,

 

I'm acquiring data from a 3 channel accelerometer (three components x,y, and Z) through DAQ express. I'm displaying three components in separate waveform graphs. I also need to fing the resultant vector (sqrt (x square+ y square + y square)).. How can I acheive this?

 

I tried to use Get waveform components thinking I can extract amplitude values and do the math.. but the data from DAQ express is dynamic type and the other takes only waveform data... I'm confused using the (from dynamic ) data conversion in signal manipulation palette...

 

I thought this should be simple.. but somehow, It seems I'm missing something..

 

Thanks for any help

0 Kudos
Message 1 of 9
(4,580 Views)

Hi Palkin,

 

Did you try to use Convert from Dynamic Data function in Signal manipulate palette? Just right click on your express vi, you will find the signal manipulate panel.

 

Convert your signal to DBL, or waveform scalr/1D array.

 

Then you can apply your math as regular.

 

now do you see how  adherent the forum is?  :smileywink:

Message Edited by Vsh on 11-09-2009 01:16 AM
Message 2 of 9
(4,571 Views)

Or just convert the express vi to a simple vi, (right click on express vi>>Open front panel, select convert). Delete the function 1D Waveform to Signal at the out put of DAQMx read.vi. Pass the 1D waveform as your output. 

0 Kudos
Message 3 of 9
(4,568 Views)

Thanks Vsh..for replying...Using the "convert from dynamic data" atlease gets me the Y value to compute resultant....

 

I'm confused with the "resulting data types" in the properties of the tool.

I want to compute the time during which the amplitude of the signal is above a threshold level. The way I'm thinking is a 2-D array 1 column is time and other is amplitude and by array operations I can compute the required..However I'm unable to implement this simple thing...

 

 

 

indeed I have no doubt that his forum is great.. I myself have refferred this forum numerous times..just not been able to get answers to my questions..

0 Kudos
Message 4 of 9
(4,565 Views)

Hi Palkin,

 

Resulting datatypes are the datatypes to your requirement. You can use 1D array of waveform. each index in this array corresponds to each channel data. For three channel data, you will have 3 elements in 1D array of waveform. Each elemtn contains again array of Y, which are multiple samples of a single channel

 

You can think of using a for loop at the output, auto index the waveform array, extract Y elements and find the peaks for each signal. 

 

You can just use Threshold Peak Detector.vi to detect the peak values of an 1D DBL array. 

Message Edited by Vsh on 11-09-2009 02:02 AM
0 Kudos
Message 5 of 9
(4,555 Views)

This actually turned out to be simpler than i thought..Thanks to srikrishnaNF...I started using his suggested way and found that 'Read from measurement file' doesn't need a while loop!! it reads the whole file in one shot...All I had to do is search the array of Y for value 150 twice and then multiply the indices with dt..attached is the modified version..

 

thankyou all...

0 Kudos
Message 6 of 9
(4,498 Views)
Vsh, the threshold peak detector only gives -quote from help "Indices contains the beginning index of all valid peaks" So i could get the begining point where the waveform crossed the 150 value but it does not recod when the peak comes down below 150..
0 Kudos
Message 7 of 9
(4,496 Views)

Vsh, the threshold peak detector only gives -quote from help "Indices contains the beginning index of all valid peaks" So i could get the begining point where the waveform crossed the 150 value but it does not recod when the peak comes down below 150..

 

thank you all

0 Kudos
Message 8 of 9
(4,496 Views)

Hi palkin,

 

just a note for your "solution":

Usually it's a bad idea to compare floats for equality (because of limited resolution/accuracy) as you do with using "search array" function. It may work with your data, but in general it's a bad idea... (There are big threads on this topic!)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 9 of 9
(4,476 Views)