Help with signal conditioning

robtillaart:

P.S. Question for the C++ wiz. Would:

mav += ((new_data - mav) / 16) ;

work? faster?

You can easily test if this works (depending on the datatypes you can have certain side effects !)
faster? think yes you need to measure 10000 times or so to see diffs.

So would this in effect be acting as a low pass filter on the signal? If so how is the 16 related to the 'corner frequency of the effective filtering action, or is that more a function of how often the statement is executed per time unit?

Lefty