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 --- 62/CH2/EX2.5/ex_2_5.sce | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100755 62/CH2/EX2.5/ex_2_5.sce (limited to '62/CH2/EX2.5/ex_2_5.sce') diff --git a/62/CH2/EX2.5/ex_2_5.sce b/62/CH2/EX2.5/ex_2_5.sce new file mode 100755 index 000000000..3dedb04ec --- /dev/null +++ b/62/CH2/EX2.5/ex_2_5.sce @@ -0,0 +1,33 @@ +//Example 2.4:Convolution Integral +clear; +close; +clc; +t =-5:1/100:5; +for i=1:length(t) + if t(i)<0 then + h(i)=0; + x(i)=exp(t(i)); + else + h(i)=exp(-t(i)); + x(i)=0; + end +end +y = convol(x,h)./100; +figure +a=gca(); +a.x_location="origin"; +plot2d(t,h) +xtitle('Impulse Response','t','h(t)'); +a.thickness = 2; +figure +a=gca(); +plot2d(t,x) +xtitle('Input Response','t','x(t)'); +a.thickness = 2; +figure +a=gca(); +t1=-10:1/100:10; +a.y_location="origin"; +plot2d(t1,y) +xtitle('Output Response','t','y(t)'); +a.thickness = 2; -- cgit