forked from Archive/PX4-Autopilot
LPF: add sample frequency getter
This commit is contained in:
parent
a69e6b92c9
commit
7cb029288a
|
@ -43,6 +43,7 @@ namespace math
|
|||
void LowPassFilter2pVector3f::set_cutoff_frequency(float sample_freq, float cutoff_freq)
|
||||
{
|
||||
_cutoff_freq = cutoff_freq;
|
||||
_sample_freq = sample_freq;
|
||||
|
||||
// reset delay elements on filter change
|
||||
_delay_element_1.zero();
|
||||
|
|
|
@ -74,12 +74,16 @@ public:
|
|||
// Return the cutoff frequency
|
||||
float get_cutoff_freq() const { return _cutoff_freq; }
|
||||
|
||||
// Return the sample frequency
|
||||
float get_sample_freq() const { return _sample_freq; }
|
||||
|
||||
// Reset the filter state to this value
|
||||
matrix::Vector3f reset(const matrix::Vector3f &sample);
|
||||
|
||||
private:
|
||||
|
||||
float _cutoff_freq{0.0f};
|
||||
float _sample_freq{0.0f};
|
||||
|
||||
float _a1{0.0f};
|
||||
float _a2{0.0f};
|
||||
|
|
Loading…
Reference in New Issue