

def dsclansNTF(x, order, rmax, Hz):
    " Conversion of clans parameters into a NTF.\n\n    Translate x into H.\n    I've changed the relationships between (zeta, wn) and x\n    in order to guarantee LHP roots of the s-polynomial.\n    \n    Returns the NTF, a zpk tuple.\n    "
    x = x.squeeze()
    Hz = carray(Hz)
    Hz = Hz.reshape(((- 1),))
    Hp = np.zeros((1,), dtype=np.complex128)
    odd = ((order % 2) == 1)
    if odd:
        s = (- (x[0] ** 2.0))
        Hp[0] = ((rmax * (1.0 + s)) / (1.0 - s))
    for i in range((0 + (1 * odd)), order, 2):
        Hp = np.hstack((Hp, np.zeros((2,))))
        zeta = (x[i] ** 2)
        wn = (x[(i + 1)] ** 2)
        s = np.roots(np.array((1, ((2 * zeta) * wn), (wn ** 2))))
        Hp[i:(i + 2)] = ((rmax * (1.0 + s)) / (1.0 - s))
    H = (Hz, Hp, 1.0)
    return H

dataset/ETHPy150Open ggventurini/python-deltasigma/deltasigma/_dsclansNTF.py dsclansNTF/original