LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

finding running average of y component of waveform data

I am sampling a waveform continuously using a while loop. The while loop runs for 40 seconds. How can I find out the average of the y component of the waveform for that 40 second period of time?

The orange line coming out of the y component of the "get waveform components" function is thick. I tried to use the "mean" function inside the while loop, but that takes into account only one point for the average. I need to create an array of all 40 seconds worth of points and then find the average of those values. But can I use the "mean" function, does it belong inside or outside the while loop, do I have to build an array? Can someone please help clear this up?

Thanks!
0 Kudos
Message 1 of 2
(3,052 Views)
Hi,
if you need to calculate mean value
inside the while loop then you have to use
FIFO buffer. See attached file, for example (LabVIEW 6.0).
Hope it help you,
Mike

VSECorp wrote:

> I am sampling a waveform continuously using a while loop. The while
> loop runs for 40 seconds. How can I find out the average of the y
> component of the waveform for that 40 second period of time?
>
> The orange line coming out of the y component of the "get waveform
> components" function is thick. I tried to use the "mean" function
> inside the while loop, but that takes into account only one point for
> the average. I need to create an array of all 40 seconds worth of
> points and then find the average of those values. But can I use the
> "mean" function, does it belon
g inside or outside the while loop, do I
> have to build an array? Can someone please help clear this up?
>
> Thanks!
0 Kudos
Message 2 of 2
(3,052 Views)