RpmControl: remove raw RPM spikes using median filter

This commit is contained in:
bresch
2024-12-19 07:30:25 +01:00
committed by Matthias Grob
parent f687e3d8a4
commit 1b105c937d
2 changed files with 3 additions and 1 deletions
+1 -1
View File
@@ -138,7 +138,7 @@ void RPMCapture::Run()
const float dt = math::constrain((now - _timestamp_last_update) * 1e-6f, 0.01f, 1.f);
_timestamp_last_update = now;
_rpm_filter.setParameters(dt, 0.5f);
_rpm_filter.update(rpm_raw);
_rpm_filter.update(_rpm_median_filter.apply(rpm_raw));
rpm_s rpm{};
rpm.timestamp = now;