mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-02-17 14:58:10 +00:00
Update ema_filter.py
Corrected the error , now it will run :)
This commit is contained in:
parent
28edd2bdd7
commit
da736cf45a
|
@ -60,9 +60,8 @@ class EMAFilter:
|
|||
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
|
||||
ema_signal.append(self.ema_value)
|
||||
self.ema_value = self.alpha * sample + (1 - self.alpha) * self.ema_value
|
||||
ema_signal.append(self.ema_value)
|
||||
return np.array(ema_signal)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user