def _zpklp2bs(z, p, k, wo=<NUM_LIT:1.0>, bw=<NUM_LIT:1.0>):
z = atleast_1d(z)<EOL>p = atleast_1d(p)<EOL>wo = float(wo)<EOL>bw = float(bw)<EOL>degree = _relative_degree(z, p)<EOL>z_hp = (bw/<NUM_LIT:2>) / z<EOL>p_hp = (bw/<NUM_LIT:2>) / p<EOL>z_hp = z_hp.astype(complex)<EOL>p_hp = p_hp.astype(complex)<EOL>z_bs = concatenate((z_hp + sqrt(z_hp**<NUM_LIT:2> - wo**<NUM_LIT:2>),<EOL>z_hp - sqrt(z_hp**<NUM_LIT:2> - wo**<NUM_LIT:2>)))<EOL>p_bs = concatenate((p_hp + sqrt(p_hp**<NUM_LIT:2> - wo**<NUM_LIT:2>),<EOL>p_hp - sqrt(p_hp**<NUM_LIT:2> - wo**<NUM_LIT:2>)))<EOL>z_bs = append(z_bs, +<NUM_LIT>*wo * ones(degree))<EOL>z_bs = append(z_bs, -<NUM_LIT>*wo * ones(degree))<EOL>k_bs = k * real(prod(-z) / prod(-p))<EOL>return z_bs, p_bs, k_bs<EOL>
Transform a lowpass filter prototype to a bandstop filter.

Return an analog band-stop filter with center frequency `wo` and
stopband width `bw` from an analog low-pass filter prototype with unity
cutoff frequency, using zeros, poles, and gain ('zpk') representation.

Parameters
----------
z : ndarray
    Zeros of the analog IIR filter transfer function.
p : ndarray
    Poles of the analog IIR filter transfer function.
k : float
    System gain of the analog IIR filter transfer function.
wo : float
    Desired stopband center, as angular frequency (e.g. rad/s).
    Defaults to no change.
bw : float
    Desired stopband width, as angular frequency (e.g. rad/s).
    Defaults to 1.

Returns
-------
z : ndarray
    Zeros of the transformed band-stop filter transfer function.
p : ndarray
    Poles of the transformed band-stop filter transfer function.
k : float
    System gain of the transformed band-stop filter.

Notes
-----
This is derived from the s-plane substitution

.. math:: s \rightarrow \frac{s \cdot \mathrm{BW}}{s^2 + {\omega_0}^2}

This is the "wideband" transformation, producing a stopband with
geometric (log frequency) symmetry about `wo`.