diff options
author | prashantsinalkar | 2017-10-10 12:27:19 +0530 |
---|---|---|
committer | prashantsinalkar | 2017-10-10 12:27:19 +0530 |
commit | 7f60ea012dd2524dae921a2a35adbf7ef21f2bb6 (patch) | |
tree | dbb9e3ddb5fc829e7c5c7e6be99b2c4ba356132c /2279/CH7/EX7.17/Ex7_17.sce | |
parent | b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (diff) | |
download | Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.gz Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.bz2 Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.zip |
initial commit / add all books
Diffstat (limited to '2279/CH7/EX7.17/Ex7_17.sce')
-rw-r--r-- | 2279/CH7/EX7.17/Ex7_17.sce | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/2279/CH7/EX7.17/Ex7_17.sce b/2279/CH7/EX7.17/Ex7_17.sce new file mode 100644 index 000000000..7a9b0c450 --- /dev/null +++ b/2279/CH7/EX7.17/Ex7_17.sce @@ -0,0 +1,32 @@ +//Discrete Time Fourier Transform of discrete sequence
+//x[n]= (a^n).u[-n], |a|>1
+clear;
+clc;
+close;
+a1 = 3;
+min_limit = -20;
+n = min_limit:0
+for i=1:length(n)
+ x1(i) = (a1^n(i));
+end
+Wmax = 2*%pi;
+K = 4;
+k = 0:(K/1000):K;
+W = k*Wmax/K;
+x1 = x1';
+XW1 = x1* exp(-sqrt(-1)*n'*W);
+XW1_Mag = abs(XW1);
+W = [-mtlb_fliplr(W), W(2:1001)]; // Omega from -Wmax to Wmax
+XW1_Mag = [mtlb_fliplr(XW1_Mag), XW1_Mag(2:1001)];
+[XW1_Phase,db] = phasemag(XW1);
+XW1_Phase = [-mtlb_fliplr(XW1_Phase),XW1_Phase(2:1001)];
+subplot(3,1,1);
+plot2d3('gnn',n,x1);
+xtitle('Discrete Time Sequence x[n]','n','x[n]')
+subplot(3,1,2);
+plot2d(W,XW1_Mag);
+xtitle('Magnitude Response abs(X(jW))','w','|X(jW)|')
+subplot(3,1,3);
+plot2d(W,XW1_Phase);
+xtitle('Phase Response <(X(jW))','w','<(X(jW))')
+
|