Initial commit.
#!/usr/bin/python
# 5.2
import scipy as sp
from pylab import *
omega = linspace(0, pi, 100)
g1 = 0.5 / (cos(omega)-0.5+1j*sin(omega))
mag1 = abs(g1)
angle1 = angle(g1) * 180/pi
g2 = (0.5+0.5*cos(omega)-1.5*1j*sin(omega)) \
* 0.25 / (1.25-cos(omega))
mag2 = abs(g2)
angle2 = angle(g2) * 180/pi
subplot(2,1,1)
plot(omega,mag1,omega,mag2,'--')
ylabel('Magnitude')
subplot(2,1,2)
plot(omega,angle1,omega,angle2,'--')
xlabel('w (rad/s)')
ylabel('Phase')
show()
#axis tight, label('',18,'w (rad/s)','Phase',18)