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 /22/CH8/EX8.8 | |
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 '22/CH8/EX8.8')
-rwxr-xr-x | 22/CH8/EX8.8/ch8ex8.jpg | bin | 0 -> 38804 bytes | |||
-rwxr-xr-x | 22/CH8/EX8.8/ch8ex8.sce | 26 |
2 files changed, 26 insertions, 0 deletions
diff --git a/22/CH8/EX8.8/ch8ex8.jpg b/22/CH8/EX8.8/ch8ex8.jpg Binary files differnew file mode 100755 index 000000000..990adb892 --- /dev/null +++ b/22/CH8/EX8.8/ch8ex8.jpg diff --git a/22/CH8/EX8.8/ch8ex8.sce b/22/CH8/EX8.8/ch8ex8.sce new file mode 100755 index 000000000..9061675c3 --- /dev/null +++ b/22/CH8/EX8.8/ch8ex8.sce @@ -0,0 +1,26 @@ +//signals and systems
+//sampling:the bridge from continuous to discrete
+//DFT to compute the fourier transform of e^-2t.u(t)
+T_0 = 4;
+N_0 = 256;
+T = T_0/N_0;
+t = (0:T:T*(N_0-1))';
+x = T*exp(-2*t);
+x = mtlb_i(x,1,(T*(exp(-2*T_0)+1))/2);
+X_r = fft(x);
+r = (-N_0/2:N_0/2-1)';
+omega_r = ((r*2)*%pi)/T_0;
+omega = linspace(-%pi/T,%pi/T,4097);
+X = 1 ./(%i*omega+2);
+subplot(2,1,1);
+a = gca();
+a.y_location ="origin";
+a.x_location ="origin";
+plot(omega,abs(X),"k",omega_r,fftshift(abs(X_r)),"ko");
+xtitle("magnitude of X(omega) for true FT and DFT");
+subplot(2,1,2);
+a = gca();
+a.y_location ="origin";
+a.x_location ="origin";
+plot(omega,atan(imag(X),real(X)),"k",omega_r,fftshift(atan(imag(X_r),real(X_r))),"ko");
+xtitle("angle of X(omega) for true FT and DFT");
\ No newline at end of file |