author | Puneeth Chaganti <punchagan@fossee.in> |
Fri, 27 May 2011 14:24:59 +0530 | |
changeset 0 | 0efde00f9229 |
permissions | -rw-r--r-- |
0 | 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) |