Monado OpenXR Runtime
|
The shared implementation (between vector and scalar versions) of an integer IIR/exponential low-pass filter. More...
#include <math/m_lowpass_integer.hpp>
Public Member Functions | |
IntegerLowPassIIR (math::Rational< Scalar > alpha_, Value const &val) | |
Constructor. More... | |
void | reset (Value const &val) noexcept |
Reset the filter to newly-created state. More... | |
void | addSample (Value const &sample, math::Rational< Scalar > weight=math::Rational< Scalar >::simplestUnity()) |
Filter a sample, with an optional weight. More... | |
Data Fields | |
Value | state |
math::Rational< Scalar > | alpha |
bool | initialized {false} |
The shared implementation (between vector and scalar versions) of an integer IIR/exponential low-pass filter.
|
inlineexplicit |
Constructor.
alpha_ | The alpha value used to blend between new input and existing state. Larger values mean more influence from new input. alpha_.isBetweenZeroAndOne() must be true. |
val | The value to initialize the filter with. Does not affect the filter itself: only seen if you get the state before initializing the filter with the first sample. |
|
inline |
Filter a sample, with an optional weight.
sample | The value to filter |
weight | An optional value between 0 and 1. The smaller this value, the less the current sample influences the filter state. For the first call, this is always assumed to be 1. |
|
inlinenoexcept |
Reset the filter to newly-created state.
Referenced by xrt::auxiliary::math::IntegerLowPassIIRFilter< Scalar >::reset().