LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

filter design on data

Solved!
Go to solution

Hey, guys

 

I meet some problems when I desgin a data filter

 

something like when the measured value was 3,7,2,9,4,6......etc. What I wanna to display is the value of  (3+7+2+9)/4, (7+2+9+4)/4, (2+9+4+6)/4.......etc

 

like calc an average value on every four numbers, then moved on, do that again

 

Hope anyone can give me some ideas to achieve this.

0 Kudos
Message 1 of 4
(2,488 Views)

or 

How to make the 1st, 2nd, 3rd and 4th value go into an array(size 4), then added them and divided by 4

Then, when the 5th value come into array, it will replace the 1st value and do the same function

when the 6th value come into array, it will replace the 2nd value and do the same function as well

And 7th will replace the 3rd value, 8th replace the 4th value....etc.

0 Kudos
Message 2 of 4
(2,472 Views)
Solution
Accepted by topic author LeoLiu

Look under the Signal Processing\Point by Point\Probability & Statistics PtByPt.  There you will find a function which calculates a moving average for the last X samples fed into the function, where X is adjustable (you can set it to 4).Mean PTBYPT.png

Message 3 of 4
(2,455 Views)

If you always want to average 4 points you can do it with a shift register expanded to 4 left terminals.

 

Lynn

 

Moving Average.png

0 Kudos
Message 4 of 4
(2,427 Views)