def imu_filter_lowpass(x, order = 4, sRate = 148.148148148148, highcut = 20.0):
""" Forward-backward band-pass filtering (IIR butterworth filter) """
nyq = 0.5 * sRate
high = highcut/nyq
b, a = butter(N =order, Wn = high, btype = 'low')
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))
评论列表
文章目录