LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Waveform addition with add block - element wise or interpolated or ...?

Solved!
Go to solution

Hello

 

I see the addition block is nicely overloaded to superimpose waveforms and I would like to know how it operates. Specifically I want to know if it using matrix addition (i.e. simply adding the elements of each waveform) OR is it interpolating one of the waveforms and resampling at the time points corresponding to the other OR some other method.

 

I know the sampling interval (dt) must be the same for both waveforms being added, so I suspect it is using matrix addition, but am not sure.

 

To add some context, I'm using this to add two waveforms of sampled data of a sine wave up to 100kHz. At the fastest sampling my DAQ can operate the difference in starting times (t0) of the two waveforms is a significant portion of the period. At this point I think the simple matrix addition approach will not work.

 

Thanks for any insight you can give. Cheers

-ron

 

0 Kudos
Message 1 of 5
(2,942 Views)

Hi Ron,

 

You are correct - the waveform data type carries the data, start time, and delta t of the waveform and thus when you add them, the data points of the two waveforms are added together. More information on this data type can be found here.

 

I'm not quite sure if I understand your application correctly. Can you clarify? Are you trying to add two different waveforms of different sizes? Thanks, 

Julianne K
Systems Engineer, Embedded Systems
Certified LabVIEW Architect, Certified LabVIEW Embedded Systems Developer
National Instruments
0 Kudos
Message 2 of 5
(2,928 Views)

Thanks for your response.

 

I am adding two waveforms that have different starting times. The waveforms are measured sine wave data at up to 100kHz. My DAQ can measure at up to 250kHz (just over two samples / period for the 100kHz input wave). While the time interval is the same for both waves (dt_2 = dt_1) the starting time is not (i.e. t0_2 = t0_1 + X). Adding the elements of the measured data vectors results in adding measurements taken at different times. At the faster rates X is a larger portion of the period of the sinewave and the error is magnified.

 

Is there a VI that can reconstruct a sine wave from waveform data and resample at different time points?

 

Thanks again for your help. Cheers

-ron

0 Kudos
Message 3 of 5
(2,924 Views)
Solution
Accepted by RonECE

Hi Ron, 

 

I do not believe there is a VI that does this for you; however, it should not be too difficult to program this yourself. There is a subvi called "Get Waveform Components" which allows you to access the t0, dt and data array (Y) variables of the waveform data type. You can subtract the two starting times to find the difference between the two waveforms (DAQ reads place a timestamp on the data). Then, you can complete array operations to create an offset in the data. Some other useful subvis are  "Get Waveform Subset" or "Index Waveform Array", which you may want to use depending on how you want to set up your program. Let me know if you need further assistance with programming this. Best of luck!

Julianne K
Systems Engineer, Embedded Systems
Certified LabVIEW Architect, Certified LabVIEW Embedded Systems Developer
National Instruments
0 Kudos
Message 4 of 5
(2,910 Views)

Great, I'll give that a try. Thanks for your help, cheers

 

0 Kudos
Message 5 of 5
(2,906 Views)