Update ema_filter.py

This commit is contained in:
Shreya 2024-10-31 01:23:36 +05:30 committed by GitHub
parent 2e1193507b
commit 435591475d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -5,7 +5,7 @@ https://en.wikipedia.org/wiki/Moving_average
""" """
import numpy as np import numpy as np
from typing import List from typing import Any
class EMAFilter: class EMAFilter:
@ -34,13 +34,13 @@ class EMAFilter:
self.alpha = alpha self.alpha = alpha
self.ema_value = None self.ema_value = None
def apply(self, audio_signal: List[float]) -> np.ndarray: def apply(self, audio_signal: list[float]) -> np.ndarray:
""" """
Apply the EMA filter to a sequence of Apply the EMA filter to a sequence of
audio signal values. audio signal values.
Parameters: Parameters:
audio_signal (List[float]): List of numerical values audio_signal (list[float]): List of numerical values
representing the audio signal. representing the audio signal.
Returns: Returns: