31 #include <Eigen/Dense> 41 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
54 : average_(dt, timeConstant, initValue)
56 filteredValue_ = initValue;
57 rawValue_ = initValue;
65 void update(
const Eigen::Vector3d & value)
68 filteredValue_ = value - average_.
eval();
75 const Eigen::Vector3d &
eval()
const 77 return filteredValue_;
83 const Eigen::Vector3d &
raw()
const 94 filteredValue_.setZero();
117 Eigen::Vector3d filteredValue_;
118 Eigen::Vector3d rawValue_;
Exponential Moving Average.
double timeConstant() const
Get time constant of the filter.
const Eigen::Vector3d & raw() const
Get raw value of input signal.
EIGEN_MAKE_ALIGNED_OPERATOR_NEW StationaryOffsetFilter(double dt, double timeConstant, const Eigen::Vector3d &initValue=Eigen::Vector3d::Zero())
Constructor.
const Eigen::Vector3d & eval() const
Evaluate the smoothed statistic.
void append(const Eigen::Vector3d &value)
Append a new reading to the series.
Remove stationary offset from an input signal.
void setZero()
Reset everything to zero.
void setZero()
Reset average to zero.
void update(const Eigen::Vector3d &value)
Update input signal value.
void timeConstant(double T)
Update time constant.
const Eigen::Vector3d & eval() const
Get output value where the stationary offset has been filtered.
Utility functions and classes.
double timeConstant() const
Get time constant of the filter.