mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-04-26 07:33:35 +00:00
Update ema_filter.py
This commit is contained in:
parent
2e1193507b
commit
435591475d
@ -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:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user