Closed todork closed 2 years ago
Hi @todork do you mind evaluating the results over a signal or their impulse response. Changing to transfer function of such filters is desperately ill-conditioned problems and also I wouldn't say we have the most robust conversion algorithm in place. So if you can avoid working in TF form anyways but missing 3 zeros should definitely make a difference if they are indeed inherently different.
Hi @ilayn thank you for you prompt reply.
I work in SOS area
sos = signal.butter( filterOrder, passBand, filterType, analog=True, output='sos')
and I made the above example just to show where I see the problem. When we use Butterworth approximation of third order we should have three zeros and the obtained SOS biquads seems to have six.
sos = array([ [5.35788461e+13, 0.00000000e+00, 0.00000000e+00, 1.00000000e+00, 3.25936385e+04, 1.76422758e+09], [1.00000000e+00, 0.00000000e+00, 0.00000000e+00, 1.00000000e+00, 3.76991118e+04, 2.76348923e+08], [1.00000000e+00, 0.00000000e+00, 0.00000000e+00, 1.00000000e+00, 5.10547335e+03, 4.32873446e+07] ])
I would expect
sos = array([ [0.00000000e+00, 5.35788461e+13, 0.00000000e+00, 1.00000000e+00, 3.25936385e+04, 1.76422758e+09], [0.00000000e+00, 1.00000000e+00, 0.00000000e+00, 1.00000000e+00, 3.76991118e+04, 2.76348923e+08], [0.00000000e+00, 1.00000000e+00, 0.00000000e+00, 1.00000000e+00, 5.10547335e+03, 4.32873446e+07] ])
Or may be I'm wrong?
Regards, Todor
Ah OK. My bad. I wasn't clear enough. I was trying to convey the message that maybe conversion to transfer function was the faulty one but I'll try to check. Thanks again.
This is likely a duplicate of https://github.com/scipy/scipy/issues/5668
Out of curiosity, why do you want SOS for analog filters?
Hi @roryyorke,
Yes the idea behind is the same. The issue was opened in 2016, is there a chance to solve it?
I would like to realize RC biquad sections with op amps.
Regards, T.
I won't be able to look at this soon, sorry, but maybe someone else can. It has come up quite a few times, so we must fix it.
Thanks for the info on using this for the op-amp filter design.
Closed via gh-15085.
My issue is about zpk2sos conversion I presume. The power of the numerators of second order sections are evaluated not correctly
Reproducing code example:
It can be seen that the numerators are different in the power of s.
Scipy/Numpy/Python version information:
1.6.3 1.20.3 sys.version_info(major=3, minor=9, micro=5, releaselevel='final', serial=0)