Code: Select all
(1+ω)y[n]=x[n]+ωy[n-1]< /code>
wobei y [n] die Ausgabe bezeichnet und X [n] Eingabe bezeichnet. ist 5: < /p>
import scipy.signal as signal
import matplotlib.pyplot as plt
b = [1]
a = [6, -5]
#loading origin-CH1 0.txt
x = []
with open("origin'-CH1 20.txt", 'r') as f:
for line in f:
x.append(float(line))
y = signal.filtfilt(b=b, a=a, x=x,method='gust')
#writing output to origin-CH1 0.txt
with open("origin'--CH1 0.txt", 'w') as f:
for i in y:
f.write(str(i) + '\n')
#plot
plt.plot(y, label="After Filter", color='red')
plt.plot(x, label="Before Filter", color='blue',alpha=0.5)
plt.show()
< /p>
Sie können sehen ist seltsam.
Ich versuche, den Wert von ω zu senken, aber es scheint nicht ganz nützlich. /> Origin'-ch1 20.txt < /p>