A simple infinite impulse response low pass filter for smoothing control or audio signals.
More...
template<class T>
class Smooth< T >
A simple infinite impulse response low pass filter for smoothing control or audio signals.
This algorithm comes from http://en.wikipedia.org/wiki/Low-pass_filter: y[i] := y[i-1] + α * (x[i] - y[i-1]), translated as out = last_out + a * (in - last_out). It's not calibrated to any real-world update rate, so if you use it at MOZZI_CONTROL_RATE and you change MOZZI_CONTROL_RATE, you'll need to adjust the smoothness value to suit.
- Template Parameters
-
T | the type of numbers being smoothed. Watch out for numbers overflowing the internal calculations. Some experimentation is recommended. |
- Note
- Timing: ~5us for 16 bit types, ~1us for 8 bit types.
Definition at line 35 of file Smooth.h.