This is a follow-up question of How do I apply a Chebishev filter? I designed a filter in Scipy:
import scipy.signal as signal
fs = 240
signal.cheby1(8, 0.05, [0.1/(fs/2), 10.0/(fs/2)],btype='band', analog=0, output='ba')
/usr/lib/python2.7/dist-packages/scipy/signal/filter_design.py:268: BadCoefficients: Badly conditioned filter coefficients (numerator): the results may be meaningless
"results may be meaningless", BadCoefficients)
(array([ -3.64482771e-08, -3.98755170e-23, 1.27568970e-07,
3.98755170e-23, -2.55137939e-07, -2.09346464e-22,
3.18922424e-07, 1.48536301e-21, -2.55137939e-07,
-2.79128619e-22, 1.27568970e-07, -3.98755170e-23,
-3.64482771e-08, 0.00000000e+00, 4.55603463e-09]),
array([ 1.00000000e+00, -1.53699059e+01, 1.10865293e+02,
-4.98175837e+02, 1.56087517e+03, -3.61582779e+03,
6.40630344e+03, -8.85525782e+03, 9.65121227e+03,
-8.32140081e+03, 5.65721533e+03, -3.00062986e+03,
1.21729735e+03, -3.65135628e+02, 7.63720484e+01,
-9.95191544e+00, 6.08648759e-01]))
The first array should contain the b coefficients, the second array should contain the b coefficients of the filter.
The result of this filter is oscillating and seems to be wrong. Hilmar wrote that this filter "is a numerically challenging filter, since you have poles very very close to the unit circle" and I must "break the filter down into second order sections and apply those sequentially".
Since I have no background in signal processing and found nothing about that anywhere I wanted to ask here how I can do that.
edit: The zero-pole-gain ('zpk') representation is
signal.cheby1(8, 0.05, [0.1/(fs/2), 10.0/(fs/2)],btype='band', analog=0, output='zpk')
/usr/lib/python2.7/dist-packages/scipy/signal/filter_design.py:268: BadCoefficients: Badly conditioned filter coefficients (numerator): the results may be meaningless
"results may be meaningless", BadCoefficients)
(array([ 0.95041122+0.63504447j, 0.95041122-0.63504447j,
0.77688699+0.32179713j, 0.77688699-0.32179713j,
0.72152481+0.14352021j, 0.72152481-0.14352021j,
0.70710678+0.j , -0.95041122+0.63504447j,
-0.95041122-0.63504447j, -0.77688699+0.32179713j,
-0.77688699-0.32179713j, -0.72152481+0.14352021j,
-0.72152481-0.14352021j, -0.70710678+0.j ]), array([ 1.19049737+0.j , 1.16303520+0.1084667j ,
1.16303520-0.1084667j , 1.08874047+0.19530989j,
1.08874047-0.19530989j, 0.99220878+0.25677213j,
0.99220878-0.25677213j, 0.93226615+0.2765259j ,
0.93226615-0.2765259j , 0.87852354+0.22994371j,
0.87852354-0.22994371j, 0.83333317+0.15993377j,
0.83333317-0.15993377j, 0.80434290+0.08130729j,
0.80434290-0.08130729j, 0.79450811+0.j ]), -3.6448277062436296e-08)