多项式 4 和 6 次的 Savitzky-Golay 平滑滤波器的频率响应具有大致相反符号的波纹。因此,对度数为 d 和 d+2 的两个滤波器的系数进行平均是一种衰减阻带的简单方法:
谁能解释一下大致相反的涟漪——或者它们只是一个幸运的巧合?
(系数是用这个 python 生成的:
def savgol_coef( N=33, d=4 ):
""" Savitzky-Golay filter coefficients
see e.g. Numerical Recipes http://apps.nrbook.com/empanel/index.html?pg=772
d odd, e.g. 5 -> av 4, 6: cutoff between, stopband lower
"""
assert N % 2 == 1, "filter width N must be odd, not %d" % N
if d % 2 == 1:
return (savgol_coef( N, d - 1 )
+ savgol_coef( N, d + 1 )) / 2 # roughly opposite ripples ?
x = np.arange( - (N//2), N//2 + 1. )
A = np.array([ x**k for k in range( d+1 )]) .T # Ajk = basisk( xj )
# print A
return np.linalg.pinv( A )[0]