I am trying to extract filter coefficients for a bandpass, using the "scipy.signal.iirfilter" function:
b, a = filt = iirfilter(
N=2,
btype='bandpass',
ftype='cheby2',
Wn=np.array([3000, 4850]) / (12400 / 2),
rs=30,
output='ba'
)
b, a
Out[10]:
(array([0.04008421, 0.04822953, 0.04776774, 0.04822953, 0.04008421]),
array([1. , 1.66028928, 2.34267679, 1.39001415, 0.70301997]))
Seems like the filter order is twice larger than expected. A similar task using Matlab's "designfilt" performs with the expected number of coefficients. What I am missing? is the filter order a fluid definition?
For lowpass, the number of the coefficients is as expected...