Quote:
Originally Posted by GuyM142
do you have some information about filters which I can start with?
|
Here's a very simple low-pass IIR filter:
Code:
filtered_value = a*filtered_value + (1-a)*new_value
"new_value" is the new reading from the accelerometer.
"filtered_value" is the filtered version of the accelerometer reading.
"a" is a tuning constant which tunes the strength of the filter. "a" has a range of 0 to 1.
When a=0, there's no filtering -- the filtered_value always equals the accelerometer reading.
As "a" approaches 1, the filtering gets more aggressive -- the filtered_value has less noise (but more phase lag).