def _zpkbilinear(z, p, k, fs):
 z = atleast_1d(z)
 p = atleast_1d(p)
 degree = _relative_degree(z, p)
 fs2 = (2 * fs)
 z_z = ((fs2 + z) / (fs2 - z))
 p_z = ((fs2 + p) / (fs2 - p))
 z_z = append(z_z, (- ones(degree)))
 k_z = (k * real((prod((fs2 - z)) / prod((fs2 - p)))))
 return (z_z, p_z, k_z)

def _zpkbilinear ( z , p , k , fs ) : z = atleast_1d ( z ) p = atleast_1d ( p ) degree = _relative_degree ( z , p ) fs2 = ( 2 * fs ) z_z = ( ( fs2 + z ) / ( fs2 - z ) ) p_z = ( ( fs2 + p ) / ( fs2 - p ) ) z_z = append ( z_z , ( - ones ( degree ) ) ) k_z = ( k * real ( ( prod ( ( fs2 - z ) ) / prod ( ( fs2 - p ) ) ) ) ) return ( z_z , p_z , k_z )
bilinear transformation to convert a filter from analog to digital .