def imu_filter_bandpass(x, order = 4, sRate = 148.148148148148, lowcut = 1., highcut = 20.):
""" Forward-backward band-pass filtering (IIR butterworth filter) """
nyq = 0.5 * sRate
low = lowcut/nyq
high = highcut/nyq
b, a = butter(N =order, Wn = [low, high], btype = 'band')
return filtfilt(b=b, a=a, x=x, axis=0, method = 'pad', padtype = 'odd',
padlen = np.minimum(3*len(a)*len(b), x.shape[0]-1))
评论列表
文章目录