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 --- 2294/CH4/EX4.6/EX4_6.sce | 110 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100755 2294/CH4/EX4.6/EX4_6.sce (limited to '2294/CH4/EX4.6/EX4_6.sce') diff --git a/2294/CH4/EX4.6/EX4_6.sce b/2294/CH4/EX4.6/EX4_6.sce new file mode 100755 index 000000000..a8f932ae3 --- /dev/null +++ b/2294/CH4/EX4.6/EX4_6.sce @@ -0,0 +1,110 @@ +//Find the covolution Of the following signals. +//Example 4.6 +clc; +clear; +close; +a=.5; +b=.6; +t=-4:.01:4; +for i=1:length(t) + if t(i)<0 then + x1(i)=0;x2(i)=0; + else + x1(i)=exp(-a.*t(i)); + x2(i)=exp(-b.*t(i)); + end +end +y=convol(x1,x2); +f=scf(0); +subplot(3,1,1); +plot(x1,t,'red'); +xtitle('x1[t]'); +subplot(3,1,2); +plot(x2,t,'blue'); +xtitle('x2[t]'); +subplot(3,1,3); +t1=-8:.01:8; +plot(t1,y,'green'); +xtitle('y[n]'); +xs2jpg(0, 'EX4_6_1-plot-a.jpg'); +//Find the covolution Of the following signals. +//Example 4.6 +clc; +clear; +close; +t=-4:.01:4; +for i=1:length(t) + if t(i)<0 then + x1(i)=0;x2(i)=0; + else + x1(i)=1; + x2(i)=1; + end +end +y=convol(x1,x2); +f=scf(0); +subplot(3,1,1); +plot(x1,t,'red'); +xtitle('x1[t]'); +subplot(3,1,2); +plot(x2,t,'blue'); +xtitle('x2[t]'); +subplot(3,1,3); +t1=-8:.01:8; +plot(t1,y,'green'); +xtitle('y[n]'); +xs2jpg(0, 'EX4_6_2-plot-a.jpg'); +//Find the covolution Of the following signals. +//Example 4.6 +clc; +clear; +close; +t=-4:.01:4; +for i=1:length(t) + if t(i)<0 then + x1(i)=0;x2(i)=0; + else + x1(i)=t(i); + x2(i)=1; + end +end +y=convol(x1,x2); +f=scf(0); +subplot(3,1,1); +plot(x1,t,'red'); +xtitle('x1[t]'); +subplot(3,1,2); +plot(x2,t,'blue'); +xtitle('x2[t]'); +subplot(3,1,3); +t1=-8:.01:8; +plot(t1,y,'green'); +xtitle('y[n]'); +xs2jpg(0, 'EX4_6_3-plot-a.jpg'); +//Find the covolution Of the following signals. +//Example 4.6 +clc; +clear; +close; +t=-4:.01:4; +for i=1:length(t) + if t(i)<0 then + x1(i)=0;x2(i)=0; + else + x1(i)=sin(t(i)); + x2(i)=1; + end +end +y=convol(x1,x2); +f=scf(0); +subplot(3,1,1); +plot(x1,t,'red'); +xtitle('x1[t]'); +subplot(3,1,2); +plot(x2,t,'blue'); +xtitle('x2[t]'); +subplot(3,1,3); +t1=-8:.01:8; +plot(t1,y,'green'); +xtitle('y[n]'); +xs2jpg(0, 'EX4_6_4-plot-a.jpg'); -- cgit