LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

sample average

Hi looser,

at the moment only the y-values are averaged.
It's up to you to do the same for the x-values Smiley Wink
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 21 of 29
(1,589 Views)

Oh my god... I think I m gonna spend all my ph.d on this program:( Besides, i dont know how to insert it into my main vi? GerdW could you please help me to insert that alghoritm that u described into my main vi. I ll dedicate the first paper in which those datas ll appear to u:)

primitevely, i attach my main vi below!

0 Kudos
Message 22 of 29
(1,584 Views)
sorry forgot to attach
0 Kudos
Message 23 of 29
(1,582 Views)

okj. I have tried to check it. But the average value is always is the new updated element of array that goes in to mean function.

could  you have alook to vi please?

0 Kudos
Message 24 of 29
(1,575 Views)
Hi looser,

please check the attachment. I made some changes (cosmetics!) and added comments...
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 25 of 29
(1,568 Views)
Thanks GerdW..
Exactly what i did... Where can I  probe to x values whose y values are averaged? What i think is that if i can probe the x values whose corresponding y values gives averaged y value, i can also average the x values which results in a single averaged x value.
so at the end

averaged x               averaged y.


0 Kudos
Message 26 of 29
(1,562 Views)
Hey Guys,

I tried editing the MeanofWaves.vi to my particular use but it's not working out as expected. Here is my particular task:

I need to write a program where you specify the number of points required, they will be aquired as (x,y) data from a device but we can represent the Y as a random number. so for example we take 40 points, plot these 40 points, then take 40 more points and average them with the previous 40 points. I also need to specify the number of runs. I want two graphs to appear, one is the graph of the current run and the second is the average of all the previous.

My logic was as follows:

Take 40 points
Graph them and at the same time store them temporarily
Average them and Have them appear on the average graph
Take the next 40 points
Store them temporarily and average them with the points from the average graph to get the new mean values
Graph the new average chart and take the next 40 poitns

etc...

I think my logic for this program is okay but my lack of labview skills is keeping me from getting it. Please help. Thanks.

-Newbie
0 Kudos
Message 27 of 29
(1,550 Views)
Hi New..

I want to do smoething similar.I attach the vi which has been suggested.
0 Kudos
Message 28 of 29
(1,536 Views)
Unfortunately, your logic seems to be wrong to me:smiley surprised:

If you can store all single scans in memory then the straight forward sumation of the scans and dividing by the number of scans gives you the average. If you don't want to store all scans in memory then you can still average but not in the way you have tried it. Imagine an ideal case were you have already aquired so many scans that you have a very smooth signals. Now if you add a single noisy scan you will again have a noisy average if the weight is 1/2 for both arrays.With proper weighting you can still average but you have to be careful with rounding errors. The following formula should be ok:

avg[N+1] = N*avg[N]/(N+1) + X[N+1]/(N+1)




My logic was as follows:

Take 40 points
Graph them and at the same time store them temporarily
Average them and Have them appear on the average graph
Take the next 40 points
Store them temporarily and average them with the points from the average graph to get the new mean values
Graph the new average chart and take the next 40 poitns

etc...

I think my logic for this program is okay but my lack of labview skills is keeping me from getting it. Please help. Thanks.

-Newbie



0 Kudos
Message 29 of 29
(1,527 Views)