Monado OpenXR Runtime
|
The shared implementation (between vector and scalar versions) of an IIR low-pass filter. More...
#include <tracking/t_lowpass.hpp>
Public Member Functions | |
LowPassIIR (Scalar cutoff_hz, Value const &val) noexcept | |
Constructor. More... | |
void | reset (Value const &val) noexcept |
Reset the filter to just-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 access 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. |
Referenced by xrt_fusion::LowPassIIRVectorFilter< 3, double >::addSample().
|
inlinenoexcept |
Reset the filter to just-created state.
Referenced by xrt_fusion::LowPassIIRVectorFilter< 3, double >::reset().
timepoint_ns xrt_fusion::implementation::LowPassIIR< Value, Scalar >::filter_timestamp_ns {0} |
bool xrt_fusion::implementation::LowPassIIR< Value, Scalar >::initialized {false} |
Value xrt_fusion::implementation::LowPassIIR< Value, Scalar >::state |
Scalar xrt_fusion::implementation::LowPassIIR< Value, Scalar >::time_constant |