AlphaFilter: set time constant instead of alpha

Then the update function can set the dt at every iteration if needed
This commit is contained in:
bresch
2024-09-30 12:51:09 +02:00
committed by Matthias Grob
parent 37401d6fd1
commit fa5a781e20
4 changed files with 16 additions and 14 deletions
+2 -1
View File
@@ -52,7 +52,8 @@ class AlphaFilter
{
public:
AlphaFilter() = default;
explicit AlphaFilter(float alpha) : _alpha(alpha) {}
explicit AlphaFilter(float sample_interval, float time_constant) { setParameters(sample_interval, time_constant); }
explicit AlphaFilter(float time_constant) : _time_constant(time_constant) {};
~AlphaFilter() = default;