From b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b Mon Sep 17 00:00:00 2001 From: priyanka Date: Wed, 24 Jun 2015 15:03:17 +0530 Subject: initial commit / add all books --- 22/CH8/EX8.8/ch8ex8.jpg | Bin 0 -> 38804 bytes 22/CH8/EX8.8/ch8ex8.sce | 26 ++++++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100755 22/CH8/EX8.8/ch8ex8.jpg create mode 100755 22/CH8/EX8.8/ch8ex8.sce (limited to '22/CH8/EX8.8') diff --git a/22/CH8/EX8.8/ch8ex8.jpg b/22/CH8/EX8.8/ch8ex8.jpg new file mode 100755 index 000000000..990adb892 Binary files /dev/null and b/22/CH8/EX8.8/ch8ex8.jpg differ 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 -- cgit