47 mc_rtc::log::warning(
"Time constant must be at least twice the timestep (Nyquist–Shannon sampling theorem)");
50 cutoffPeriod_ = period;
58 void reset(
const T & value) { eval_ = value; }
67 double x = (cutoffPeriod_ <=
dt_) ? 1. :
dt_ / cutoffPeriod_;
68 eval_ = x * newValue + (1. - x) * eval_;
74 const T &
eval()
const {
return eval_; }
79 double dt()
const {
return dt_; }
96 double cutoffPeriod_ = 0.;
Definition: ExponentialMovingAverage.h:15
void warning(Args &&... args)
Definition: logging.h:69
void update(const T &newValue)
Definition: LowPass.h:65
double dt() const
Definition: LowPass.h:79
double dt_
Definition: LowPass.h:99
const T & eval() const
Definition: LowPass.h:74
void cutoffPeriod(double period)
Definition: LowPass.h:43
double cutoffPeriod() const
Definition: LowPass.h:34
void dt(double dt)
Definition: LowPass.h:88
LowPass(double dt, double period=0)
Definition: LowPass.h:31
void reset(const T &value)
Definition: LowPass.h:58