def emg_filter_comb(x):
""" Comb filtering at 50 Hz, for 2KHz sampling frequency.
Coefficients are computed with MATLAB."""
b = np.zeros(41)
a = np.zeros(41)
b[0] = 0.941160767899653
b[-1] = -0.941160767899653
a[0] = 1.
a[-1] = -0.882321535799305
return filtfilt(b=b, a=a, x=x, axis=0, method = 'pad', padtype = 'odd',
padlen = np.minimum(3*np.maximum(len(a),len(b)), x.shape[0]-1))
评论列表
文章目录