diff options
author | priyanka | 2015-06-24 15:03:17 +0530 |
---|---|---|
committer | priyanka | 2015-06-24 15:03:17 +0530 |
commit | b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch) | |
tree | ab291cffc65280e58ac82470ba63fbcca7805165 /2294/CH3/EX6.0/EX_6.sce | |
download | Scilab-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/CH3/EX6.0/EX_6.sce')
-rwxr-xr-x | 2294/CH3/EX6.0/EX_6.sce | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/2294/CH3/EX6.0/EX_6.sce b/2294/CH3/EX6.0/EX_6.sce new file mode 100755 index 000000000..d04dd288b --- /dev/null +++ b/2294/CH3/EX6.0/EX_6.sce @@ -0,0 +1,38 @@ +//Example 6 0f question and answer section
+clc;
+clear; close;
+n=-5:.01:5;
+for i=1:length(n)
+ if n(i)<0 then
+ x(i)=0;h1(i)=0;h2(i)=0;
+ else
+ x(i)=1;h1(i)=2;h2(i)=3;
+ end
+ h3(i)=h1(i)+h2(i)//when in parallel
+ h4(i)=h1(i).*h2(i)//when in series
+end
+y1=convol(x,h3);
+y2=convol(x,h4);
+subplot(4,2,1);
+plot(n,x,'black');
+xtitle('x[n]');
+subplot(4,2,2);
+plot(n,h1,'red');
+xtitle('h1[n]');
+subplot(4,2,3);
+plot(n,h2,'red');
+xtitle('h2[n]');
+subplot(4,2,4);
+plot(n,h3,'blue');
+xtitle('h3[n]');
+subplot(4,2,5);
+plot(n,h4,'blue');
+xtitle('h4[n]');
+subplot(4,2,6);
+n1=-10:.01:10;
+plot(n1,y1,'green');
+xtitle('y1[n]');
+subplot(4,2,7);
+n1=-10:.01:10;
+plot(n1,y2,'green');
+xtitle('y2[n]');
|