17 #ifndef URG_STAMPED_FIRST_ORDER_FILTER_H 18 #define URG_STAMPED_FIRST_ORDER_FILTER_H 22 template <
typename FLT>
34 k_[0] = k_[1] = k_[3] = 0;
39 x_ = k_[0] * in + k_[1] *
x_;
40 const auto out = k_[2] * in + k_[3] *
x_;
46 template <
typename FLT>
52 this->
k_[3] = -1 / (1.0 + 2 * time_constant);
53 this->
k_[2] = -this->
k_[3];
54 this->
k_[1] = (1.0 - 2 * time_constant) * this->
k_[3];
55 this->
k_[0] = -this->
k_[1] - 1.0;
59 template <
typename FLT>
65 this->
k_[3] = -1 / (1.0 + 2 * time_constant);
66 this->
k_[2] = -this->
k_[3] * 2 * time_constant;
67 this->
k_[1] = (1.0 - 2 * time_constant) * this->
k_[3];
68 this->
k_[0] = 2 * time_constant * (-this->
k_[1] + 1.0);
73 #endif // URG_STAMPED_FIRST_ORDER_FILTER_H FLT update(const FLT &in)
FirstOrderHPF(const FLT &time_constant)
FirstOrderLPF(const FLT &time_constant)