LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Averaging array contents

Hi altenbach,

thankyou for clearing my silly doubt .. i knew i had missed somethin Smiley Happy

best regards

mer

0 Kudos
Message 21 of 26
(1,103 Views)
Mean.vi from Mathematics->Probability and Statistics pallete works on waveforms as well, you can adapt to use it rather than manually dividing.
________________________________________________________

Use the rating system, otherwise its useless; and please don't forget to tip your waiters!
using LV 2010 SP 1, Windows 7
________________________________________________________
0 Kudos
Message 22 of 26
(1,095 Views)


TWGomez wrote:
Mean.vi from Mathematics->Probability and Statistics pallete works on waveforms as well, you can adapt to use it rather than manually dividing.


Not quite the same here.

Mean takes the average of all points in a single waveform to procude a single number.

Here we want to average several waveforms to produce a waveform that is the average of all the original ones. 🙂

0 Kudos
Message 23 of 26
(1,091 Views)
I was illustrating that you can use the mean function in place of all you division stuff...not providing a replacement example...
just use the mean with the waveform created in each loop and autoindex the value out to create a new waveform with the averaged values.
 
See attached.
Or instead of averaging in the loop do it outside the loop with another For loop, like your example.
________________________________________________________

Use the rating system, otherwise its useless; and please don't forget to tip your waiters!
using LV 2010 SP 1, Windows 7
________________________________________________________
0 Kudos
Message 24 of 26
(1,085 Views)
Hi Gomez,

nope...

We don't want to have means of each waveform - we want to average all the waveform...

To picturize this: think of a 2D array - you calc the mean of each column, we calc the average of each row...
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 25 of 26
(1,075 Views)
Hi  ,
 
i had another difficulty regarding this ...Smiley Sad
 
actually each waveform entering this ' waveform averaging' VI  is actually an EEG reponse to each sound click we present to the subject.
so i need each click to trigger or start the recording. Also this recording should stop before the next click.
Thus if i give 1000 clicks, the averaging VI must produce the average of the 1000 waveforms.
 
the clicks are given as a square waveform , frequency = 10.1 Hz ,  TIMING mode: simulate acquisition timing , samples per second =  44000 , no : of samples = 204000 (or a figure as high)
i used the simulate signal  and play waveform blocks.
 
for the above problem, i tried to use the trigger and gate block... i thought of connecting the simulate waveform block to the waveform averaging vi using the trigger block...but dont seem to reach anything useful ...Smiley Sad
 
 
 
thankyou
best regards
MerSmiley Happy
0 Kudos
Message 26 of 26
(1,072 Views)