From 7f60ea012dd2524dae921a2a35adbf7ef21f2bb6 Mon Sep 17 00:00:00 2001 From: prashantsinalkar Date: Tue, 10 Oct 2017 12:27:19 +0530 Subject: initial commit / add all books --- 2279/CH7/EX7.16/Ex7_16.sce | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 2279/CH7/EX7.16/Ex7_16.sce (limited to '2279/CH7/EX7.16') diff --git a/2279/CH7/EX7.16/Ex7_16.sce b/2279/CH7/EX7.16/Ex7_16.sce new file mode 100644 index 000000000..15079a5fb --- /dev/null +++ b/2279/CH7/EX7.16/Ex7_16.sce @@ -0,0 +1,32 @@ +//Discrete Time Fourier Transform of discrete sequence +//x[n]= (a^n).u[n], |a|<1 +clear; +clc; +close; +a1 = 0.5; +max_limit = 10; +for n = 0:max_limit-1 + x1(n+1) = (a1^n); +end +n = 0:max_limit-1; +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 = 2.5*[mtlb_fliplr(XW1_Mag), XW1_Mag(2:1001)]; +[XW1_Phase,db] = phasemag(XW1); +XW1_Phase = (1/30)*[-mtlb_fliplr(XW1_Phase),XW1_Phase(2:1001)]; +subplot(3,1,1); +plot2d3('gnn',n,x1); +xtitle('Discrete Time Sequence x[n]') +subplot(3,1,2); +plot2d(W,XW1_Mag); +title('Magnitude Response abs(X(jW))') +subplot(3,1,3); +plot2d(W,XW1_Phase); +title('Phase Response <(X(jW))') + -- cgit