summaryrefslogtreecommitdiff
path: root/52/CH5
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /52/CH5
downloadScilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.gz
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.bz2
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.zip
initial commit / add all books
Diffstat (limited to '52/CH5')
-rwxr-xr-x52/CH5/EX5.1/Example5_1.sce11
-rwxr-xr-x52/CH5/EX5.10/Example5_10.sce16
-rwxr-xr-x52/CH5/EX5.11/Example5_11.sce16
-rwxr-xr-x52/CH5/EX5.12/Example5_12.sce13
-rwxr-xr-x52/CH5/EX5.13/Example5_13.sce13
-rwxr-xr-x52/CH5/EX5.15/Example5_15.sce16
-rwxr-xr-x52/CH5/EX5.16/Example5_16.sce11
-rwxr-xr-x52/CH5/EX5.17/Example5_17.sce25
-rwxr-xr-x52/CH5/EX5.18/Example5_18.sce11
-rwxr-xr-x52/CH5/EX5.19/Example5_19.sce17
-rwxr-xr-x52/CH5/EX5.2/Example5_2.sce13
-rwxr-xr-x52/CH5/EX5.29/Example5_29.sce35
-rwxr-xr-x52/CH5/EX5.4/Example5_4.sce16
-rwxr-xr-x52/CH5/EX5.5/Example5_5.sce18
-rwxr-xr-x52/CH5/EX5.6/Example5_6.sce13
-rwxr-xr-x52/CH5/EX5.7/Example5_7.sce15
-rwxr-xr-x52/CH5/EX5.8/Example5_8.sce11
-rwxr-xr-x52/CH5/EX5.9/Example5_9.sce11
18 files changed, 281 insertions, 0 deletions
diff --git a/52/CH5/EX5.1/Example5_1.sce b/52/CH5/EX5.1/Example5_1.sce
new file mode 100755
index 000000000..c62f2ba47
--- /dev/null
+++ b/52/CH5/EX5.1/Example5_1.sce
@@ -0,0 +1,11 @@
+//Example 5.1
+//To Find out the order of the filter
+clear;
+clc ;
+close ;
+ap=1;//db
+as=30;//db
+op=200;//rad/sec
+os=600;//rad/sec
+N=log(sqrt((10^(0.1*as)-1)/(10^(0.1*ap)-1)))/log(os/op);
+disp(ceil(N),'Order of the filter, N ='); \ No newline at end of file
diff --git a/52/CH5/EX5.10/Example5_10.sce b/52/CH5/EX5.10/Example5_10.sce
new file mode 100755
index 000000000..1a274a267
--- /dev/null
+++ b/52/CH5/EX5.10/Example5_10.sce
@@ -0,0 +1,16 @@
+//Example 5.10
+//To Design a H.P.F. with given specifications
+clear;
+clc ;
+close ;
+ap=3;//db
+as=15;//db
+op=500;//rad/sec
+os=1000;//rad/sec
+N=log(sqrt((10^(0.1*as)-1)/(10^(0.1*ap)-1)))/log(os/op);
+disp(ceil(N),'Order of the filter, N =');
+s=%s;
+HS=1/((s+1)*(s^2+s+1));//Transfer Function for N=3
+oc=1000//rad/sec
+HS1=horner(HS,oc/s);
+disp(HS1,'Normalized Transfer Function, H(s) ='); \ No newline at end of file
diff --git a/52/CH5/EX5.11/Example5_11.sce b/52/CH5/EX5.11/Example5_11.sce
new file mode 100755
index 000000000..7dcefcda2
--- /dev/null
+++ b/52/CH5/EX5.11/Example5_11.sce
@@ -0,0 +1,16 @@
+//Example 5.11
+//To Design the Filter using Impulse Invarient Method
+clear;
+clc ;
+close ;
+s=%s;
+T=1;
+HS=(2)/(s^2+3*s+2);
+elts=pfss(HS);
+disp(elts,'Factorized HS = ');
+//The poles comes out to be at -2 and -1
+p1=-2;
+p2=-1;
+z=%z;
+HZ=(2/(1-%e^(p2*T)*z^(-1)))-(2/(1-%e^(p1*T)*z^(-1)))
+disp(HZ,'HZ = '); \ No newline at end of file
diff --git a/52/CH5/EX5.12/Example5_12.sce b/52/CH5/EX5.12/Example5_12.sce
new file mode 100755
index 000000000..f99a8d680
--- /dev/null
+++ b/52/CH5/EX5.12/Example5_12.sce
@@ -0,0 +1,13 @@
+//Example 5.12
+//MAXIMA SCILAB TOOLBOX REQUIRED FOR THIS PROGRAM
+//To Design the Filter using Impulse Invarient Method
+clear;
+clc ;
+close ;
+s=%s;
+HS=1/(s^2+sqrt(2)*s+1);
+pp=ilaplace(HS);
+syms n z;
+t=1;
+X= symsum (pp*(z^(-n)),n ,0, %inf );
+disp(X,'Factorized HS = '); \ No newline at end of file
diff --git a/52/CH5/EX5.13/Example5_13.sce b/52/CH5/EX5.13/Example5_13.sce
new file mode 100755
index 000000000..4b7da1a21
--- /dev/null
+++ b/52/CH5/EX5.13/Example5_13.sce
@@ -0,0 +1,13 @@
+//Example 5.13
+//MAXIMA SCILAB TOOLBOX REQUIRED FOR THIS PROGRAM
+//To Design the 3rd Order Butterworth Filter using Impulse Invarient Method
+clear;
+clc ;
+close ;
+s=%s;
+HS=1/((s+1)*(s^2+s+1));
+pp=ilaplace(HS);//Inverse Laplace
+syms n z;
+t=1;
+X= symsum (pp*(z^(-n)),n ,0, %inf );//Z Transform
+disp(X,'H(z)= '); \ No newline at end of file
diff --git a/52/CH5/EX5.15/Example5_15.sce b/52/CH5/EX5.15/Example5_15.sce
new file mode 100755
index 000000000..2f8186358
--- /dev/null
+++ b/52/CH5/EX5.15/Example5_15.sce
@@ -0,0 +1,16 @@
+//Example 5.15
+//To Design the Filter using Impulse Invarient Method
+clear;
+clc ;
+close ;
+s=%s;
+T=0.2;
+HS=10/(s^2+7*s+10);
+elts=pfss(HS);
+disp(elts,'Factorized HS = ');
+//The poles comes out to be at -5 and -2
+p1=-5;
+p2=-2;
+z=%z;
+HZ=T*((-3.33/(1-%e^(p1*T)*z^(-1)))+(3.33/(1-%e^(p2*T)*z^(-1))))
+disp(HZ,'HZ = '); \ No newline at end of file
diff --git a/52/CH5/EX5.16/Example5_16.sce b/52/CH5/EX5.16/Example5_16.sce
new file mode 100755
index 000000000..44f853369
--- /dev/null
+++ b/52/CH5/EX5.16/Example5_16.sce
@@ -0,0 +1,11 @@
+//Example 5.16
+//To Find out Bilinear Transformation of HS=2/((s+1)*(s+2))
+clear;
+clc ;
+close ;
+s=%s;
+z=%z;
+HS=2/((s+1)*(s+2));
+T=1;
+HZ=horner(HS,(2/T)*(z-1)/(z+1));
+disp(HZ,'H(z) ='); \ No newline at end of file
diff --git a/52/CH5/EX5.17/Example5_17.sce b/52/CH5/EX5.17/Example5_17.sce
new file mode 100755
index 000000000..b03a6a01e
--- /dev/null
+++ b/52/CH5/EX5.17/Example5_17.sce
@@ -0,0 +1,25 @@
+//Example 5.17
+//To Design an H.P.F. monotonic in passband using Bilinear Transform
+clear;
+clc ;
+close ;
+ap=3;//db
+as=10;//db
+fp=1000;//Hz
+fs=350;//Hz
+f=5000;
+T=1/f;
+wp=2*%pi*fp;
+ws=2*%pi*fs;
+op=2/T*tan(wp*T/2);
+os=2/T*tan(ws*T/2);
+N=log(sqrt((10^(0.1*as)-1)/(10^(0.1*ap)-1)))/log(op/os);
+disp(ceil(N),'Order of the filter, N =');
+s=%s;
+HS=1/(s+1)//Transfer Function for N=1
+oc=op//rad/sec
+HS1=horner(HS,oc/s);
+disp(HS1,'Normalized Transfer Function, H(s) =');
+z=%z;
+HZ=horner(HS,(2/T)*(z-1)/(z+1));
+disp(HZ,'H(z) ='); \ No newline at end of file
diff --git a/52/CH5/EX5.18/Example5_18.sce b/52/CH5/EX5.18/Example5_18.sce
new file mode 100755
index 000000000..12d40dfc1
--- /dev/null
+++ b/52/CH5/EX5.18/Example5_18.sce
@@ -0,0 +1,11 @@
+//Example 5.18
+//To Find out Bilinear Transformation of H(s)=(s^2+4.525)/(s^2+0.692*s+0.504)
+clear;
+clc ;
+close ;
+s=%s;
+z=%z;
+HS=(s^2+4.525)/(s^2+0.692*s+0.504);
+T=1;
+HZ=horner(HS,(2/T)*(z-1)/(z+1));
+disp(HZ,'H(z) ='); \ No newline at end of file
diff --git a/52/CH5/EX5.19/Example5_19.sce b/52/CH5/EX5.19/Example5_19.sce
new file mode 100755
index 000000000..adf0d7ff4
--- /dev/null
+++ b/52/CH5/EX5.19/Example5_19.sce
@@ -0,0 +1,17 @@
+//Example 5.19
+//To Convert a single Pole LPF into BPF
+clear;
+clc ;
+close ;
+s=%s;
+z=%z;
+HZ=(0.5*(1+z^(-1)))/(1-0.302*z^(-2));
+T=1;
+wu=3*%pi/4;
+wl=%pi/4;
+wp=%pi/6;
+k=tan(wp/2)/tan((wu-wl)/2);
+a=cos((wu+wl)/2)/cos((wu-wl)/2);
+transf=-((((k-1)/(k+1))*(z^(-2)))-((2*a*k/(k+1))*(z^(-1)))+1)/(z^(-2)-(2*a*k/(1+k)*z^(-1))+((k-1)/(k+1)));
+HZ1=horner(HZ,transf);
+disp(HZ1,'H(z) of B.P.F ='); \ No newline at end of file
diff --git a/52/CH5/EX5.2/Example5_2.sce b/52/CH5/EX5.2/Example5_2.sce
new file mode 100755
index 000000000..a6c9a5daf
--- /dev/null
+++ b/52/CH5/EX5.2/Example5_2.sce
@@ -0,0 +1,13 @@
+//Example 5.2
+//To Find out the order of a Low Pass Butterworth Filter
+clear;
+clc ;
+close ;
+ap=3;//db
+as=40;//db
+fp=500;//Hz
+fs=1000;//Hz
+op=2*%pi*fp;
+os=2*%pi*fs;
+N=log(sqrt((10^(0.1*as)-1)/(10^(0.1*ap)-1)))/log(os/op);
+disp(ceil(N),'Order of the filter, N ='); \ No newline at end of file
diff --git a/52/CH5/EX5.29/Example5_29.sce b/52/CH5/EX5.29/Example5_29.sce
new file mode 100755
index 000000000..2c88c0b92
--- /dev/null
+++ b/52/CH5/EX5.29/Example5_29.sce
@@ -0,0 +1,35 @@
+//Example 5.29
+//Program to convert given IIR pole-zero Filter into Lattice Ladder Structure.
+clear;
+clc ;
+close ;
+U=1; //Zero Adjust
+a(3+U,0+U)=1;
+a(3+U,1+U)=13/24;
+a(3+U,2+U)=5/8;
+a(3+U,3+U)=1/3;
+a(2+U,0+U)=1; //a(m,0)=1
+a(2+U,3+U)=1/3;
+m=3,k=1;
+a(m-1+U,k+U)=(a(m+U,k+U)-a(m+U,m+U)*a(m+U,m-k+U))/(1-a(m+U,m+U)*a(m+U,m+U));
+m=3,k=2;
+a(m-1+U,k+U)=(a(m+U,k+U)-a(m+U,m+U)*a(m+U,m-k+U))/(1-a(m+U,m+U)*a(m+U,m+U));
+m=2,k=1;
+a(m-1+U,k+U)=(a(m+U,k+U)-a(m+U,m+U)*a(m+U,m-k+U))/(1-a(m+U,m+U)*a(m+U,m+U));
+disp('LATTICE COEFFICIENTS');
+disp(a(1+U,1+U),'k1');
+disp(a(2+U,2+U),'k2');
+disp(a(3+U,3+U),'k3');
+b0=1;
+b1=2;
+b2=2;
+b3=1;
+c3=b3;
+c2=b2-c3*a(3+U,1+U);
+c1=b1-(c2*a(2+U,1+U)+c3*a(3+U,2+U));
+c0=b0-(c1*a(1+U,1+U)+c2*a(2+U,2+U)+c3*a(3+U,3+U));
+disp('LADDER COEFFICIENTS');
+disp(c0,'c0 =');
+disp(c1,'c1 =');
+disp(c2,'c2 =');
+disp(c3,'c3 ='); \ No newline at end of file
diff --git a/52/CH5/EX5.4/Example5_4.sce b/52/CH5/EX5.4/Example5_4.sce
new file mode 100755
index 000000000..5beb9a6c0
--- /dev/null
+++ b/52/CH5/EX5.4/Example5_4.sce
@@ -0,0 +1,16 @@
+//Example 5.4
+//To Design an Analog Butterworth Filter
+clear;
+clc ;
+close ;
+ap=2;//db
+as=10;//db
+op=20;//rad/sec
+os=30;//rad/sec
+N=log(sqrt((10^(0.1*as)-1)/(10^(0.1*ap)-1)))/log(os/op);
+disp(ceil(N),'Order of the filter, N =');
+s=%s;
+HS=1/((s^2+0.76537*s+1)*(s^2+1.8477*s+1));//Transfer Function for N=4
+oc=op/(10^(0.1*ap)-1)^(1/(2*ceil(N)));
+HS1=horner(HS,s/oc);
+disp(HS1,'Normalized Transfer Function, H(s) ='); \ No newline at end of file
diff --git a/52/CH5/EX5.5/Example5_5.sce b/52/CH5/EX5.5/Example5_5.sce
new file mode 100755
index 000000000..211048b0b
--- /dev/null
+++ b/52/CH5/EX5.5/Example5_5.sce
@@ -0,0 +1,18 @@
+//Example 5.5
+//To Design an Analog Butterworth Filter
+clear;
+clc ;
+close ;
+op=0.2*%pi;
+os=0.4*%pi;
+e1=0.9;
+l1=0.2;
+epsilon=sqrt(1/(e1^2)-1);
+lambda=sqrt(1/(l1^2)-1);
+N=log(lambda/epsilon)/log(os/op);
+disp(ceil(N),'Order of the filter, N =');
+s=%s;
+HS=1/((s^2+0.76537*s+1)*(s^2+1.8477*s+1));//Transfer Function for N=4
+oc=op/epsilon^(1/ceil(N));
+HS1=horner(HS,s/oc);
+disp(HS1,'Normalized Transfer Function, H(s) ='); \ No newline at end of file
diff --git a/52/CH5/EX5.6/Example5_6.sce b/52/CH5/EX5.6/Example5_6.sce
new file mode 100755
index 000000000..0c8717271
--- /dev/null
+++ b/52/CH5/EX5.6/Example5_6.sce
@@ -0,0 +1,13 @@
+//Example 5.6
+//To Find out the order of the Filter using Chebyshev Approximation
+clear;
+clc ;
+close ;
+ap=3;//db
+as=16;//db
+fp=1000;//Hz
+fs=2000;//Hz
+op=2*%pi*fp;
+os=2*%pi*fs;
+N=acosh(sqrt((10^(0.1*as)-1)/(10^(0.1*ap)-1)))/acosh(os/op);
+disp(ceil(N),'Order of the filter, N ='); \ No newline at end of file
diff --git a/52/CH5/EX5.7/Example5_7.sce b/52/CH5/EX5.7/Example5_7.sce
new file mode 100755
index 000000000..d8668e5eb
--- /dev/null
+++ b/52/CH5/EX5.7/Example5_7.sce
@@ -0,0 +1,15 @@
+//Example 5.7
+//To Design an analog Chebyshev Filter with Given Specifications
+clear;
+clc ;
+close ;
+os=2;
+op=1;
+ap=3;//db
+as=16;//db
+e1=1/sqrt(2);
+l1=0.1;
+epsilon=sqrt(1/(e1^2)-1);
+lambda=sqrt(1/(l1^2)-1);
+N=acosh(lambda/epsilon)/acosh(os/op);
+disp(ceil(N),'Order of the filter, N ='); \ No newline at end of file
diff --git a/52/CH5/EX5.8/Example5_8.sce b/52/CH5/EX5.8/Example5_8.sce
new file mode 100755
index 000000000..f4480f66b
--- /dev/null
+++ b/52/CH5/EX5.8/Example5_8.sce
@@ -0,0 +1,11 @@
+//Example 5.8
+//To Find out the order of the poles of the Type 1 Lowpass Chebyshev Filter
+clear;
+clc ;
+close ;
+ap=1;//dB
+as=40;//dB
+op=1000*%pi;
+os=2000*%pi;
+N=acosh(sqrt((10^(0.1*as)-1)/(10^(0.1*ap)-1)))/acosh(os/op);
+disp(ceil(N),'Order of the filter, N ='); \ No newline at end of file
diff --git a/52/CH5/EX5.9/Example5_9.sce b/52/CH5/EX5.9/Example5_9.sce
new file mode 100755
index 000000000..76cd1d0f8
--- /dev/null
+++ b/52/CH5/EX5.9/Example5_9.sce
@@ -0,0 +1,11 @@
+//Example 5.9
+//To Design a Chebyshev Filter with Given Specifications
+clear;
+clc ;
+close ;
+ap=2.5;//db
+as=30;//db
+op=20;//rad/sec
+os=50;//rad/sec
+N=acosh(sqrt((10^(0.1*as)-1)/(10^(0.1*ap)-1)))/acosh(os/op);
+disp(ceil(N),'Order of the filter, N ='); \ No newline at end of file