from cProfile import label
import pandas as pd
import matplotlib.pyplot as plt
from scipy import signal
data = pd.read_table('test.txt')
wn = 2*2/1000 # 截止频率2Hz,采样频率1000Hz
b,a = signal.butter(4,wn,'low')
filtedData = signal.filtfilt(b,a,data.iloc[:,3].values)
plt.figure('current')
plt.plot(data.iloc[:,3].values,label='滤波前')
plt.plot(filtedData,label='滤波后')
plt.show()
效果如下:
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)