LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I obtain average waveform of multiple waveforms

Solved!
Go to solution

Hello, 

I am relatively new to LabVIEW and working on a project where I need to average multiple waveforms and get the average waveform and display it. 

I have attached a screenshot of a part of the VI since the whole VI is too large and cannot run without hardware. 

 

Could someone help me to solve this issue? I tried using a shift register, to get sum of waveforms and dividing by the number of waveforms to get an average waveform. But when I am having trouble initializing waveform at the left shift register. Because dt is set to 1 if I add a constant. But my dt is calculating based on the settings selected by the user so I cant have a constant there. This gives me mismatching waveforms when tried to add them. 

 

I hope you understand what i am trying to say.  Any idea what i can do to solve this? 

0 Kudos
Message 1 of 3
(1,155 Views)
Solution
Accepted by topic author ATX1122

Hi ATX,

 


@ATX1122 wrote:
I tried using a shift register, to get sum of waveforms and dividing by the number of waveforms to get an average waveform. But when I am having trouble initializing waveform at the left shift register. Because dt is set to 1 if I add a constant.

Two options:

  1. When you know the samplerate before entering the loop then you can define the needed waveform constant with a proper dt…
  2. Don't initialize before the loop, but in the 1st iteration! IF first iteration THEN "use current waveform" ELSE "add previous to current waveform"…
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 3
(1,141 Views)

Hi GerdW, 

 

Yes, the second method worked. Thank you so much !!

0 Kudos
Message 3 of 3
(1,100 Views)