The best way is to take your running average multiply by (Running average-1)
then add your current value and devide the whole thing by your running average...RAnew
= [RAold*(N-1)+new]/N. This way you can dynamically change you running average
size and not have to do any array manipulation. Obviously the running average
is only valid after a number of points have been taken equal to N. The same
is true after a change in N occurs.
neds@javanet.com (Ned Simmons) wrote:
>I'm a new Labview user and am blocked by what seems like a very simple >problem.>>I
want to do some data smoothing using a running average, and need to be >able
to set the number of points to smooth from the panel. All the >examples I've
found use shift registers, and thus the number of samples >is fixe
d by the
number of stages programmed in the shift register. We may >also want to smooth
over large numbers of data points.>>What is an efficient way of doing this?
Most of the simple ideas I've had >seem to run into cyclical problems.>>Thanks,>Ned
Simmons>>>>