mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-11-25 16:51:16 +08:00
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:
1 parent
0d171384b3
commit
0ec3f0d2cb
1 file changed
+1
-1
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user