summaryrefslogtreecommitdiff
path: root/40/CH9/EX9.8a/Exa_9_8a.sce
blob: b6864a0c4157aec95b18df7818fd5cb190a14a28 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
//Bilinear transformation
//To convert bessel analog filter to digital filter
s=%s;
z=%z;
HS=3/(s^2+3*s+3);
Wa=4;//analog omega
Wd=%pi/2;//digital omega
T=(2/Wa)*(tan(Wd/2));
HZ=horner(HS,(2/T)*(z-1)/(z+1))
f=0:0.1:6;
HS1=horner(HS,(%i*4*f'/3));
HS1=abs(HS1);
HZ1=horner(HZ,exp(-%i*%pi*f'/6));
HZ1=abs(HZ1);
a=gca();
a.x_location="origin";
plot2d(f,HS1);
plot2d(f,HZ1);
xlabel('Analog Frequency f[kHZ)');
ylabel('Magnitude');
xtitle('Bessel filter H(s) and digital filter H(z)');