summaryrefslogtreecommitdiff
path: root/2294/CH8/EX8.19/EX8_19.sce
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /2294/CH8/EX8.19/EX8_19.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/CH8/EX8.19/EX8_19.sce')
-rwxr-xr-x2294/CH8/EX8.19/EX8_19.sce81
1 files changed, 81 insertions, 0 deletions
diff --git a/2294/CH8/EX8.19/EX8_19.sce b/2294/CH8/EX8.19/EX8_19.sce
new file mode 100755
index 000000000..1d6b00c14
--- /dev/null
+++ b/2294/CH8/EX8.19/EX8_19.sce
@@ -0,0 +1,81 @@
+
+//Example 8.19.1
+//Use fourier transform to determine the response of the following signal
+clc;
+clear all;
+n=-10:10
+for i=1:length(n)
+ if n(i)>=1 then
+ x(i)=(3/4)^n(i);
+ h(i)=(1/2)^n(i);
+ else
+ x(i)=0;
+ h(i)=0;
+ end
+end
+subplot(3,2,1)
+plot(x,n);
+xtitle('(a)x(n)');
+subplot(3,2,2)
+plot(h,n);
+xtitle('(b)h(n)');
+X=fft(x,-1);
+H=fft(h,-1);
+subplot(3,2,3)
+plot(X,n);
+xtitle('(c)X(n)');
+subplot(3,2,4)
+plot(H,n);
+xtitle('(d)H(n)');
+Y=H.*X;
+subplot(3,2,5)
+plot(Y,n);
+xtitle('(e)Y(n)');
+y=fft(Y,1);
+disp(y,'The output response is:');
+subplot(3,2,6)
+plot(y,n);
+xtitle('(f)y(n)');
+
+
+clf()
+
+//Example 8.19.2
+//Use fourier transform to determine the response of the following signal
+clc;
+clear;
+n=-10:10
+for i=1:length(n)
+ if n(i)>=1 then
+ x(i)=(-1)^n(i);
+ h(i)=(1/2)^n(i);
+ else
+ x(i)=0;
+ h(i)=0;
+ end
+end
+subplot(3,2,1)
+plot(x,n);
+xtitle('x(n)');
+subplot(3,2,2)
+plot(h,n);
+xtitle('h(n)');
+X=fft(x,-1);
+H=fft(h,-1);
+subplot(3,2,3)
+plot(X,n);
+xtitle('X(n)');
+subplot(3,2,4)
+plot(H,n);
+xtitle('H(n)');
+Y=H.*X;
+subplot(3,2,5)
+plot(Y,n);
+xtitle('Y(n)');
+y=fft(Y,1);
+disp(y,'The output response is:');
+subplot(3,2,6)
+plot(y,n);
+xtitle('y(n)');
+
+