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/CH3/EX3.21/EX3_21.sce | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100755 2294/CH3/EX3.21/EX3_21.sce (limited to '2294/CH3/EX3.21') diff --git a/2294/CH3/EX3.21/EX3_21.sce b/2294/CH3/EX3.21/EX3_21.sce new file mode 100755 index 000000000..62f6d131b --- /dev/null +++ b/2294/CH3/EX3.21/EX3_21.sce @@ -0,0 +1,31 @@ +//Example 3.21 +//Determine the response of the below relaxed system. +clc; +close; + n=-10:.01:10; + for i=1:length(n) + if n(i)<0 then + h(i)=0;x(i)=0; + else + h(i)=(1/3)^n(i); + x(i)=2^n(i); + end + end + y=convol(h,x); + //figure + f=scf(0); + plot(n,h,'black'); + xtitle('input response1','n','h(n)'); + xs2jpg(0, 'problem29-plot-a.jpg'); +// figure +f=scf(1); + plot(n,x,'red'); + xtitle('input response2','n','x(n)'); + xs2jpg(1, 'problem29-plot-b.jpg'); +// figure +f=scf(2); + n1=-20:.01:20; + plot(n1,y,'green'); + xtitle('output response','n','y(n)'); + xs2jpg(2, 'problem29-plot-c.jpg'); + -- cgit