40 #include <matrix/math.hpp> 51 set_cutoff_frequency(sample_freq, cutoff_freq);
55 void set_cutoff_frequency(
float sample_freq,
float cutoff_freq);
62 inline matrix::Vector3f
apply(
const matrix::Vector3f &sample)
65 const matrix::Vector3f delay_element_0{sample - _delay_element_1 *_a1 - _delay_element_2 * _a2};
66 const matrix::Vector3f output{delay_element_0 *_b0 + _delay_element_1 *_b1 + _delay_element_2 * _b2};
68 _delay_element_2 = _delay_element_1;
69 _delay_element_1 = delay_element_0;
75 float get_cutoff_freq()
const {
return _cutoff_freq; }
78 matrix::Vector3f reset(
const matrix::Vector3f &sample);
82 float _cutoff_freq{0.0f};
91 matrix::Vector3f _delay_element_1{0.0f, 0.0f, 0.0f};
92 matrix::Vector3f _delay_element_2{0.0f, 0.0f, 0.0f};
Definition: LowPassFilter2pVector3f.hpp:44
matrix::Vector3f apply(const matrix::Vector3f &sample)
Add a new raw value to the filter.
Definition: LowPassFilter2pVector3f.hpp:62
Definition: LowPassFilter2p.cpp:40