赞
踩
lfilter
可以用于在线数据的滤波filtfilt
用于离线数据,不会有相位差# initial filter param
def init_filter(self, order, cutoff, fs):
wn = 2.0*cutoff/fs
self._b, self._a = sig.butter(order, wn, 'lowpass', analog = False)
self._dss = sig.lfilter_zi(self._b, self._a)
def lfilter_filter(self, f_x, f_y, f_z):
f = [f_x, f_y, f_z]
res = [0,0,0]
for i in range (0,3):
res[i], self._dss[i] = sig.lfilter(self._b, self._a, [f[i]], zi=self._dss[i])
return res[0][0], res[1][0], res[2][0]
init_filter(order=3, cutoff=4, fs=100)
init_filter(order=3, cutoff=6, fs=100)
一些文字:在scipy.signal中应用过滤器:使用lfilter还是filtfilt?
一些代码:scipy中 filtfilt和lfilter 区别
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。