summaryrefslogtreecommitdiff
path: root/40/CH6/EX6.8/Exa_6_8.sce
blob: 811691ac4d22d620b1190d6d705dc1dfbd54195a (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
//Digital Resonator design with peak gain 50 HZ 
//and 3 db bandwidth of 6HZ at sampling of 300 HZ
clf();
s=%s;
F=0:150;
f=F/300;
s=exp(%i*2*%pi*f);
for i=1:151
    H1(i)=(0.1054*(s(i)^2))/(s(i)^2-0.9372*s(i)+0.8783);
end
H1=abs(H1);
H2=H1(40:60);
F1=40:60;
f1=F1/300;
a=gca();
a.x_location="origin";
a.y_location="origin";
plot2d(F,H1)
xlabel('Analog frequency F');
ylabel('magnitude');
xtitle('Magnitude spectrum of digital resonator with peak 50HZ');
xset('window',1);
a.x_location="origin";
a.y_location="origin";
plot2d(F1,H2)
xlabel('Analog frequency F');
ylabel('magnitude');
xtitle('passband detail');