summaryrefslogtreecommitdiff
path: root/3812/CH5
diff options
context:
space:
mode:
Diffstat (limited to '3812/CH5')
-rw-r--r--3812/CH5/EX5.1/5_1.sce45
-rw-r--r--3812/CH5/EX5.10/5_10.sce20
-rw-r--r--3812/CH5/EX5.15/5_15.sce37
-rw-r--r--3812/CH5/EX5.16/5_16.sce38
-rw-r--r--3812/CH5/EX5.17/5_17.sce37
-rw-r--r--3812/CH5/EX5.2/5_2.sce31
-rw-r--r--3812/CH5/EX5.26/5_26.sce20
-rw-r--r--3812/CH5/EX5.6/5_6.sce34
-rw-r--r--3812/CH5/EX5.8/5_8.sce26
-rw-r--r--3812/CH5/EX5.9/5_9.sce20
10 files changed, 308 insertions, 0 deletions
diff --git a/3812/CH5/EX5.1/5_1.sce b/3812/CH5/EX5.1/5_1.sce
new file mode 100644
index 000000000..b8e7ad45e
--- /dev/null
+++ b/3812/CH5/EX5.1/5_1.sce
@@ -0,0 +1,45 @@
+//Example 5.1:
+//Continuous Time Fourier Transform of a
+clear;
+clc;
+close;
+// Analog Signal
+A =1;//Amplitude
+Dt = 0.005;
+t = 0:Dt:10;
+xt=exp(-A*t);
+//Continuous-time Fourier Transform
+Wmax=2*%pi*1; //Analog Frequency = 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)];
+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
+a=gca();
+a.y_location="origin";
+plot(t,xt);
+xlabel('t in sec.');
+ylabel('x(t)')
+title('Continuous Time Signal')
+//Plotting Magnitude Response of CTS
+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)')
+//Plotting Phase Reponse of CTS
+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')
diff --git a/3812/CH5/EX5.10/5_10.sce b/3812/CH5/EX5.10/5_10.sce
new file mode 100644
index 000000000..b244c478d
--- /dev/null
+++ b/3812/CH5/EX5.10/5_10.sce
@@ -0,0 +1,20 @@
+//Example 5.10
+// Continuous Time Fourier Transforms of sin(Wot)
+clc;
+close;
+//CTFT
+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];
+//figure
+a=gca();
+a.y_location="origin";
+a.x_location="origin";
+plot2d3('gnn',W,imag(XW),2);
+poly1=a.children(1).children(1);
+poly1.thickness = 3;
+xlabel('W');
+title('CTFT of sin(Wot)')
diff --git a/3812/CH5/EX5.15/5_15.sce b/3812/CH5/EX5.15/5_15.sce
new file mode 100644
index 000000000..e01b07208
--- /dev/null
+++ b/3812/CH5/EX5.15/5_15.sce
@@ -0,0 +1,37 @@
+//Example 5_15
+//Fourier Transform of x(t)=exp(-t)*sin(wc*t)*u(t)
+clear;
+clc;
+wc=1;
+Dt=0.005;
+t=0:Dt:10;
+xt=(exp(t*(-1+wc))-exp(t*(-1-wc)))/(2*%i);
+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)];
+//Plotting Continuous Time Signal
+figure(1)
+plot(t,xt);
+xlabel('t in sec.');
+ylabel('x(t)')
+title('Continuous Time Signal')
+figure(2)
+//Plotting Magnitude Response of CTS
+subplot(2,1,1);
+plot(W,XW_Mag);
+xlabel('Frequency in Radians/Seconds>W');
+ylabel('abs(X(jW))')
+title('Magnitude Response (CTFT)')
+//Plotting Phase Reponse of CTS
+subplot(2,1,2);
+plot(W,XW_Phase*%pi/180);
+xlabel('Frequency in Radians/Seconds>W');
+ylabel('<X(jW)')
+title('Phase Response (CTFT) in Radians')
diff --git a/3812/CH5/EX5.16/5_16.sce b/3812/CH5/EX5.16/5_16.sce
new file mode 100644
index 000000000..b06fc5d68
--- /dev/null
+++ b/3812/CH5/EX5.16/5_16.sce
@@ -0,0 +1,38 @@
+//Example 5_16
+//Fourier Transform of x(t)=exp(-a*t)*cos(wc*t)*u(t)
+clear;
+clc;
+a=1;
+wc=1;
+Dt=0.005;
+t=0: Dt :10;
+xt=(exp(t*(-a+wc))+exp(t*(-a-wc)))/2;
+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)];
+//Plotting Continuous Time Signal
+figure(1)
+plot(t,xt);
+xlabel('t in sec.');
+ylabel('x(t)')
+title('Continuous Time Signal')
+figure(2)
+//Plotting Magnitude Response of CTS
+subplot(2,1,1);
+plot(W,XW_Mag);
+xlabel('Frequency in Radians/Seconds>W');
+ylabel('abs(X(jW))')
+title('Magnitude Response (CTFT)')
+//Plotting Phase Reponse of CTS
+subplot(2,1,2);
+plot(W,XW_Phase*%pi/180);
+xlabel('Frequency in Radians/Seconds>W');
+ylabel('<X(jW)')
+title('Phase Response (CTFT) in Radians')
diff --git a/3812/CH5/EX5.17/5_17.sce b/3812/CH5/EX5.17/5_17.sce
new file mode 100644
index 000000000..62e827d68
--- /dev/null
+++ b/3812/CH5/EX5.17/5_17.sce
@@ -0,0 +1,37 @@
+//Example 5_17
+//Fourier Transform of Continuous Time Signal x(t)=cos(wc*t)*u(t)
+clear;
+clc;
+wc=1;
+Dt=0.005;
+t=0: Dt :10;
+xt=(exp(wc*t)+exp(-wc*t))/2;
+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)];
+//Plotting Continuous Time Signal
+figure(1)
+plot(t,xt);
+xlabel('t in sec.');
+ylabel('x(t)')
+title('Continuous Time Signal')
+figure(2)
+//Plotting Magnitude Response of CTS
+subplot(2,1,1);
+plot(W,XW_Mag);
+xlabel('Frequency in Radians/Seconds>W');
+ylabel('abs(X(jW))')
+title('Magnitude Response (CTFT)')
+//Plotting Phase Reponse of CTS
+subplot(2,1,2);
+plot(W,XW_Phase*%pi/180);
+xlabel('Frequency in Radians/Seconds>W');
+ylabel('<X(jW)')
+title('Phase Response (CTFT) in Radians')
diff --git a/3812/CH5/EX5.2/5_2.sce b/3812/CH5/EX5.2/5_2.sce
new file mode 100644
index 000000000..61d60835d
--- /dev/null
+++ b/3812/CH5/EX5.2/5_2.sce
@@ -0,0 +1,31 @@
+//Example 5.2:
+//Continuous Time Fourier Transform of x(t)=e-a|t|
+clc;
+close;
+a=1;
+Dt=0.005;
+t=-4.5:Dt:4.5;
+xt=exp(-a*abs(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=real(XW);
+W=[-mtlb_fliplr(W), W(2:1001)];
+XW=[mtlb_fliplr(XW),XW(2:1001)];
+subplot(1,1,1)
+subplot(2,1,1);
+a=gca();
+a.y_location="origin";
+plot(t,xt);
+xlabel('t in sec.');
+ylabel('x(t)')
+title('Continuous Time Signal')
+subplot(2,1,2);
+a=gca();
+a.y_location = "origin";
+plot(W,XW);
+xlabel('Frequency in Radians/Seconds W');
+ylabel('X(jW)')
+title('Continuous-time Fourier Transform')
diff --git a/3812/CH5/EX5.26/5_26.sce b/3812/CH5/EX5.26/5_26.sce
new file mode 100644
index 000000000..8948a6cab
--- /dev/null
+++ b/3812/CH5/EX5.26/5_26.sce
@@ -0,0 +1,20 @@
+//Example 5_26
+//find and sketch Fourier Transform of Periodic Impulse Train
+clear;
+clc;
+T=-4:4;;
+T1=1;
+xt=ones(1,length(T));
+ak=1/T1;
+XW=2*%pi*ak*ones(1,length(T));
+Wo=2*%pi/T1;
+W=Wo*T;
+figure
+subplot(2,1,1)
+plot2d3('gnn',T,xt);
+xlabel('t');
+title('Periodic Impulse Train')
+subplot(2,1,2)
+plot2d3('gnn',W,XW);
+xlabel('t');
+title('CTFT of Periodic Impulse Train')
diff --git a/3812/CH5/EX5.6/5_6.sce b/3812/CH5/EX5.6/5_6.sce
new file mode 100644
index 000000000..d2228ab58
--- /dev/null
+++ b/3812/CH5/EX5.6/5_6.sce
@@ -0,0 +1,34 @@
+//Example 5.6
+// Continuous Time Fourier Transform
+clear;
+clc;
+close;
+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 msec.');
+title('Contiuous 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)')
diff --git a/3812/CH5/EX5.8/5_8.sce b/3812/CH5/EX5.8/5_8.sce
new file mode 100644
index 000000000..e62bcf5d0
--- /dev/null
+++ b/3812/CH5/EX5.8/5_8.sce
@@ -0,0 +1,26 @@
+//Example 5_8
+//find the fourier transform x(t)=exp(-%pi*(t^2))
+clear;
+clc;
+B=%pi;
+Dt=0.005;
+t=-4.5:Dt:4.5;
+xt=exp(-%pi*(t^2));
+Wmax=2*%pi*1;
+K=4;
+k=0:(K/1000):K;
+W=k*Wmax/K;
+XW=xt*exp(-sqrt(-1)*t'*W)*Dt;
+XW=real(XW);
+W=[-mtlb_fliplr(W),W(2:1001)];
+XW=[mtlb_fliplr(XW),XW(2:1001)];
+subplot(2,1,1);
+plot(t,xt);
+xlabel('t i n s e c');
+ylabel('x(t)')
+title('Continuous Time Signal')
+subplot(2,1,2);
+plot(W,XW);
+xlabel('Fr equency in Radians/Seconds W');
+ylabel('X(jW)')
+title('Continuous-time Fourier Transform')
diff --git a/3812/CH5/EX5.9/5_9.sce b/3812/CH5/EX5.9/5_9.sce
new file mode 100644
index 000000000..e9d6dd50e
--- /dev/null
+++ b/3812/CH5/EX5.9/5_9.sce
@@ -0,0 +1,20 @@
+//Example 5.9
+//Continuous Time Fourier Transforms of cos(Wot)
+clc;
+close;
+//CTFT
+T1=2;
+T=4*T1;
+Wo=2*%pi/T;
+W=[-Wo,0,Wo];
+ak=(2*%pi*Wo*T1/%pi);
+XW1=[-ak,0,ak];
+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)')