|
Monado OpenXR Runtime
|
The shared implementation (between vector and scalar versions) of an IIR low-pass filter. More...
#include <math/m_lowpass_float.hpp>

Public Member Functions | |
| LowPassIIR (Scalar cutoff_hz, Value const &val) noexcept | |
| Constructor. More... | |
| void | reset (Value const &val) noexcept |
| Reset the filter to newly-created state. More... | |
| void | addSample (Value const &sample, timepoint_ns timestamp_ns, Scalar weight=1) |
| Filter a sample, with an optional weight. More... | |
Data Fields | |
| Value | state |
| Scalar | time_constant |
| bool | initialized {false} |
| timepoint_ns | filter_timestamp_ns {0} |
The shared implementation (between vector and scalar versions) of an IIR low-pass filter.
|
inlineexplicitnoexcept |
Constructor.
| cutoff_hz | A cutoff frequency in Hertz: signal changes much lower in frequency will be passed through the filter, while signal changes much higher in frequency will be blocked. |
| val | The value to initialize the filter with. Does not affect the filter itself: only seen if you get state before initializing the filter with the first sample. |
|
inline |
Filter a sample, with an optional weight.
| sample | The value to filter |
| timestamp_ns | The time that this sample was measured. |
| 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::LowPassIIRFilter< Scalar >::reset(), and xrt::auxiliary::math::LowPassIIRVectorFilter< Dim, Scalar >::reset().