Matlab zp2sos
returns [sos, g]
but in python equivalent library zpk2sos
returns only sos
. How to calculate gain g in python.
ts=(length(data1)/128);
Wp = [1 4]/(fs/2); Ws = [0.5 4.5]/(fs/2);
Rp = 3; Rs = 40;
[n,Wn] = buttord(Wp,Ws,Rp,Rs);
[z, p, k] = butter(n,Wn,'bandpass');
[sos,g] = zp2sos(z,p,k);
filt = dfilt.df2sos(sos,g);
I'm converting this Matlab code to Python but can't find the library required to calculate gain g returned by Matlab zp2sos
function.