From 28edd2bdd7fd4a3762ac8d6fd952f7395dc9337a Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 31 Oct 2024 04:18:27 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- audio_filters/ema_filter.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/audio_filters/ema_filter.py b/audio_filters/ema_filter.py index d368f53ca..e863c5a01 100644 --- a/audio_filters/ema_filter.py +++ b/audio_filters/ema_filter.py @@ -33,8 +33,6 @@ class EMAFilter: self.alpha = alpha self.ema_value = 0.0 - - def apply(self, audio_signal: list[float]) -> np.ndarray: """ Apply the EMA filter to a sequence of @@ -56,11 +54,11 @@ class EMAFilter: """ if not audio_signal: return np.array([]) - + ema_signal: list[float] = [] self.ema_value = audio_signal[0] ema_signal.append(self.ema_value) - + for sample in audio_signal[1:]: if self.ema_value is None: self.ema_value = self.alpha * sample + (1 - self.alpha) * self.ema_value