From b998d3b78f84b2eedb34bc0a2d5ceaf43e2462a7 Mon Sep 17 00:00:00 2001 From: Silvano Seva Date: Mon, 9 May 2022 21:29:52 +0200 Subject: [PATCH] Modified time constant of DC removal high-pass filter to avoid a too high cut-off frequency when run with at fast sample rates --- openrtx/src/core/dsp.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openrtx/src/core/dsp.cpp b/openrtx/src/core/dsp.cpp index d261bbf2..bb29a9b1 100644 --- a/openrtx/src/core/dsp.cpp +++ b/openrtx/src/core/dsp.cpp @@ -74,9 +74,9 @@ void dsp_dcRemoval(filter_state_t *state, audio_sample_t *buffer, size_t length) { /* * Removal of DC component performed using an high-pass filter with - * transfer function G(z) = (z - 1)/(z - 0.99). + * transfer function G(z) = (z - 1)/(z - 0.999). * Recursive implementation of the filter is: - * y(k) = u(k) - u(k-1) + 0.99*y(k-1) + * y(k) = u(k) - u(k-1) + 0.999*y(k-1) */ if(length < 2) return; @@ -87,7 +87,7 @@ void dsp_dcRemoval(filter_state_t *state, audio_sample_t *buffer, size_t length) state->initialised = true; } - static constexpr float alpha = 0.99f; + static constexpr float alpha = 0.999f; for(size_t i = 1; i < length; i++) {