Professional Documents
Culture Documents
Xperiment O: A: To Compute Fourier Transform of A Continuous Time Signal
Xperiment O: A: To Compute Fourier Transform of A Continuous Time Signal
Code :
syms t w;
a=10;
x=@(t) heaviside(t+a/2)-heaviside(t-a/2);
XX=int(x(t).*exp(-j*w*t),t,-a/2,a/2);
X=subs(XX,w,[-2*pi:0.01:2*pi]);
plot([-2*pi:0.01:2*pi],X);
title('fourier transform of \pi_8(t)');
xlabel(' w in rad');
ylabel(' F T ( \pi _8 ( t ) ) ');
XX=int(x(t).*exp(-2*j*t).*exp(-j*w*t),t,-a/2,a/2);
X=subs(XX,w,[-2*pi:0.01:2*pi]);
plot([-2*pi:0.01:2*pi],X);
title('shifted fourier transform of \pi_8(t)');
xlabel(' w in rad');
ylabel(' X ( w + 2 ) ');
a=32;
x=@(t) heaviside(t+a/2)-heaviside(t-a/2);
XX=int(x(t).*exp(-j*w*t),t,-a/2,a/2);
X=subs(XX,w,[-2*pi:0.01:2*pi]);
plot([-2*pi:0.01:2*pi],X);
title('fourier transform of \pi_8(bt) for b=1/4');
xlabel(' w in rad');
ylabel(' F T ( \pi _8 ( b t ) ) for b = 1/4 ');
XX=int(x(t).*exp(-2*j*t).*exp(-j*w*t),t,-a/2,a/2);
X=subs(XX,w,[-2*pi:0.01:2*pi]);
plot([-2*pi:0.01:2*pi],X);
title('shifted fourier transform of \pi_8(bt) for b=1/4');
xlabel(' w in rad');
ylabel(' X ( w/b + 2 ) ');
shifted fourier transform of 8(t) shifted fourier transform of 8(bt) for b=1/4
8 35
7
30
6
25
5
20
4
X ( w/b + 2 )
X( w+ 2 )
15
3
10
2
5
1
0
0
-1 -5
-2 -10
-8 -6 -4 -2 0 2 4 6 8 -8 -6 -4 -2 0 2 4 6 8
w in rad w in rad
7
30
6
25
( b t ) ) for b = 1/4
5
20
8(t))
4
15
3
10
FT (
2
8
5
1
FT(
0
0
-1 -5
-2 -10
-8 -6 -4 -2 0 2 4 6 8 -8 -6 -4 -2 0 2 4 6 8
w in rad w in rad
POST EXERCISES :
1.
Code:
syms w t;
a=8;
x=@(t) 1/2*( ((t+a/2)/abs(t+a/2)) - ((t-a/2)/abs(-t+a/2)) );
XX=int(x(t).*exp(-j*w*t),t,-inf,inf);
X=subs(XX,w,[-2*pi:0.01:2*pi]);
plot([-2*pi:0.01:2*pi],X);
title('fourier transform of x(t)');
xlabel(' w in rad');
ylabel(' F T ( x ( t ) ) ');
x1=@(t) heaviside(t+a/2)-heaviside(t-a/2);
XX1=int(x1(t).*exp(-j*w*t),t,-a/2,a/2);
X1=subs(XX1,w,[-2*pi:0.01:2*pi]);
plot([-2*pi:0.01:2*pi],X1);
title('fourier transform of \pi_8(t)');
xlabel(' w in rad');
ylabel(' F T ( \pi _8 ( t ) ) ');
7 7
6 6
5 5
8(t))
4
FT(x( t) )
3 3
FT(
2 2
1 1
0 0
-1 -1
-2 -2
-8 -6 -4 -2 0 2 4 6 8 -8 -6 -4 -2 0 2 4 6 8
w in rad w in rad
2.
0.9
syms w t; 0.8
g=@(t) exp(-t)*heaviside(t);
0.7
XX=int(x(t).*exp(-j*w*t),t,-inf,inf);
0.6
FT(g( t) )
X=subs(XX,w,[-2*pi:0.01:2*pi]);
0.5
plot([-2*pi:0.01:2*pi],X);
title('fourier transform of g(t)'); 0.4
0.1
0
-8 -6 -4 -2 0 2 4 6 8
w in rad
3.
Code :
syms w t; 1
fourier transform of g(t)
0.6
X1=subs(XX1,w,[-8*pi:0.01:0]);
0.5
X2=subs(XX2,w,[0.01:0.01:8*pi]);
X=[X1 X2]; 0.4
plot([-8*pi:0.01:8*pi],X); 0.3
ylabel(' F T ( g ( t ) ) '); 0
-30 -20 -10 0 10 20 30
w in rad
4. Make use of the symbolic toolbox to calculate and plot the spectrum of Π1(t)cos(2π100t).
Code :
syms w t;
x=@(t) cos(2*pi*100*t)*(heaviside(t+1/2)-heaviside(t-1/2));
-4
XX=int(x(t).*exp(-j*w*t),t,-1/2,1/2); x 10 fourier transform of x(t)
2
X=subs(XX,w,[-8*pi:0.01:8*pi]);
plot([-8*pi:0.01:8*pi],X);
1.5
title('fourier transform of x(t)');
xlabel(' w in rad');
1
ylabel(' F T ( x ( t ) ) ');
FT(x( t) )
0.5
-0.5
-1
-30 -20 -10 0 10 20 30
w in rad
LEARNING OUTCOME :
1. We learnt the concepts of Fourier Transform of continous time signals.
2. We learnt to find continuous Fourier transform and plot the magnitude and phase
spectrum of a continuous signals through various steps.