def freqs_zpk(z, p, k, worN=None):
 k = np.asarray(k)
 if (k.size > 1):
  raise ValueError('k must be a single scalar gain')
 if (worN is None):
  w = findfreqs(z, p, 200, kind='zp')
 elif isinstance(worN, int):
  N = worN
  w = findfreqs(z, p, N, kind='zp')
 else:
  w = worN
 w = atleast_1d(w)
 s = (1j * w)
 num = polyvalfromroots(s, z)
 den = polyvalfromroots(s, p)
 h = ((k * num) / den)
 return (w, h)

def freqs_zpk ( z , p , k , worN = None ) : k = np . asarray ( k ) if ( k . size > 1 ) : raise ValueError ( 'k must be a single scalar gain' ) if ( worN is None ) : w = findfreqs ( z , p , 200 , kind = 'zp' ) elif isinstance ( worN , int ) : N = worN w = findfreqs ( z , p , N , kind = 'zp' ) else : w = worN w = atleast_1d ( w ) s = ( 1j * w ) num = polyvalfromroots ( s , z ) den = polyvalfromroots ( s , p ) h = ( ( k * num ) / den ) return ( w , h )
compute frequency response of analog filter .