<p dir="auto">My issue is about  zpk2sos conversion I presume.<br>
The power of the numerators of second order sections are evaluated not correctly</p>
<h4 dir="auto">Reproducing code example:</h4>

<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Sample code to reproduce the problem

Jupyter QtConsole 5.0.3
Python 3.9.5 (default, May  9 2021, 14:00:28) 
Type 'copyright', 'credits' or 'license' for more information
IPython 7.23.1 -- An enhanced Interactive Python. Type '?' for help.

import math
from scipy import signal
import sympy

s = sympy.Symbol('s')
filterOrder = 3
passBand = list(map(lambda x: x*2*math.pi, [1000, 7000]))
filterType = 'bandpass'
z,p,k = signal.butter( filterOrder, passBand, filterType, analog=True, output='zpk')
b,a = signal.zpk2tf(z,p,k)
sos = signal.zpk2sos(z,p,k)
print(&quot;Transfer Function from z,p,k&quot;)
n,d = signal.zpk2tf(z,p,k)
print(&quot;H(s) =&quot;, sympy.Poly(n,s)/sympy.Poly(d,s))
print()
print(&quot;Transfer Function from sos&quot;)
n1,d1 = signal.sos2tf(sos)
print(&quot;H(s) =&quot;, sympy.Poly(n1,s)/sympy.Poly(d1,s))
Transfer Function from z,p,k
H(s) = 53578846103558.1*s**3/(1.0*s**6 + 75398.223686155*s**5 + 3671492837.20524*s**4 + 95251281961881.0*s**3 + 1.01461309221017e+18*s**2 + 5.75806638891985e+21*s + 2.11044155773651e+25)

Transfer Function from sos
H(s) = 53578846103558.1*s**6/(1.0*s**6 + 75398.223686155*s**5 + 3671492837.20524*s**4 + 95251281961881.0*s**3 + 1.01461309221017e+18*s**2 + 5.75806638891985e+21*s + 2.11044155773651e+25)"><pre class="notranslate"><code class="notranslate">Sample code to reproduce the problem

Jupyter QtConsole 5.0.3
Python 3.9.5 (default, May  9 2021, 14:00:28) 
Type 'copyright', 'credits' or 'license' for more information
IPython 7.23.1 -- An enhanced Interactive Python. Type '?' for help.

import math
from scipy import signal
import sympy

s = sympy.Symbol('s')
filterOrder = 3
passBand = list(map(lambda x: x*2*math.pi, [1000, 7000]))
filterType = 'bandpass'
z,p,k = signal.butter( filterOrder, passBand, filterType, analog=True, output='zpk')
b,a = signal.zpk2tf(z,p,k)
sos = signal.zpk2sos(z,p,k)
print("Transfer Function from z,p,k")
n,d = signal.zpk2tf(z,p,k)
print("H(s) =", sympy.Poly(n,s)/sympy.Poly(d,s))
print()
print("Transfer Function from sos")
n1,d1 = signal.sos2tf(sos)
print("H(s) =", sympy.Poly(n1,s)/sympy.Poly(d1,s))
Transfer Function from z,p,k
H(s) = 53578846103558.1*s**3/(1.0*s**6 + 75398.223686155*s**5 + 3671492837.20524*s**4 + 95251281961881.0*s**3 + 1.01461309221017e+18*s**2 + 5.75806638891985e+21*s + 2.11044155773651e+25)

Transfer Function from sos
H(s) = 53578846103558.1*s**6/(1.0*s**6 + 75398.223686155*s**5 + 3671492837.20524*s**4 + 95251281961881.0*s**3 + 1.01461309221017e+18*s**2 + 5.75806638891985e+21*s + 2.11044155773651e+25)
</code></pre></div>
<p dir="auto">It can be seen that the numerators are different in the power of s.</p>
<h4 dir="auto">Scipy/Numpy/Python version information:</h4>

<p dir="auto">1.6.3 1.20.3 sys.version_info(major=3, minor=9, micro=5, releaselevel='final', serial=0)</p>
<p dir="auto">As described in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="35173341" data-permission-text="Title is private" data-url="https://github.com/scipy/scipy/issues/3717" data-hovercard-type="pull_request" data-hovercard-url="/scipy/scipy/pull/3717/hovercard?comment_id=142460019&amp;comment_type=issue_comment" href="https://github.com/scipy/scipy/pull/3717#issuecomment-142460019">#3717 (comment)</a>, zpk2sos does not work for analog filters since the coefficients of each stage are different.</p>
<p dir="auto"><code class="notranslate">b, a = butter(1, 1, analog=True)</code> produces b = [1], a = [1, 1]  → H(s) = 1/(s+1)</p>
<p dir="auto"><code class="notranslate">sos = tf2sos(b, a)</code> produces <code class="notranslate">[1, 0, 0, 1, 1, 0]</code></p>
<p dir="auto">this stage is b = [1, 0, 0], a = [1, 1, 0] → H(s) = s^2/(s^2+s) = s/(s+1) which is not the same as above.  For digital filters, trailing zeros don't matter, but for analog filters, they do, and <em>leading</em> zeros don't matter.  The correct result should be <code class="notranslate">[0, 0, 1, 0, 1, 1]</code></p>
<p dir="auto">So docstring should probably say it's not meant for analog at all for now?</p>
<p dir="auto">and add analog=True to zpk2sos?</p>