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 /692/CH3/EX3.12 | |
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 '692/CH3/EX3.12')
-rwxr-xr-x | 692/CH3/EX3.12/P3_12.sce | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/692/CH3/EX3.12/P3_12.sce b/692/CH3/EX3.12/P3_12.sce new file mode 100755 index 000000000..35c37dc00 --- /dev/null +++ b/692/CH3/EX3.12/P3_12.sce @@ -0,0 +1,42 @@ +//EXAMPLE 3.12 +//x[n]=((-1)^n)*(a^n)*u[n].....given a=0.5; + +clc; +clear; + +a=0.5; +n=0:9; +for i = 0:9 + x(i+1) = (a*exp(-%i*%pi))^i; +end + +//The DTFT of the sequence +K = 4; +k = 0:4/1000:4; +W = k*6*%pi/K; +X = (x')*exp(%i*n'*W); +X_mag = abs(X); +X_phase = phasemag(X); + +//PLOTTING GRAPHS FOR THE INTERVAL OF 0 TO 6*%pi +clf(); +a=gca(); +figure(0); +plot2d3(mtlb_fliplr(W),X_mag); +xtitle('Magnitude response','W','Amplitude'); +figure(1); +plot2d3(mtlb_fliplr(W),X_phase); +xtitle('Phase response','W','X_phase,degrees'); + + + + + + + + + + + + + |