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 /40/CH5/EX5.7/Exa_5_7.sce | |
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 '40/CH5/EX5.7/Exa_5_7.sce')
-rwxr-xr-x | 40/CH5/EX5.7/Exa_5_7.sce | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/40/CH5/EX5.7/Exa_5_7.sce b/40/CH5/EX5.7/Exa_5_7.sce new file mode 100755 index 000000000..aed9a6ed3 --- /dev/null +++ b/40/CH5/EX5.7/Exa_5_7.sce @@ -0,0 +1,26 @@ +a=0.5;b=1;
+n=0:50;
+h=b*(a^n);
+//Discrete-Time Fourier transform
+K=500;
+k=-250:1:250;
+w=%pi*k/K;
+H=h*exp(-%i*n'*w);
+//caluculation of phase and magnitude of h(z)
+[phase_H,m]=phasemag(H);
+H=abs(H);
+a=gca();
+subplot(2,1,1);
+a.y_location="origin";
+plot2d(w/%pi,H);
+xlabel('Frequency in radians')
+ylabel('abs(H)')
+title('magnitude Response')
+subplot(2,1,2);
+a=gca();
+a.x_location="origin";
+a.y_location="origin";
+plot2d(w/(2*%pi),phase_H)
+xlabel('Frequency in Radians');
+ylabel('<(H)')
+title('Phase Response'))
\ No newline at end of file |