A simple class for filtering values. Double exponential smoothing.
Create a new filter.
factor |
A Float. Less is more. |
factor2 |
A Float. Trend smoothing factor. |
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.
How much smoothing of trend.
Perform the smoothing.
Get or set the current value.
Get or set the current trend.