freq/ma_bode.py
changeset 0 0efde00f9229
equal deleted inserted replaced
-1:000000000000 0:0efde00f9229
       
     1 #!/usr/bin/python
       
     2 # 5.3
       
     3 
       
     4 import scipy as sp
       
     5 from pylab import *
       
     6 
       
     7 w = arange(0, pi, 0.01)
       
     8 subplot(2,1,1)
       
     9 loglog(w,abs(1+2*cos(w))/3)
       
    10 ylabel('Magnitude')
       
    11 
       
    12 subplot(2,1,2)
       
    13 semilogx(w,angle(1+2*cos(w))*180/pi)
       
    14 xlabel('w (rad/s)')
       
    15 ylabel('Phase')
       
    16 
       
    17 show()
       
    18 #axis tight, label('',18,'w (rad/s)','Phase',18)