forked from Archive/PX4-Autopilot
mathlib: LowPassFilter2p update cutoff freq min to match NotchFilter
- numerically the cutoff frequency not being smaller than 1% of the sample frequency is probably a better choice, but we're mostly filtering 16 bit data now stored in 32 bit float
This commit is contained in:
parent
0d171384b3
commit
0ec3f0d2cb
|
@ -71,7 +71,7 @@ public:
|
|||
_delay_element_1 = {};
|
||||
_delay_element_2 = {};
|
||||
|
||||
_cutoff_freq = math::constrain(cutoff_freq, 5.f, sample_freq / 2); // TODO: min based on actual numerical limit
|
||||
_cutoff_freq = math::max(cutoff_freq, sample_freq * 0.001f);
|
||||
_sample_freq = sample_freq;
|
||||
|
||||
const float fr = _sample_freq / _cutoff_freq;
|
||||
|
|
Loading…
Reference in New Issue