This commit is contained in:
2026-01-24 21:10:50 +01:00
parent 250cdba29b
commit 473eb899a7
11 changed files with 217 additions and 0 deletions

23
IIR_filter.py Normal file
View File

@@ -0,0 +1,23 @@
import numpy as np
import matplotlib.pyplot as plt
import fft
class IIR_1_Order_LP(object):
"""docstring for fft_meas"""
def __init__(self, fs, fc=200):
self.fs = fs
self.fc = fc
self.dt = 1/self.fs
self.RC = 1 / (2*np.pi*self.fc)
self.alpha = self.dt / (self.RC + self.dt)
self.y = 0
def step(self, x):
self.y = self.y + self.alpha * (x - self.y)
return self.y