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 --- 1592/CH7/EX7.1/Example_7_1.sce | 26 ++++++++++++++++++++++++++ 1592/CH7/EX7.10/Example_7_10.sce | 13 +++++++++++++ 1592/CH7/EX7.10/Fig7_10.jpg | Bin 0 -> 8623 bytes 1592/CH7/EX7.11/Example_7_11.sce | 31 +++++++++++++++++++++++++++++++ 1592/CH7/EX7.11/Fig7_11_3.jpg | Bin 0 -> 5704 bytes 1592/CH7/EX7.14/Example_7_14.sce | 27 +++++++++++++++++++++++++++ 1592/CH7/EX7.14/Fig7_14_1.jpg | Bin 0 -> 6327 bytes 1592/CH7/EX7.14/Fig7_14_2.jpg | Bin 0 -> 6301 bytes 1592/CH7/EX7.15/Example_7_15.sce | 28 ++++++++++++++++++++++++++++ 1592/CH7/EX7.15/Fig7_15_1.jpg | Bin 0 -> 6301 bytes 1592/CH7/EX7.15/Fig7_15_2.jpg | Bin 0 -> 6327 bytes 1592/CH7/EX7.19/Example_7_19.sce | 32 ++++++++++++++++++++++++++++++++ 1592/CH7/EX7.19/Fig7_19_3.jpg | Bin 0 -> 6637 bytes 1592/CH7/EX7.22/Example_7_22.sce | 37 +++++++++++++++++++++++++++++++++++++ 1592/CH7/EX7.22/Fig7_22_3.jpg | Bin 0 -> 7173 bytes 1592/CH7/EX7.23/Example_7_23.sce | 36 ++++++++++++++++++++++++++++++++++++ 1592/CH7/EX7.23/Fig7_23_3.jpg | Bin 0 -> 7821 bytes 1592/CH7/EX7.24/Example_7_24.sce | 15 +++++++++++++++ 1592/CH7/EX7.24/Fig7_24.jpg | Bin 0 -> 6166 bytes 1592/CH7/EX7.25/Example_7_25.sce | 21 +++++++++++++++++++++ 1592/CH7/EX7.25/Fig7_25.jpg | Bin 0 -> 5392 bytes 1592/CH7/EX7.3/Example_7_3.sce | 27 +++++++++++++++++++++++++++ 1592/CH7/EX7.33/Example_7_33.sce | 29 +++++++++++++++++++++++++++++ 1592/CH7/EX7.33/Fig7_33_1.jpg | Bin 0 -> 7222 bytes 1592/CH7/EX7.33/Fig7_33_2.jpg | Bin 0 -> 6402 bytes 1592/CH7/EX7.4/Example_7_4.sce | 36 ++++++++++++++++++++++++++++++++++++ 1592/CH7/EX7.5/Example_7_5.sce | 36 ++++++++++++++++++++++++++++++++++++ 1592/CH7/EX7.6/Example_7_6.sce | 20 ++++++++++++++++++++ 1592/CH7/EX7.7/Example_7_7.sce | 35 +++++++++++++++++++++++++++++++++++ 1592/CH7/EX7.8/Example_7_8.sce | 23 +++++++++++++++++++++++ 1592/CH7/EX7.9/Example_7_9.sce | 31 +++++++++++++++++++++++++++++++ 31 files changed, 503 insertions(+) create mode 100755 1592/CH7/EX7.1/Example_7_1.sce create mode 100755 1592/CH7/EX7.10/Example_7_10.sce create mode 100755 1592/CH7/EX7.10/Fig7_10.jpg create mode 100755 1592/CH7/EX7.11/Example_7_11.sce create mode 100755 1592/CH7/EX7.11/Fig7_11_3.jpg create mode 100755 1592/CH7/EX7.14/Example_7_14.sce create mode 100755 1592/CH7/EX7.14/Fig7_14_1.jpg create mode 100755 1592/CH7/EX7.14/Fig7_14_2.jpg create mode 100755 1592/CH7/EX7.15/Example_7_15.sce create mode 100755 1592/CH7/EX7.15/Fig7_15_1.jpg create mode 100755 1592/CH7/EX7.15/Fig7_15_2.jpg create mode 100755 1592/CH7/EX7.19/Example_7_19.sce create mode 100755 1592/CH7/EX7.19/Fig7_19_3.jpg create mode 100755 1592/CH7/EX7.22/Example_7_22.sce create mode 100755 1592/CH7/EX7.22/Fig7_22_3.jpg create mode 100755 1592/CH7/EX7.23/Example_7_23.sce create mode 100755 1592/CH7/EX7.23/Fig7_23_3.jpg create mode 100755 1592/CH7/EX7.24/Example_7_24.sce create mode 100755 1592/CH7/EX7.24/Fig7_24.jpg create mode 100755 1592/CH7/EX7.25/Example_7_25.sce create mode 100755 1592/CH7/EX7.25/Fig7_25.jpg create mode 100755 1592/CH7/EX7.3/Example_7_3.sce create mode 100755 1592/CH7/EX7.33/Example_7_33.sce create mode 100755 1592/CH7/EX7.33/Fig7_33_1.jpg create mode 100755 1592/CH7/EX7.33/Fig7_33_2.jpg create mode 100755 1592/CH7/EX7.4/Example_7_4.sce create mode 100755 1592/CH7/EX7.5/Example_7_5.sce create mode 100755 1592/CH7/EX7.6/Example_7_6.sce create mode 100755 1592/CH7/EX7.7/Example_7_7.sce create mode 100755 1592/CH7/EX7.8/Example_7_8.sce create mode 100755 1592/CH7/EX7.9/Example_7_9.sce (limited to '1592/CH7') diff --git a/1592/CH7/EX7.1/Example_7_1.sce b/1592/CH7/EX7.1/Example_7_1.sce new file mode 100755 index 000000000..eec48bb7c --- /dev/null +++ b/1592/CH7/EX7.1/Example_7_1.sce @@ -0,0 +1,26 @@ +//Scilab Code for Example 7.1 of Signals and systems by +//P.Ramakrishna Rao +clc; +clear; +a0=2; +a1=2; +a2=4; +x1=[1,3,5,7]; +x2=[2,4,6,8]; +for t=1:4 + y1(1,t)=a0+a1*x1(t)+a2*(x1(t))^2; + y2(1,t)=a0+a1*x2(t)+a2*(x2(t))^2; +end +b1=2; +b2=3; +x=b1*x1+b2*x2; +disp('y(n) does not depend on past inputs'); +disp('Hence the system is Static'); +disp(x,'The input to the system is:'); +for t=1:4 + q(1,t)=a0+a1*x(t)+a2*(x(t))^2; +end +disp(q,'This input gives the output:'); +y=b1*y1+b2*y2; +disp(y,'For the system to be linear the output should be:'); +disp('Hence the system is not linear'); diff --git a/1592/CH7/EX7.10/Example_7_10.sce b/1592/CH7/EX7.10/Example_7_10.sce new file mode 100755 index 000000000..cb27e58d6 --- /dev/null +++ b/1592/CH7/EX7.10/Example_7_10.sce @@ -0,0 +1,13 @@ +//Scilab Code for Example 7.10 of Signals and systems by +//P.Ramakrishna Rao +clear; +clc; +disp('h(t)=e^-2*t.u(t)'); +for w=1:100 + y(1,w)=integrate('exp(-2*t)','t',0,w); +end +w=1:100; +plot(w,y) +title('Output Signal y(t)'); +xlabel('Time'); +ylabel('Amplitude'); diff --git a/1592/CH7/EX7.10/Fig7_10.jpg b/1592/CH7/EX7.10/Fig7_10.jpg new file mode 100755 index 000000000..9ad360b0e Binary files /dev/null and b/1592/CH7/EX7.10/Fig7_10.jpg differ diff --git a/1592/CH7/EX7.11/Example_7_11.sce b/1592/CH7/EX7.11/Example_7_11.sce new file mode 100755 index 000000000..9510a506b --- /dev/null +++ b/1592/CH7/EX7.11/Example_7_11.sce @@ -0,0 +1,31 @@ +//Scilab Code for Example 7.11 of Signals and systems by +//P.Ramakrishna Rao +clear; +clc; +clear x y n; +x=[0,0,2,0,0]; +y=[0,0,1,1,0]; +n=-2:2; +c = gca(); +c.y_location = "origin"; +c.x_location = "origin"; +plot2d2(n,x,2); +title('x(t)') +xlabel('t') +figure(1); +n=-2:2; +c = gca(); +c.y_location = "origin"; +c.x_location = "origin"; +plot2d2(n,y,5); +title('y(t)') +xlabel('t') +z=conv(x,y); +figure(2); +n=-3:5; +c = gca(); +c.y_location = "origin"; +c.x_location = "origin"; +plot(n,z,2); +title('Convoluted signal z(t)') +xlabel('t') diff --git a/1592/CH7/EX7.11/Fig7_11_3.jpg b/1592/CH7/EX7.11/Fig7_11_3.jpg new file mode 100755 index 000000000..4f7dcb59a Binary files /dev/null and b/1592/CH7/EX7.11/Fig7_11_3.jpg differ diff --git a/1592/CH7/EX7.14/Example_7_14.sce b/1592/CH7/EX7.14/Example_7_14.sce new file mode 100755 index 000000000..62b0f61be --- /dev/null +++ b/1592/CH7/EX7.14/Example_7_14.sce @@ -0,0 +1,27 @@ +//Scilab Code for Example 7.14 of Signals and systems by +//P.Ramakrishna Rao +//Plotting the impulse and step responses +clc; +clear; +syms s t R C; +Y1=(1/(R*C))/(s+1/(R*C)); +disp(Y1,'Laplace Transform Of differential Equation is:') +y11=ilaplace(Y1,s,t); +disp(y11,'The Impulse Response of the System is:'); +for k=0:10; + y1(k+1)=exp(-k); +end +k=0:10; +plot(k,y1); +title('System Response to impulse input'); +Y2=(1/(R*C))/(s^2+s/(R*C)); +disp(Y2,'Laplace Transform Of differential Equation is:') +y22=ilaplace(Y2,s,t); +disp(y22,'The Step Response of the System is:'); +for k=0:10; + y2(k+1)=1-exp(-k); +end +figure(1); +k=0:10; +plot(k,y2); +title('System Response to Step input'); diff --git a/1592/CH7/EX7.14/Fig7_14_1.jpg b/1592/CH7/EX7.14/Fig7_14_1.jpg new file mode 100755 index 000000000..14281b17c Binary files /dev/null and b/1592/CH7/EX7.14/Fig7_14_1.jpg differ diff --git a/1592/CH7/EX7.14/Fig7_14_2.jpg b/1592/CH7/EX7.14/Fig7_14_2.jpg new file mode 100755 index 000000000..f129de8fc Binary files /dev/null and b/1592/CH7/EX7.14/Fig7_14_2.jpg differ diff --git a/1592/CH7/EX7.15/Example_7_15.sce b/1592/CH7/EX7.15/Example_7_15.sce new file mode 100755 index 000000000..67abee2df --- /dev/null +++ b/1592/CH7/EX7.15/Example_7_15.sce @@ -0,0 +1,28 @@ +//Scilab Code for Example 7.15 of Signals and systems by +//P.Ramakrishna Rao +//Plotting the impulse and step responses +clc; +clear; +syms s t R L; +Y1=(1/s)-(1/(s+(R/L))); +disp(Y1,'Laplace Transform Of differential Equation is:') +y1=ilaplace(Y1,s,t); +disp(y1,'The Step Response of the System is:'); +//Taking R/L=1; +for k=0:10; + y1(k+1)=1-exp(-k); +end +k=0:10; +plot(k,y1); +title('System Response to Step input'); +Y2=(1/(s+(R/L))); +disp(Y2,'Laplace Transform Of differential Equation is:') +y2=ilaplace(Y2,s,t); +disp(y2,'The Impulse Response of the System is:'); +for k=0:10; + y2(k+1)=exp(-k); +end +figure(1); +k=0:10; +plot(k,y2); +title('System Response to impulse input'); diff --git a/1592/CH7/EX7.15/Fig7_15_1.jpg b/1592/CH7/EX7.15/Fig7_15_1.jpg new file mode 100755 index 000000000..f129de8fc Binary files /dev/null and b/1592/CH7/EX7.15/Fig7_15_1.jpg differ diff --git a/1592/CH7/EX7.15/Fig7_15_2.jpg b/1592/CH7/EX7.15/Fig7_15_2.jpg new file mode 100755 index 000000000..14281b17c Binary files /dev/null and b/1592/CH7/EX7.15/Fig7_15_2.jpg differ diff --git a/1592/CH7/EX7.19/Example_7_19.sce b/1592/CH7/EX7.19/Example_7_19.sce new file mode 100755 index 000000000..e188cc9aa --- /dev/null +++ b/1592/CH7/EX7.19/Example_7_19.sce @@ -0,0 +1,32 @@ +//Scilab Code for Example 7.19 of Signals and systems by +//P.Ramakrishna Rao +//Convolution of two signals +clc; +clear; +clear x y n; +x=[2,-1,1,0,2]; +y=[1,0,-1,2]; +n=-1:3; +c = gca(); +c.y_location = "origin"; +c.x_location = "origin"; +plot2d3(n,x,-5); +title('x(k)') +xlabel('k') +figure(1); +n=0:3; +c = gca(); +c.y_location = "origin"; +c.x_location = "origin"; +plot2d3(n,y,-5); +title('y(k)') +xlabel('k') +z=conv(x,y); +figure(2); +n=-1:6; +c = gca(); +c.y_location = "origin"; +c.x_location = "origin"; +plot2d3(n,z,-5); +title('Convoluted signal z(t)') +xlabel('t') diff --git a/1592/CH7/EX7.19/Fig7_19_3.jpg b/1592/CH7/EX7.19/Fig7_19_3.jpg new file mode 100755 index 000000000..1be47a067 Binary files /dev/null and b/1592/CH7/EX7.19/Fig7_19_3.jpg differ diff --git a/1592/CH7/EX7.22/Example_7_22.sce b/1592/CH7/EX7.22/Example_7_22.sce new file mode 100755 index 000000000..e063736b4 --- /dev/null +++ b/1592/CH7/EX7.22/Example_7_22.sce @@ -0,0 +1,37 @@ +//Scilab Code for Example 7.22 of Signals and systems by +//P.Ramakrishna Rao +//Convolution of two signals +clc; +clear; +clear x y n; +for n=0:10; + x(n+1)=(3/4)^n*u(n); +end +c = gca(); +c.y_location = "origin"; +c.x_location = "origin"; +n=0:10; +plot2d3(n,x,-4); +title('x(n)') +xlabel('n') +for n=0:10; + y(n+1)=u(n); +end +figure(1); +n=0:10; +c = gca(); +c.y_location = "origin"; +c.x_location = "origin"; +plot2d3(n,y,-4); +title('y(k)') +xlabel('k') +z=conv(x,y); +figure(2); +n=0:20; +c = gca(); +c.y_location = "origin"; +c.x_location = "origin"; +plot2d3(n,z,-4); +title('Convoluted signal w(t)'); +xlabel('t'); +disp(z(1),'z(0)',z(4),'z(3)',z(6),'z(5)',z(11),'z(10)'); diff --git a/1592/CH7/EX7.22/Fig7_22_3.jpg b/1592/CH7/EX7.22/Fig7_22_3.jpg new file mode 100755 index 000000000..3f79d5e61 Binary files /dev/null and b/1592/CH7/EX7.22/Fig7_22_3.jpg differ diff --git a/1592/CH7/EX7.23/Example_7_23.sce b/1592/CH7/EX7.23/Example_7_23.sce new file mode 100755 index 000000000..b24378108 --- /dev/null +++ b/1592/CH7/EX7.23/Example_7_23.sce @@ -0,0 +1,36 @@ +//Scilab Code for Example 7.23 of Signals and systems by +//P.Ramakrishna Rao +//Convolution of two signals +clc; +clear; +clear x y n; +for n=0:10; + x(n+1)=(0.5)^n*u(n-2); +end +c = gca(); +c.y_location = "origin"; +c.x_location = "origin"; +n=0:10; +plot2d3(n,x,-4); +title('x(n)') +xlabel('n') +for n=0:10; + y(n+1)=u(n); +end +figure(1); +n=0:10; +c = gca(); +c.y_location = "origin"; +c.x_location = "origin"; +plot2d3(n,y,-4); +title('y(k)') +xlabel('k') +z=conv(x,y); +figure(2); +n=0:20; +c = gca(); +c.y_location = "origin"; +c.x_location = "origin"; +plot2d3(n,z,-4); +title('Convoluted signal z(t)') +xlabel('t') diff --git a/1592/CH7/EX7.23/Fig7_23_3.jpg b/1592/CH7/EX7.23/Fig7_23_3.jpg new file mode 100755 index 000000000..a59d3d866 Binary files /dev/null and b/1592/CH7/EX7.23/Fig7_23_3.jpg differ diff --git a/1592/CH7/EX7.24/Example_7_24.sce b/1592/CH7/EX7.24/Example_7_24.sce new file mode 100755 index 000000000..e2f810ea0 --- /dev/null +++ b/1592/CH7/EX7.24/Example_7_24.sce @@ -0,0 +1,15 @@ +//Scilab Code for Example 7.24 of Signals and systems by +//P.Ramakrishna Rao +//Plotting the step response +clc; +clear; +syms z n; +y1=2*(1-0.5^n); +disp(y1*'u(n)','The step Response of the System is:'); +for n=0:10; + q(n+1)=2*(1-0.5^n); +end +n=0:10; +plot(n,q); +title('Step Response g(n)'); +xlabel('n-->'); diff --git a/1592/CH7/EX7.24/Fig7_24.jpg b/1592/CH7/EX7.24/Fig7_24.jpg new file mode 100755 index 000000000..e52ac4a9f Binary files /dev/null and b/1592/CH7/EX7.24/Fig7_24.jpg differ diff --git a/1592/CH7/EX7.25/Example_7_25.sce b/1592/CH7/EX7.25/Example_7_25.sce new file mode 100755 index 000000000..aacc9cb9c --- /dev/null +++ b/1592/CH7/EX7.25/Example_7_25.sce @@ -0,0 +1,21 @@ +//Scilab Code for Example 7.25 of Signals and systems by +//P.Ramakrishna Rao +//Plotting the impulse and step responses +clc; +clear; +syms z a n; +Y1=(2*z/(z-a)); +disp(Y1,'Z Transform Of differential Equation is:') +y12=2*a^n; +disp(y12,'The Unit Sample Response of the System is:'); +y2=2*(a^n-1)/(a-1); +disp(y2,'The Step Response of the System is:'); +q=1; +a=0.5; +for k=0:0.1:5; +y2(q)=2*((a^k-1)/(a-1)); +q=q+1; +end +k=0:0.1:5; +plot(k,y2); + diff --git a/1592/CH7/EX7.25/Fig7_25.jpg b/1592/CH7/EX7.25/Fig7_25.jpg new file mode 100755 index 000000000..4b4bac75c Binary files /dev/null and b/1592/CH7/EX7.25/Fig7_25.jpg differ diff --git a/1592/CH7/EX7.3/Example_7_3.sce b/1592/CH7/EX7.3/Example_7_3.sce new file mode 100755 index 000000000..7716a72d0 --- /dev/null +++ b/1592/CH7/EX7.3/Example_7_3.sce @@ -0,0 +1,27 @@ +//Scilab Code for Example 7.3 of Signals and systems by +//P.Ramakrishna Rao +clc; +clear x y1 y y2 q t n; +clear; +//y(n)=x(n)-x(n-1); +disp('y(n) depends upon past inputs also'); +disp('Output at n=2 depends upon value of x at n=1'); +disp('Hence the system is Dynamic'); +x1=[1,3,5,7,2]; +x2=[2,4,6,8,3]; +for n=2:5 + y1(1,n)=x1(n)-x1(n-1) + y2(1,n)=x2(n)-x2(n-1) +end +b1=2; +b2=3; +x=b1*x1+b2*x2 +disp(x,'The input to the system is:'); +for n=2:5 + q(1,n)=x(n)-x(n-1); +end +y=b1*y1+b2*y2; +disp(q,'This input gives the output:'); +disp(y,'For the system to be linear the output should be:'); +disp('Hence the system is linear'); + diff --git a/1592/CH7/EX7.33/Example_7_33.sce b/1592/CH7/EX7.33/Example_7_33.sce new file mode 100755 index 000000000..067b9055c --- /dev/null +++ b/1592/CH7/EX7.33/Example_7_33.sce @@ -0,0 +1,29 @@ +//Scilab Code for Example 7.33 of Signals and systems by +//P.Ramakrishna Rao +//Plotting the magnitude and phase responses +clc; +clear; +T=1; +n=1; +for w=0:0.1:20; + hmag(n)=2*sin(w*T/2); + n=n+1; +end +n=1; +for w=0:0.1:20; + hphase(n)=%pi/2-(w*T/2); + n=n+1; +end +//Magnitude plot +w=0:0.1:20; +plot(w,hmag); +title('Magnitude Plot'); +xlabel('w'); +ylabel('|H(e^jw)|'); +figure(1); +//Phase Plot +w=0:0.1:20; +plot(w,hphase); +title('Phase Plot'); +xlabel('w'); +ylabel('theta(wT)'); diff --git a/1592/CH7/EX7.33/Fig7_33_1.jpg b/1592/CH7/EX7.33/Fig7_33_1.jpg new file mode 100755 index 000000000..4950368c9 Binary files /dev/null and b/1592/CH7/EX7.33/Fig7_33_1.jpg differ diff --git a/1592/CH7/EX7.33/Fig7_33_2.jpg b/1592/CH7/EX7.33/Fig7_33_2.jpg new file mode 100755 index 000000000..14bc76dfa Binary files /dev/null and b/1592/CH7/EX7.33/Fig7_33_2.jpg differ diff --git a/1592/CH7/EX7.4/Example_7_4.sce b/1592/CH7/EX7.4/Example_7_4.sce new file mode 100755 index 000000000..ea6ffb06b --- /dev/null +++ b/1592/CH7/EX7.4/Example_7_4.sce @@ -0,0 +1,36 @@ +//Scilab Code for Example 7.4 of Signals and systems by +//P.Ramakrishna Rao +clc; +clear x y1 y y2 q t n; +clear; +//y(t)=x(2*t) +disp('y(t) depends upon past inputs for t<0'); +disp('y(t) depends upon future inputs for t>0'); +disp('Hence the system is Dynamic'); +x1=[1,3,5,7,2,5,3,9];//Random Variable +x2=[2,4,6,8,2,4,2,1]; +for t=1:4 + y1(1,t)=x1(2*t); + y2(1,t)=x2(2*t); +end +b1=2; +b2=3; +x=b1*x1+b2*x2; +disp(x,'The input to the system is:'); +for t=1:4 + q(1,t)=x(2*t); +end +disp(q,'This input gives the output:'); +y=b1*y1+b2*y2; +disp(y,'For the system to be linear the output should be:'); +disp('Hence the system is linear'); +disp('For a delay (T) of 2 seconds'); +disp('At t=3 seconds:'); +t=3; +a=x(1,2*t-2); +b=y(1,t-2); +c=x(1,2*t-4); +disp(a,'x(2t-T):'); +disp(b,'is not equal to y(2t-T):'); +disp(c,'while x(2t-2*T):'); +disp('Hence the system is Time variant'); diff --git a/1592/CH7/EX7.5/Example_7_5.sce b/1592/CH7/EX7.5/Example_7_5.sce new file mode 100755 index 000000000..2df5f0f7a --- /dev/null +++ b/1592/CH7/EX7.5/Example_7_5.sce @@ -0,0 +1,36 @@ +//Scilab Code for Example 7.5 of Signals and systems by +//P.Ramakrishna Rao +clc; +clear x y1 y y2 q t n; +clear; +//y(t)=x(2*n) +disp('y(n) depends upon past inputs for n<0'); +disp('y(n) depends upon future inputs for n>0'); +disp('Hence the system is Dynamic'); +x1=[1,3,5,3,2,5,3,9];//random variable +x2=[2,4,6,4,2,4,2,1]; +for n=1:4 + y1(1,n)=x1(2*n); + y2(1,n)=x2(2*n); +end +b1=2; +b2=3; +x=b1*x1+b2*x2; +disp(x,'The input to the system is:'); +for n=1:4 + q(1,n)=x(2*n); +end +disp(q,'This input gives the output:'); +y=b1*y1+b2*y2; +disp(y,'For the system to be linear the output should be:'); +disp('Hence the system is linear'); +disp('For a delay (n0) of 2 seconds'); +disp('At n=3 seconds:'); +t=3; +a=x(1,2*n-2); +b=y(1,n-2); +c=x(1,2*n-4); +disp(a,'x(2n-n0):'); +disp(b,'is not equal to y(2n-n0):'); +disp(c,'while x(2n-2*n0):'); +disp('Hence the system is Time variant'); diff --git a/1592/CH7/EX7.6/Example_7_6.sce b/1592/CH7/EX7.6/Example_7_6.sce new file mode 100755 index 000000000..754c5deff --- /dev/null +++ b/1592/CH7/EX7.6/Example_7_6.sce @@ -0,0 +1,20 @@ +//Scilab Code for Example 7.6 of Signals and systems by +//P.Ramakrishna Rao +clc; +clear x y1 y y2 q t n; +clear; +//y(n)=x(n)-x(n-1); +x=[2,4,3,6,7] +for n=2:5 + y(1,n)=x(n)-x(n-1); +end +disp(y,'This input gives the output:'); +disp('For a shift (n0) of 2 seconds'); +disp('At n=3 seconds:'); +n=5; +b=y(n-2); +a=x(n-2)-x(n-2-1); +disp(a,'x(n-2):'); +disp(b,'is equal to y(n-2):'); +disp('Hence the system is Shift invariant/fixed'); + diff --git a/1592/CH7/EX7.7/Example_7_7.sce b/1592/CH7/EX7.7/Example_7_7.sce new file mode 100755 index 000000000..1a302133c --- /dev/null +++ b/1592/CH7/EX7.7/Example_7_7.sce @@ -0,0 +1,35 @@ +//Scilab Code for Example 7.7 of Signals and systems by +//P.Ramakrishna Rao +clc; +clear x y1 y y2 q t n; +clear; +//y(t)=n*x(n) +disp('y(n) depends only upon present inputs'); +disp('(i) Hence the system is Dynamic'); +x1=[1,3,5,3,2,5,3,9];//random variable +x2=[2,4,6,4,2,4,2,1]; +for n=1:4 + y1(1,n)=n*x1(n); + y2(1,n)=n*x2(n); +end +b1=2; +b2=3; +x=b1*x1+b2*x2; +disp(x,'The input to the system is:'); +for n=1:4 + q(1,n)=n*x(n); +end +disp(q,'This input gives the output:'); +y=b1*y1+b2*y2; +disp(y,'For the system to be linear the output should be:'); +disp('(ii) Hence the system is linear'); +disp('For a delay (n0) of 2 seconds'); +disp('At n=3 seconds:'); +t=3; +a=x(1,n-2); +b=y(1,n-2); +c=2*x(1,n-2); +disp(a,'x(n-n0):'); +disp(b,'is not equal to y(n-n0):'); +disp(c,'while (n-n0)*x(n-n0):'); +disp('(iii) Hence the system is Time variant'); diff --git a/1592/CH7/EX7.8/Example_7_8.sce b/1592/CH7/EX7.8/Example_7_8.sce new file mode 100755 index 000000000..c5ef468b6 --- /dev/null +++ b/1592/CH7/EX7.8/Example_7_8.sce @@ -0,0 +1,23 @@ +//Scilab Code for Example 7.8 of Signals and systems by +//P.Ramakrishna Rao +clc; +clear x y1 y y2 q t n; +clear; +//y(t)=sum(x(n)),n-2<=n=