Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Making signal Mean

Hi,

I am aquiring data in a "while loop" (loop 1)  at a rate of 80 S/s. I want to know the mean voltage from the data at each second. I've try to use a local variable (data) in a "for loop" in a second "while loop" (loop 2) that iterate at each second. I don't know why, it is not working. I've sent an exemple to explain what I am saying.

Thank you
Francois

0 Kudos
Message 1 of 4
(3,151 Views)

Only once in a second you copy one value to the other while.

That is not enough to calculate a mean from.

You should accumulate 80 samples in an array (or add up in a value) and use this to output a mean

You even can output a mean 80 times a second this is called a walking (running) mean.

see attached example

 

the second while uses the point by point mean this helps a lot and gives a good result even when not yet filled

greetings from the Netherlands
0 Kudos
Message 2 of 4
(3,147 Views)
Thank you Albert,

Can you send me a screen shot of your vi, my version of labVIEw is 7.0 and I can't read your program.

Thank you again

Francois

0 Kudos
Message 3 of 4
(3,145 Views)
here is the 7.0 versie
greetings from the Netherlands
0 Kudos
Message 4 of 4
(3,129 Views)