def dbode(system, w=None, n=100):
 (w, y) = dfreqresp(system, w=w, n=n)
 if isinstance(system, dlti):
  dt = system.dt
 else:
  dt = system[(-1)]
 mag = (20.0 * numpy.log10(abs(y)))
 phase = numpy.rad2deg(numpy.unwrap(numpy.angle(y)))
 return ((w / dt), mag, phase)

def dbode ( system , w = None , n = 100 ) : ( w , y ) = dfreqresp ( system , w = w , n = n ) if isinstance ( system , dlti ) : dt = system . dt else : dt = system [ ( - 1 ) ] mag = ( 20.0 * numpy . log10 ( abs ( y ) ) ) phase = numpy . rad2deg ( numpy . unwrap ( numpy . angle ( y ) ) ) return ( ( w / dt ) , mag , phase )
calculate bode magnitude and phase data of a discrete-time system .