diff options
Diffstat (limited to '67/CH3')
-rwxr-xr-x | 67/CH3/EX3.15/example315.sce | 20 | ||||
-rwxr-xr-x | 67/CH3/EX3.31/example331.sce | 42 | ||||
-rwxr-xr-x | 67/CH3/EX3.8/example38.sce | 43 | ||||
-rwxr-xr-x | 67/CH3/EX3.9/example39.sce | 32 |
4 files changed, 137 insertions, 0 deletions
diff --git a/67/CH3/EX3.15/example315.sce b/67/CH3/EX3.15/example315.sce new file mode 100755 index 000000000..094c51ecf --- /dev/null +++ b/67/CH3/EX3.15/example315.sce @@ -0,0 +1,20 @@ +//Example 3.15
+clc;
+clear;
+T1=2;
+T=4*T1;
+Wo=2*%pi/T;
+W=[-Wo,0,Wo];
+ak=(2*%pi*Wo*T1/%pi)/sqrt(-1);
+XW=[-ak,0,ak];
+ak1=(2*%pi*Wo*T1/%pi);
+XW1=[ak1,0,ak1];
+figure
+a=gca();
+a.y_location="origin";
+a.x_location="origin";
+plot2d3('gnn',W,XW1,2);
+poly1=a.children(1).children(1);
+poly1.thickness=3;
+xlabel('W');
+title('CTFT of cos(Wot)');
\ No newline at end of file diff --git a/67/CH3/EX3.31/example331.sce b/67/CH3/EX3.31/example331.sce new file mode 100755 index 000000000..56b3b546a --- /dev/null +++ b/67/CH3/EX3.31/example331.sce @@ -0,0 +1,42 @@ +//Example 3.31
+clc ;
+clear;
+R=10^3;
+C=10^-3;
+A=1/(R*C);
+Dt=0.005;
+t=0:Dt:10;
+xt=A*exp(-A*t);
+Wmax=2*%pi*1;
+K=4;
+k=0:(K/1000):K;
+W=k*Wmax/K;
+XW=xt*exp(-sqrt(-1)*t'*W)*Dt;
+XW_Mag=abs(XW);
+W=[-mtlb_fliplr(W),W(2:1001)];
+XW_Mag=[mtlb_fliplr(XW_Mag),XW_Mag(2:1001)];
+[XW_Phase,db]=phasemag(XW);
+XW_Phase=[-mtlb_fliplr(XW_Phase),XW_Phase(2:1001)];
+figure
+a=gca();
+a.y_location="origin";
+plot(t,xt);
+xlabel('t in sec.');
+ylabel('x(t)');
+title('Continuous Time Signal');
+figure
+subplot(2,1,1);
+a=gca();
+a.y_location="origin";
+plot(W,XW_Mag);
+xlabel('Frequency in Radians/Seconds>W');
+ylabel('abs(X(jW))');
+title('Magnitude Response (CTFT)');
+subplot(2,1,2);
+a=gca();
+a.y_location="origin";
+a.x_location="origin";
+plot(W,XW_Phase*%pi/180) ;
+xlabel(' Frequency in Radians/Seconds> W' );
+ylabel('<X(jW)')
+title('Phase Response (CTFT) in Radians');
\ No newline at end of file diff --git a/67/CH3/EX3.8/example38.sce b/67/CH3/EX3.8/example38.sce new file mode 100755 index 000000000..78121960d --- /dev/null +++ b/67/CH3/EX3.8/example38.sce @@ -0,0 +1,43 @@ +clc ;
+close ;
+// Analog S i g n a l
+A =1; // Ampl i tude
+Dt = 0.005;
+t = 0: Dt :10;
+xt = exp(-A*t);
+Wmax = 2* %pi *1; // Analog Fr equency = 1Hz
+K = 4;
+k = 0:( K /1000) :K;
+W = k* Wmax /K;
+XW = xt* exp (- sqrt ( -1)*t'*W) * Dt;
+XW_Mag = abs(XW);
+W = [-mtlb_fliplr(W),W(2:1001)]; // Omega f rom Wmax to Wmax
+XW_Mag = [mtlb_fliplr(XW_Mag),XW_Mag(2:1001)];
+[ XW_Phase ,db] = phasemag (XW);
+XW_Phase =[-mtlb_fliplr(XW_Phase),XW_Phase(2:1001)];
+//Plotting Continuous Time Signal
+figure
+a = gca ();
+a.y_location ="origin";
+plot (t,xt);
+xlabel ( ' t in sec. ' );
+ylabel ( ' x ( t ) ' )
+title ( ' Continuous Time Signal ' )
+figure
+// Pl o t t i n g Magni tude Re spons e o f CTS
+subplot (2 ,1 ,1);
+a = gca ();
+a.y_location ="origin";
+plot (W, XW_Mag );
+xlabel ( ' Fr equency i n Radians / Seconds> W' );
+ylabel ( ' abs (X(jW) ) ' )
+title ( 'Magni tude Re spons e (CTFT) ' )
+// Pl o t t i n g Phase Reponse o f CTS
+subplot (2 ,1 ,2);
+a = gca ();
+a.y_location = "origin";
+a.x_location = "origin";
+plot (W, XW_Phase *%pi /180) ;
+xlabel ( ' Fr equency in Radians / Seconds> W' );
+ylabel ( '<X(jW) ' )
+title ( ' Phase Re spons e (CTFT) i n Radians ' )
\ No newline at end of file diff --git a/67/CH3/EX3.9/example39.sce b/67/CH3/EX3.9/example39.sce new file mode 100755 index 000000000..5aed6e28d --- /dev/null +++ b/67/CH3/EX3.9/example39.sce @@ -0,0 +1,32 @@ +//Example 3.9
+clc;
+clear;
+A=1;
+Dt=0.005;
+T1=4;
+t=-T1/2:Dt:T1/2;
+for i=1:length(t)
+xt(i)=A;
+end
+Wmax=2*%pi*1;
+K=4;
+k=0:(K/1000):K;
+W=k*Wmax/K;
+xt=xt';
+XW=xt*exp(-sqrt(-1)*t'*W)*Dt;
+XW_Mag=real(XW);
+W=[-mtlb_fliplr(W),W(2:1001)];
+XW_Mag=[mtlb_fliplr(XW_Mag),XW_Mag(2:1001)];
+subplot(2,1,1);
+a=gca();
+a.data_bounds=[-4,0;4,2];
+a.y_location="origin";
+plot(t,xt);
+xlabel('t in sec.');
+title('Continous Time Signal x(t)');
+subplot(2,1,2);
+a=gca();
+a.y_location="origin";
+plot(W,XW_Mag);
+xlabel('Frequency in Radians/Seconds');
+title('Continuous time Fourier Transform X(jW)');
\ No newline at end of file |