From b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b Mon Sep 17 00:00:00 2001 From: priyanka Date: Wed, 24 Jun 2015 15:03:17 +0530 Subject: initial commit / add all books --- 758/CH10/EX10.2/Ex_10_2.sce | 26 +++++++++++++++++++++++ 758/CH10/EX10.3/Ex_10_3.sce | 16 ++++++++++++++ 758/CH10/EX10.4/Ex_10_4.sce | 7 ++++++ 758/CH10/EX10.5/Ex_10_5.sce | 52 +++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 101 insertions(+) create mode 100755 758/CH10/EX10.2/Ex_10_2.sce create mode 100755 758/CH10/EX10.3/Ex_10_3.sce create mode 100755 758/CH10/EX10.4/Ex_10_4.sce create mode 100755 758/CH10/EX10.5/Ex_10_5.sce (limited to '758/CH10') diff --git a/758/CH10/EX10.2/Ex_10_2.sce b/758/CH10/EX10.2/Ex_10_2.sce new file mode 100755 index 000000000..a27ae701a --- /dev/null +++ b/758/CH10/EX10.2/Ex_10_2.sce @@ -0,0 +1,26 @@ +//Example 10.2 + +clc;clear;close; +z=poly(0,'z'); +H=0.5*z/(z-0.5); +B=8; +pn=2^(-2*B)/12; //Noise power +X=H*horner(H,1/z)/z; +r=roots(denom(X)); +rl=length(r); +rc=coeff(denom(X)) +q1=[];q2=[]; +for n=1:rl //Loop to separate poles inside the unit circle + if (abs(r(n))<1) then + q1=[q1 r(n)]; + else + q2=[q2 r(n)]; + end +end +P=numer(X)/rc(length(rc)); +Q1=poly(q1,'z'); +Q2=poly(q2,'z'); +I=residu(P,Q1,Q2); //Residue Calculation +po=pn*I; //Output Noise power +disp(pn,'Input Noise power'); +disp(po,'Output Noise power'); \ No newline at end of file diff --git a/758/CH10/EX10.3/Ex_10_3.sce b/758/CH10/EX10.3/Ex_10_3.sce new file mode 100755 index 000000000..0f7fe6c52 --- /dev/null +++ b/758/CH10/EX10.3/Ex_10_3.sce @@ -0,0 +1,16 @@ +//Example 10.3 + +clc; clear; +//y(n)=0.9y(n-1)+x(n) +//Input x(n)=0 +n=-1;y=12; //Initial Condition y(-1)=12 +flag=1; +while n<8 + n=n+1; + y=[y 0.9*y(n+1)]; + yr=round(y); +end +disp(n,'n='); +disp(y,'y(n)-exact'); +disp(yr,'y(n)-rounded'); +disp([-yr(n+2) yr(n+2)],'Deadband interval ') \ No newline at end of file diff --git a/758/CH10/EX10.4/Ex_10_4.sce b/758/CH10/EX10.4/Ex_10_4.sce new file mode 100755 index 000000000..0216a2f65 --- /dev/null +++ b/758/CH10/EX10.4/Ex_10_4.sce @@ -0,0 +1,7 @@ +//Example 10.4 + +clc; clear; +//y(n)=0.9y(n-1)+x(n) +a=0.9; +l=ceil(0.5/(1-abs(a))); +disp([-l l],'Deadband interval ') \ No newline at end of file diff --git a/758/CH10/EX10.5/Ex_10_5.sce b/758/CH10/EX10.5/Ex_10_5.sce new file mode 100755 index 000000000..5374722ce --- /dev/null +++ b/758/CH10/EX10.5/Ex_10_5.sce @@ -0,0 +1,52 @@ +//Example 10.5 + +clc;clear;close; +x=poly(0,'x'); //x=2^-2B +z=poly(0,'z'); +H1=1/(1-0.9/z); +H2=1/(1-0.8/z); +H=H1*H2; +pn=x/12; //Input Noise power + +//Calculation of output noise for H1(z) +X1=H*horner(H,1/z)/z; +r1=roots(denom(X1)); +rc1=coeff(denom(X1)); +q1=[];s1=[]; +for n=1:length(r1) //Loop to separate poles inside the unit circle + if (abs(r1(n))<1) then + q1=[q1 r1(n)]; + else + s1=[s1 r1(n)]; + end +end +P1=numer(X1)/rc1(length(rc1)); +Q1=poly(q1,'z'); +S1=poly(s1,'z'); +I1=abs(residu(P1,Q1,S1)); //Residue Calculation +po1=pn*I1; //Output Noise power + +//Calculation of output noise for H2(z) +X2=H2*horner(H2,1/z)/z; +r2=roots(denom(X2)); +rc2=coeff(denom(X2)); +q2=[];s2=[]; +for n=1:length(r2) //Loop to separate poles inside the unit circle + if (abs(r2(n))<1) then + q2=[q2 r2(n)]; + else + s2=[s2 r2(n)]; + end +end +P2=numer(X2)/rc2(length(rc2)); +Q2=poly(q2,'z'); +S2=poly(s2,'z'); +I2=abs(residu(P2,Q2,S2)); //Residue Calculation +po2=pn*I2; //Output Noise power + +po=po1+po2; +disp(pn,'Input Noise power'); +disp(I1,'I1=');disp(I2,'I2='); +disp(po1,'Output Noise power for H1(z)'); +disp(po2,'Output Noise power for H2(z)'); +disp(po,'Total Output Noise power'); \ No newline at end of file -- cgit