Quote:
Originally Posted by Tom Line
The only filtering I'm used to is floating average with X number of samples...
I've read up on IIR and FIR, and frankly I haven't found a decent English-language explanation of what they DO.
|
If what you're doing is saving X samples and averaging them, then that
is an FIR filter.
The basic difference between FIR and IIR is that FIR uses only the sampled values, whereas IIR uses the sampled values
and the previous filtered value(s).
A simple example of an IIR filter would be:
new_filtered_value = (new_sample_value + previous_filtered_value) / 2
The above is a special case (where K=1/2) of the
so-called "exponentially weighted" IIR filter (commonly used):
new_filtered_value = (1-K)*new_sample_value + K*previous_filtered_value
... where "K" is a tuning constant which varies from 0 to 1.
when K=0, there is no filtering. as you increase K towards 1, the filtering gets more aggressive.