我不明白为什么这个scipy
操作:
from scipy import signal as sg
import numpy as np
fs = 48000
order = 4
# create bandpass from 100Hz to 200Hz:
sos_test = sg.butter(N=order,
Wn=np.array([100, 200]) / (fs / 2),
btype='bandpass',
analog=False,
output='sos')
print(f'sanity check sos-matrix of order {order}:\n{sos_test}')
产生:
sanity check sos-matrix of order 4:
[[ 1.80397952e-09 3.60795904e-09 1.80397952e-09 1.00000000e+00
-1.98583686e+00 9.86289427e-01]
[ 1.00000000e+00 2.00000000e+00 1.00000000e+00 1.00000000e+00
-1.98941516e+00 9.89671541e-01]
[ 1.00000000e+00 -2.00000000e+00 1.00000000e+00 1.00000000e+00
-1.99279291e+00 9.93445454e-01]
[ 1.00000000e+00 -2.00000000e+00 1.00000000e+00 1.00000000e+00
-1.99638455e+00 9.96563613e-01]]
SOS - “二阶部分”,意味着每个 6 个系数的数组的阶数为 2。看着print
告诉我第一个数组是 2 阶,而其余的是 1 阶,这意味着我总共有 5 个阶。sos-matrix 不应该包含其订单大小的一半吗?我希望:
[[b10 b11 b12 a10 a11 a12] # 2nd order
[b20 b21 b22 a20 a21 a22]] # 2nd order
对于 4 阶的 sos 矩阵。