The shared implementation (between vector and scalar versions) of an IIR low-pass filter.
More...
#include <tracking/t_lowpass.hpp>
|
| 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...
|
|
|
Value | state |
|
Scalar | time_constant |
|
bool | initialized {false} |
|
timepoint_ns | filter_timestamp_ns {0} |
|
template<typename Value, typename Scalar>
struct xrt_fusion::implementation::LowPassIIR< Value, Scalar >
The shared implementation (between vector and scalar versions) of an IIR low-pass filter.
◆ LowPassIIR()
template<typename Value, typename Scalar>
Constructor.
- Parameters
-
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. |
◆ addSample()
template<typename Value, typename Scalar>
Filter a sample, with an optional weight.
- Parameters
-
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. |
- Todo:
- limit max dt?
◆ reset()
template<typename Value, typename Scalar>
The documentation for this struct was generated from the following file: