LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Mean Average

Hello,
I use a while loop to read data with the AI Read VI. I'd like to calculate
the mean average of a certain number of samples during acquisition. I have
not been able to figure out, how can I continioulsy put a number of samples
into an array, so that the first sample that inserts into the array will be
the last that will be overwritten by the following samples.
Are there are any ideas?

Thanks in advance,
M.
0 Kudos
Message 1 of 3
(2,668 Views)
Sorry about the previous message,
I meant moving average not mean average.

M.
"News" wrote in message
news:9hidd5$10f$1@ulysses.noc.ntua.gr...
> Hello,
> I use a while loop to read data with the AI Read VI. I'd like to calculate
> the mean average of a certain number of samples during acquisition. I have
> not been able to figure out, how can I continioulsy put a number of
samples
> into an array, so that the first sample that inserts into the array will
be
> the last that will be overwritten by the following samples.
> Are there are any ideas?
>
> Thanks in advance,
> M.
>
>
0 Kudos
Message 2 of 3
(2,668 Views)
I think what you need to do is create a FIFO buffer using shift registers and the "Rotate 1D Array" function found in the array pallete. What you do is rotate the last element to the begining of the array and then using "Replace Array Subset" put your new reading at index 0.

See if the attached example helps you out!

Brian
0 Kudos
Message 3 of 3
(2,668 Views)