def freqresp(system, w=None, n=10000):
 if isinstance(system, lti):
  if isinstance(system, (TransferFunction, ZerosPolesGain)):
   sys = system
  else:
   sys = system._as_zpk()
 elif isinstance(system, dlti):
  raise AttributeError('freqresp can only be used with continuous-time systems.')
 else:
  sys = lti(*system)._as_zpk()
 if ((sys.inputs != 1) or (sys.outputs != 1)):
  raise ValueError('freqresp() requires a SISO (single input, single output) system.')
 if (w is not None):
  worN = w
 else:
  worN = n
 if isinstance(sys, TransferFunction):
  (w, h) = freqs(sys.num.ravel(), sys.den, worN=worN)
 elif isinstance(sys, ZerosPolesGain):
  (w, h) = freqs_zpk(sys.zeros, sys.poles, sys.gain, worN=worN)
 return (w, h)

def freqresp ( system , w = None , n = 10000 ) : if isinstance ( system , lti ) : if isinstance ( system , ( TransferFunction , ZerosPolesGain ) ) : sys = system else : sys = system . _as_zpk ( ) elif isinstance ( system , dlti ) : raise AttributeError ( 'freqresp can only be used with continuous-time systems.' ) else : sys = lti ( * system ) . _as_zpk ( ) if ( ( sys . inputs != 1 ) or ( sys . outputs != 1 ) ) : raise ValueError ( 'freqresp() requires a SISO (single input, single output) system.' ) if ( w is not None ) : worN = w else : worN = n if isinstance ( sys , TransferFunction ) : ( w , h ) = freqs ( sys . num . ravel ( ) , sys . den , worN = worN ) elif isinstance ( sys , ZerosPolesGain ) : ( w , h ) = freqs_zpk ( sys . zeros , sys . poles , sys . gain , worN = worN ) return ( w , h )
calculate the frequency response of a continuous-time system .