diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2021-11-04 19:05:34 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2021-11-04 19:06:25 +0100 |
commit | 35b46547cb0be698d0f3a2c17437bad2a5067789 (patch) | |
tree | e44a0bb7c780a90b93b9892482044a04a949908d /tracker-pt/point-filter.cpp | |
parent | c99692bf76ccc6798181ec13547f45f1f8430b78 (diff) |
tracker/pt: add point filter gain limiter
Diffstat (limited to 'tracker-pt/point-filter.cpp')
-rw-r--r-- | tracker-pt/point-filter.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tracker-pt/point-filter.cpp b/tracker-pt/point-filter.cpp index 652c099e..49e82afb 100644 --- a/tracker-pt/point-filter.cpp +++ b/tracker-pt/point-filter.cpp @@ -30,8 +30,8 @@ const PointOrder& point_filter::operator()(const PointOrder& input) return state_; } - constexpr f E = (f)1.75; - constexpr f max = .25; + constexpr auto E = (f)1.75; + const f limit = (f)*s.point_filter_limit; const f C = progn( constexpr int A = 1'000'000; double K = *s.point_filter_coefficient; @@ -58,7 +58,7 @@ const PointOrder& point_filter::operator()(const PointOrder& input) for (unsigned i = 0; i < 3; i++) { - f x = std::clamp(delta, (f)0, max); + f x = std::clamp(delta, (f)0, limit); state_[i] += x*(input[i] - state_[i]); } |