summaryrefslogtreecommitdiff
path: root/692/CH8
diff options
context:
space:
mode:
Diffstat (limited to '692/CH8')
-rwxr-xr-x692/CH8/EX8.1/P8_1.sce14
-rwxr-xr-x692/CH8/EX8.10/P8_10.sce29
-rwxr-xr-x692/CH8/EX8.12/P8_12.sce30
-rwxr-xr-x692/CH8/EX8.18/P8_18.sce19
-rwxr-xr-x692/CH8/EX8.6/P8_6.sce7
-rwxr-xr-x692/CH8/EX8.7/P8_7.sce13
6 files changed, 112 insertions, 0 deletions
diff --git a/692/CH8/EX8.1/P8_1.sce b/692/CH8/EX8.1/P8_1.sce
new file mode 100755
index 000000000..32ff051a3
--- /dev/null
+++ b/692/CH8/EX8.1/P8_1.sce
@@ -0,0 +1,14 @@
+//EXAMPLE 8.1
+//MAXIMA SCILAB TOOLBOX REQUIRED FOR THIS EXAMPLE
+//Digital filter structure
+clear;
+clc;
+syms W1 W2 W3 X Y a d B y E z;
+//Equations obtained are as follows:
+W1 = X - a*W3/z;
+W2 = W1 - d*W2/z;
+W3 = W2/z + E*W2;
+Y = B*W1 +y*W3/z;
+//Solving the above equations:
+Hz=(B + (B*d+y*E)/z + y/(z^2))/(1 + (d+a*E)/z + a/(z^2))
+disp(Hz,'Hz = '); \ No newline at end of file
diff --git a/692/CH8/EX8.10/P8_10.sce b/692/CH8/EX8.10/P8_10.sce
new file mode 100755
index 000000000..bfda78cc4
--- /dev/null
+++ b/692/CH8/EX8.10/P8_10.sce
@@ -0,0 +1,29 @@
+//Example 8.10
+//Cascaded lattice realization of IIR Transfer Function
+clear;
+clc;
+z=%z;
+P3z= -0.2 + 0.18/z + 0.4/(z^2) + 1/(z^3);
+D3z= 1 + 0.4/z + 0.18/(z^2) - 0.2/(z^3);
+A3z=P3z/D3z;
+p1=coeff(numer(P3z));
+p=mtlb_fliplr(p1);
+disp(mtlb_fliplr(p),'The coefficients ofnumerator are = ');
+d1=coeff(numer(D3z-1));
+d=mtlb_fliplr(d1)
+disp((d),'The coefficients ofnumerator are = ');
+d1_1dash=(d(1)-d(3)*d(2))/(1-d(3)*d(3));
+disp(d1_1dash,"d1_1dash = ");
+d2_1dash=(d(2)-d(3)*d(1))/(1-d(3)*d(3));
+disp(d2_1dash,"d2_1dash ");
+d1_2dash=(d1_1dash)/(1+d2_1dash);
+disp(d1_2dash,"d1_2dash = ");
+A1z=(d1_2dash + 1/z)/(1 + d1_2dash/z);
+disp(A1z,'A1z = ');
+A2z=(d2_1dash + d1_1dash*1/z + 1/z^2)/(1 + d1_1dash/z - d2_1dash/z^2);
+disp(A2z,'A2z = ');
+
+
+
+
+
diff --git a/692/CH8/EX8.12/P8_12.sce b/692/CH8/EX8.12/P8_12.sce
new file mode 100755
index 000000000..2fe2d03e1
--- /dev/null
+++ b/692/CH8/EX8.12/P8_12.sce
@@ -0,0 +1,30 @@
+//Example 8.12
+//Gray Markel method of Realisation
+clear;
+clc;
+z=%z;
+P3z= 0 + 0.44/z + 0.362/(z^2) +0.02/(z^3);
+D3z= 0.4/z + 0.18/(z^2) - .2/(z^3);
+Hz=P3z/D3z;
+p1=coeff(numer(P3z));
+p=mtlb_fliplr(p1)
+disp(mtlb_fliplr(p),'The coefficients ofnumerator are = ');
+d1=coeff(numer(D3z));
+d=mtlb_fliplr(d1)
+disp(mtlb_fliplr(d),'The coefficients ofnumerator are = ');
+d1_1dash=(d(1)-d(3)*d(2))/(1-d(3)*d(3));
+disp(d1_1dash,"d1_1dash = ");
+d2_1dash=(d(2)-d(3)*d(1))/(1-d(3)*d(3));
+disp(d2_1dash,"d2_1dash ");
+d1_2dash=(d1_1dash)/(1+d2_1dash);
+disp(d1_2dash,"d1_2dash = ");
+a1=p(3);
+disp(p(3),'a1 = ');
+a2=p(2)-a1*d(1);
+disp(p(2)-a1*d(1),'a2 = ');
+a3=p(1)-a1*d(2)-a2*d1_1dash;
+disp(p(1)-a1*d(2)-a2*d1_1dash,'a3 = ');
+disp(0-a1*d(3)-a3*d1_2dash-a2*d2_1dash,'a4 = ');
+
+
+
diff --git a/692/CH8/EX8.18/P8_18.sce b/692/CH8/EX8.18/P8_18.sce
new file mode 100755
index 000000000..b1834d327
--- /dev/null
+++ b/692/CH8/EX8.18/P8_18.sce
@@ -0,0 +1,19 @@
+//Example 8.18
+//Cascaded lattice realization of Power-symmetric FIR Transfer Function
+clear;
+clc;
+z=%z;
+
+H5z=(1 + 0.3/z + 0.2/z^2 - 0.376/z^3 - 0.06/z^4 + 0.2/z^5);
+disp(H5z,'FIR filter = ');
+G5=horner(H5z,-1/z);
+G5z=G5/z^5;
+disp(G5z,'FIR filter = ');
+k5=0.2;
+H3z=(1/(1+k5^2))*(H5z - k5*G5z);
+disp(H3z,'Synthesis eqn,H3z = ');
+G3z=(1/(1+k5^2))*(k5*H5z + G5z);
+disp(G3z,'Synthesis eqn,G3z = ');
+k=coeff(numer(G3z));
+disp(k(4),'k3 = ');
+disp(k(2),'k1 = '); \ No newline at end of file
diff --git a/692/CH8/EX8.6/P8_6.sce b/692/CH8/EX8.6/P8_6.sce
new file mode 100755
index 000000000..a89682d8f
--- /dev/null
+++ b/692/CH8/EX8.6/P8_6.sce
@@ -0,0 +1,7 @@
+//Example 8.6
+//Factorization of FIR Transfer Function
+clear;
+clc;
+z=%z;
+Hz=50.4+28.02/z+13.89/z^2+7.42/z^3+6.09/z^4+3/z^5+1/z^6;
+disp(factors(numer(Hz)),'The Factors of the FIR Transfer Function are = '); \ No newline at end of file
diff --git a/692/CH8/EX8.7/P8_7.sce b/692/CH8/EX8.7/P8_7.sce
new file mode 100755
index 000000000..b65fbf755
--- /dev/null
+++ b/692/CH8/EX8.7/P8_7.sce
@@ -0,0 +1,13 @@
+//Example 8.7
+//Factorization of IIR Transfer Function
+clear;
+clc;
+z=%z;
+//Numerator of the transfer function
+Numz=6+17.1/z+33.05/z^2+24.72/z^3+19.908/z^4-5.292/z^5+18.144/z^6;
+//Denominator of the transfer function
+Denz=1+2.2/z+2.56/z^2+1.372/z^3+0.118/z^4-0.332/z^5-0.168/z^6;
+Fn=factors(numer(Numz));
+disp(Fn,'Factors of the numerator of the Transfer Function = ');
+Fd=factors(numer(Denz));
+disp(Fd,'Factors of the denominator of the Transfer Function = '); \ No newline at end of file