summaryrefslogtreecommitdiff
path: root/40/CH9/EX9.11/Exa_9_11.sce
blob: 35a2c585ddde9abf4ba0fbd2ba761a9c9932bb96 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
//interference Rejection
//design oh high-Q and low-Q notch filters
s=%s;z=%z;
Q=50;
fo=60;S=300;
delf=fo/Q;
Wo=2*%pi*fo/S;
delW=2*%pi*delf/S;
C=tan(0.5*delW),B=cos(Wo)
HS=(s)/(s+1);
H1Z=horner(HS,(z^2-(2*B*z)+1)/(C*(z^2)-C))
Q1=5;delf1=fo/Q1;
delW1=2*%pi*delf1/S;
C1=tan(0.5*delW1),B1=cos(Wo)
H2Z=horner(HS,(z^2-(2*B1*z)+1)/(C1*(z^2)-C1))
f=0:0.5:150;
H1Z1=horner(H1Z,exp(%i*2*%pi*f'/S));
H2Z1=horner(H2Z,exp(%i*2*%pi*f'/S));
a=gca();
subplot(211);
plot2d(f,H1Z1);
xlabel('Analog Frequency f[Hz]');
ylabel('Magnitude');
xtitle('60 HZ notch filter with Q=50');
subplot(212);
plot2d(f,H2Z1);
xlabel('Analog Frequency f[Hz]');
ylabel('Magnitude');
xtitle('60 HZ notch filter with Q=5');