A simple class for filtering values. Single exponential smoothing.
Similar to Lag. See RedSlide for another implementation.
Create a new filter.
factor |
A Float. Less is more. |
initVal |
Initial value. |
Note that a factor of 0.0
will 'freeze' the filter, and factors above 1.0
will be unstable - overshoot, ring and even start to oscillate.
How much smoothing.
Perform the smoothing.
Get or set the current value.