summaryrefslogtreecommitdiff
path: root/2294/CH4/EX4.9/EX4_9.sce
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /2294/CH4/EX4.9/EX4_9.sce
downloadScilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.gz
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.bz2
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.zip
initial commit / add all books
Diffstat (limited to '2294/CH4/EX4.9/EX4_9.sce')
-rwxr-xr-x2294/CH4/EX4.9/EX4_9.sce31
1 files changed, 31 insertions, 0 deletions
diff --git a/2294/CH4/EX4.9/EX4_9.sce b/2294/CH4/EX4.9/EX4_9.sce
new file mode 100755
index 000000000..96a57d8ac
--- /dev/null
+++ b/2294/CH4/EX4.9/EX4_9.sce
@@ -0,0 +1,31 @@
+//Find the covolution Of the following signals.
+//Example 4.9
+clc;
+clear;
+close;
+t=-10:.01:10;
+//input signal:x(t)=u(t-3)-u(t-5)
+for i=1:length(t)
+ if t(i)<3 | t(i)>5 then
+ x(i)=0;
+ else
+ x(i)=1;
+ end
+ //h(t)=exp(-3*t)*u(t)
+ if t(i)>=0 then
+ h(i)=exp(-3.*t(i));
+else
+ h(i)=0;
+end
+end
+y=convol(h,x);//cconvolution of the above two signals
+subplot(3,1,1);
+plot(t,h,'red');
+xtitle('input response 2','t','h[t]');
+subplot(3,1,2);
+plot(t,x,'blue');
+xtitle('input response 2','t','x[t]');
+subplot(3,1,3);
+t1=-20:.01:20;
+plot(t1,y,'green');
+xtitle('output response','t','y[t1]');