Monado OpenXR Runtime
|
A very simple low-pass filter, using a "one-pole infinite impulse response" design (one-pole IIR). More...
#include <tracking/t_lowpass_vector.hpp>
Public Types | |
using | Vector = Eigen::Matrix< Scalar, Dim, 1 > |
Public Member Functions | |
LowPassIIRVectorFilter (Scalar cutoff_hz) noexcept | |
Constructor. More... | |
void | reset () noexcept |
Reset the filter to just-created state. More... | |
void | addSample (Vector const &sample, std::uint64_t timestamp_ns, Scalar weight=1) |
Filter a sample, with an optional weight. More... | |
Vector const & | getState () const noexcept |
Access the filtered value. More... | |
std::uint64_t | getTimestampNs () const noexcept |
Access the time of last update. More... | |
bool | isInitialized () const noexcept |
Access whether we have initialized state. More... | |
A very simple low-pass filter, using a "one-pole infinite impulse response" design (one-pole IIR).
Configurable in dimension and scalar type.
using xrt_fusion::LowPassIIRVectorFilter< Dim, Scalar >::Vector = Eigen::Matrix<Scalar, Dim, 1> |
|
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. |
|
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 |
Access the filtered value.
|
inlinenoexcept |
Access the time of last update.
|
inlinenoexcept |
Access whether we have initialized state.
|
inlinenoexcept |
Reset the filter to just-created state.