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 /830/CH4/EX4.4.4 | |
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 '830/CH4/EX4.4.4')
-rwxr-xr-x | 830/CH4/EX4.4.4/DTFT_2.sce | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/830/CH4/EX4.4.4/DTFT_2.sce b/830/CH4/EX4.4.4/DTFT_2.sce new file mode 100755 index 000000000..2d2bc330e --- /dev/null +++ b/830/CH4/EX4.4.4/DTFT_2.sce @@ -0,0 +1,31 @@ +//Graphical//
+//Example 4.4.4
+//Frequency Response of First Order Difference Equation
+//a = 0.9 and b = 1-a
+//Impulse Response h(n) = b.(a^n).u(n)
+clear;
+clc;
+close;
+a = input('Enter the constant value of Ist order Difference Equation');
+b= 1-a;
+//Calculation of Impulse Response
+n =0:50;
+h =b*(a.^n) ;
+//Discrete-time Fourier transform
+K = 500;
+k = 0:1:K;
+w = %pi*k/K;
+H = h * exp(-sqrt(-1)*n'*w);
+//phasemag used to calculate phase and magnitude in dB
+[Phase_H,m] = phasemag(H);
+H = real(H);
+subplot(2,1,1)
+plot2d(w/%pi,H)
+xlabel('Frequency in Radians')
+ylabel('abs(H)')
+title('Magnitude Response')
+subplot(2,1,2)
+plot2d(w/%pi,Phase_H)
+xlabel('Frequency in Radians')
+ylabel('<(H)')
+title('Phase Response')
|