Go to the documentation of this file.
45 mc_rtc::log::warning(
"Time constant must be at least twice the timestep (Nyquist–Shannon sampling theorem)");
48 cutoffPeriod_ = period;
70 void update(
const T & newValue_hp,
const T & newValue_lp)
72 double x = (cutoffPeriod_ <=
dt_) ? 1. :
dt_ / cutoffPeriod_;
75 eval_lp_ = x * newValue_lp + (1. - x) * eval_lp_;
78 T eval_hp = (newValue_hp - eval_hp_);
81 eval_ = eval_hp + eval_lp_;
84 eval_hp_ = (x * newValue_hp + (1. - x) * eval_hp_);
87 value_hp_ = newValue_hp;
88 value_lp_ = newValue_lp;
94 const T &
eval()
const {
return eval_; }
96 const T &
input_lp()
const {
return value_lp_; }
97 const T &
input_hp()
const {
return value_hp_; }
123 double cutoffPeriod_ = 0.;
const T & input_hp() const
Definition: LowPassCompose.h:97
Definition: LowPassCompose.h:15
void cutoffPeriod(double period)
Definition: LowPassCompose.h:41
Definition: ExponentialMovingAverage.h:14
void update(const T &newValue_hp, const T &newValue_lp)
Definition: LowPassCompose.h:70
void dt(double dt)
Definition: LowPassCompose.h:111
double dt() const
Definition: LowPassCompose.h:102
void warning(Args &&... args)
Definition: logging.h:69
double dt_
Definition: LowPassCompose.h:126
LowPassCompose(double dt, double period=0)
Definition: LowPassCompose.h:24
const T & input_lp() const
Definition: LowPassCompose.h:96
void reset(const T &value)
Definition: LowPassCompose.h:56
double cutoffPeriod() const
Definition: LowPassCompose.h:32
const T & eval() const
Definition: LowPassCompose.h:94