Download as pdf or txt
Download as pdf or txt
You are on page 1of 15

EXPERIMENT - 6

TRANSFORMS

AIM : To find the Fourier Transform of a given signal and plotting its magnitude and phase spectrum

APPRATUS: PC, MATLAB software 2018b

THEORY:

Time domain and frequency domain are two ways of representing signals. A signal in the time domain shows
how the signal changes over time, while a signal in the frequency domain shows how much of the signal lies
within each given frequency band over a range of frequencies.

Fourier transform: Fourier transform is a mathematical technique that converts a time-domain signal into a
frequency-domain signal. It decomposes the signal into a sum of sinusoidal components, each with a different
frequency and amplitude. The Fourier transform of a signal x(t) is denoted by X(f) or X(w), where f is the
frequency in Hertz and w is the angular frequency in radians per second.

Inverse Fourier Transform: The inverse Fourier transform of a signal X(w) is denoted by x(t) and is given by
the formula:

Laplace transform: Laplace transform is another mathematical technique that converts a time-domain signal
into a complex frequency-domain signal. It decomposes the signal into a sum of exponential components, each
with a different complex frequency and amplitude. The Laplace transform of a signal x(t) is denoted by X(s),
where s is a complex variable that includes both the real part sigma and the imaginary part w.

Inverse Laplace Transform: The inverse Laplace transform of a signal X(s) is denoted by x(t) and is given by
the formula:

Inverse Fourier transform and inverse Laplace transform are mathematical techniques that convert a frequency-
domain signal or a complex frequency-domain signal back to a time-domain signal. They are the opposite of
Fourier transform and Laplace transform, which convert a time-domain signal to a frequency-domain signal or a
complex frequency-domain signal.

The inverse Fourier transform and inverse Laplace transform can be used to solve differential equations,
analyze signals and systems, and model physical phenomena.

1
PROCEDURE:

1. Define the function f using the syms function. For example, syms t s w; f = exp(-
t)*heaviside(t); defines the function f(t) = e^(-t)u(t).
2. Compute the Fourier transform of f using the fourier function. For example, F = fourier(f, t, w);
computes the Fourier transform of f with respect to t and assigns it to F(w).
3. Compute the Inverse Fourier transform of F using the ifourier function. For example, f_inv =
ifourier(F, w, t); computes the Inverse Fourier transform of F with respect to w and assigns it
to f_inv(t).
4. Compute the Laplace transform of f using the laplace function. For example, F_laplace =
laplace(f, t, s); computes the Laplace transform of f with respect to t and assigns it to
F_laplace(s).
5. Compute the Inverse Laplace transform of F using the ifourier function. For example, f_inv =
ilaplace(F, s, t); computes the Inverse Laplace transform of F with respect to s and assigns it to
f_inv(t).
6. Display the results using the disp function.

Fourier and Inverse Fourier Transform of a function :

syms t;
disp('22071a1005')

22071a1005

x1 = exp(-t^2);
disp('The input equation x1 is :')

The input equation x1 is :

disp(x1)

X1=fourier(x1);
disp('The Fourier Transform of the given input signal is :')

The Fourier Transform of the given input signal is :

disp(X1)

x11 = ifourier(X1);
disp('The Inverse Fourier Transform of X1 is :')

The Inverse Fourier Transform of X1 is :

disp(x11)

2
Magnitude response and Phase response:

syms t w;

x=exp(-2*t).*heaviside(t);

subplot(3,1,1)
ezplot(x)
title('Input signal - 22071a1005')
disp('The Fourier Transform of x(t) is ')

The Fourier Transform of x(t) is

X=fourier(x)

X =

X=simplify(X);

subplot(3,1,2);
ezplot(abs(X));
title('Magnitude response of Fourier Transform - 22071a1005')

subplot(3,1,3);
ezplot(atan(imag(X))/(real(X)));
title('Phase response of Fourier Transform - 22071a1005')

3
Fourier Transform of various functions :

syms t s;
syms A real;
syms W real;
syms o real;
syms b float;

disp('22071a1005')

22071a1005

f = dirac(t);
F = fourier(f);
disp('The Fourier Transform of dirac(t) is :')

The Fourier Transform of dirac(t) is :

disp(F)

f1 = A*heaviside(t);
F1 = fourier(f1);
disp('The Fourier Transform of A*u(t) is :')

The Fourier Transform of A*u(t) is :

4
disp(F1)

f2 = A*exp(-t)*heaviside(t);
F2 = fourier(f2);
disp('The Fourier Transform of A*exp(-t)*u(t) is :')

The Fourier Transform of A*exp(-t)*u(t) is :

disp(F2)

f3 = A*t*exp(-b*t)*heaviside(t);
F3 = fourier(f3);
F3 = simplify(F3);
disp('The Fourier Transform of A*t*exp(-b*t)*u(t) is :')

The Fourier Transform of A*t*exp(-b*t)*u(t) is :

disp(F3)

f4 = sin(o*t);
F4 = fourier(f4);
disp('The Fourier Transform of sin(o*t) is :')

The Fourier Transform of sin(o*t) is :

disp(F4)

Inverse Fourier Transforms of various functions:

disp('22071a1005')

22071a1005

F1 = A*pi*(dirac(w-o)+dirac(w+o));
f1 = ifourier(F1,t);
disp('The Inverse Fourier Transform of F1= A*pi*(dirac(w-o)+dirac(w+o)) is :')

5
The Inverse Fourier Transform of F1= A*pi*(dirac(w-o)+dirac(w+o)) is :

disp(f1)

f11=simplify(f1);
disp('The Inverse Fourier Transform of F1 after simplification :')

The Inverse Fourier Transform of F1 after simplification :

disp(f11)

F2 = A*pi*(dirac(w-o)-dirac(w+o))/1i;
f2 = ifourier(F2,t);
disp('The Inverse Fourier Transform of F2 = A*pi*(dirac(w-o)+dirac(w+o))/i is :')

The Inverse Fourier Transform of F2 = A*pi*(dirac(w-o)+dirac(w+o))/i is :

disp(f2)

f21=simplify(f2);
disp('The Inverse Fourier Transform of F2 after simplification :')

The Inverse Fourier Transform of F2 after simplification :

disp(f21)

F3 = A/(1+1i*w);
f3 = ifourier(F3,t);
disp('The Inverse Fourier Transform of F3 = A/(1+i*w) is :')

The Inverse Fourier Transform of F3 = A/(1+i*w) is :

disp(f3)

f31=simplify(f3);
disp('The Inverse Fourier Transform of F3 after simplification :')

The Inverse Fourier Transform of F3 after simplification :

6
disp(f31)

F4 = (3*1i*w+14)/((1i*w)^2+7*1i*w+12);
f4 = ifourier(F4,t);
disp('The Inverse Fourier Transform of F4 = (3*i*w+14)/((i*w)^2+7*i*w+12) is :')

The Inverse Fourier Transform of F4 = (3*i*w+14)/((i*w)^2+7*i*w+12) is :

disp(f4)

f41=simplify(f4);
disp('The Inverse Fourier Transform of F4 after simplification :')

The Inverse Fourier Transform of F4 after simplification :

disp(f41)

Laplace and Inverse Laplace transforms of various functions:

syms t s;
syms a real;
syms b real;
syms n real;
syms s complex;

%(a)
x=t;
disp('(a) laplace Transform of "t" is')

(a) laplace Transform of "t" is

a1=laplace(x)

a1 =

disp('(A) Inverse laplace Transform of "a1" is')

(A) Inverse laplace Transform of "a1" is

A1=ilaplace(a1)

7
A1 =

%(b)
x=exp(-a*t);
disp('(b) laplace Transform of "exp(-a*t)" is')

(b) laplace Transform of "exp(-a*t)" is

b1=laplace(x)

b1 =

disp('(B) Inverse laplace Transform of "b1" is')

(B) Inverse laplace Transform of "b1" is

B1=ilaplace(b1)

B1 =

%(c)
x=t*exp(-a*t);
disp('(c) laplace Transform of "t*exp(-a*t)" is')

(c) laplace Transform of "t*exp(-a*t)" is

c1=laplace(x)

c1 =

disp('(C) Inverse laplace Transform of "c1" is')

(C) Inverse laplace Transform of "c1" is

C1=ilaplace(c1)

C1 =

%(d)
x=sin(a*t);
disp('(d) laplace Transform of "sin(a*t)" is')

(d) laplace Transform of "sin(a*t)" is

d1=laplace(x)

d1 =

8
disp('(D) Inverse laplace Transform of "d1" is')

(D) Inverse laplace Transform of "d1" is

D1=ilaplace(d1)

D1 =

%(e)
x=cos(a*t);
disp('(e) laplace Transform of "cos(a*t)" is')

(e) laplace Transform of "cos(a*t)" is

e1=laplace(x)

e1 =

disp('(E) Inverse laplace Transform of "e1" is')

(E) Inverse laplace Transform of "e1" is

E1=ilaplace(e1)

E1 =

%(f)
x=sinh(a*t);
disp('(f) laplace Transform of "sinh(a*t)" is')

(f) laplace Transform of "sinh(a*t)" is

f1=laplace(x)

f1 =

disp('(F) Inverse laplace Transform of "f1" is')

(F) Inverse laplace Transform of "f1" is

F1=ilaplace(f1)

F1 =

%(g)
x=cosh(a*t);
disp('(g) laplace Transform of "cosh(a*t)" is')

9
(g) laplace Transform of "cosh(a*t)" is

g1=laplace(x)

g1 =

disp('(G) Inverse laplace Transform of "g1" is')

(G) Inverse laplace Transform of "g1" is

G1=ilaplace(g1)

G1 =

%(h)
x=exp(-a*t)*sin(b*t);
disp('(h) laplace Transform of "exp(-a*t)*sin(b*t)" is')

(h) laplace Transform of "exp(-a*t)*sin(b*t)" is

h1=laplace(x)

h1 =

disp('(H) Inverse laplace Transform of "h1" is')

(H) Inverse laplace Transform of "h1" is

H1=ilaplace(h1)

H1 =

%(i)
x=exp(-a*t)*cos(b*t);
disp('(i) laplace Transform of "exp(-a*t)*cos(b*t)" is')

(i) laplace Transform of "exp(-a*t)*cos(b*t)" is

i1=laplace(x)

i1 =

disp('(I) Inverse laplace Transform of "i1" is')

(I) Inverse laplace Transform of "i1" is

10
I1=ilaplace(i1)

I1 =

%(j)
x=t*sin(a*t);
disp('(j) laplace Transform of "t*sin(a*t)" is')

(j) laplace Transform of "t*sin(a*t)" is

j1=laplace(x)

j1 =

disp('(J) Inverse laplace Transform of "j1" is')

(J) Inverse laplace Transform of "j1" is

J1=ilaplace(j1)

J1 =

%(k)
x=t*cos(a*t);
disp('(k) laplace Transform of "t*cos(a*t)" is')

(k) laplace Transform of "t*cos(a*t)" is

k1=laplace(x)

k1 =

disp('(K) Inverse laplace Transform of "k1" is')

(K) Inverse laplace Transform of "k1" is

K1=ilaplace(k1)

K1 =

%(l)
sg = real(s);
o = imag(s);
s = sg+(1i*o);
x=cos(o*t);
disp('(l) laplace Transform of "cos(o*t)" is')

11
(l) laplace Transform of "cos(o*t)" is

l1=laplace(x)

l1 =

disp('(L) Inverse laplace Transform of "l1" is')

(L) Inverse laplace Transform of "l1" is

L1=ilaplace(l1);
L1=simplify(L1)

L1 =

%(m)
x=sinh(o*t);
disp('(m) laplace Transform of "sinh(o*t)" is')

(m) laplace Transform of "sinh(o*t)" is

m1=laplace(x)

m1 =

disp('(M) Inverse laplace Transform of "m1" is')

(M) Inverse laplace Transform of "m1" is

M1=ilaplace(m1)

M1 =

%(n)
x=exp(-a*t)*sinh(o*t);
disp('(n) laplace Transform of "exp(-a*t)*sinh(o*t)" is')

(n) laplace Transform of "exp(-a*t)*sinh(o*t)" is

n1=laplace(x)

n1 =

12
disp('(M) Inverse laplace Transform of "n1" is')

(M) Inverse laplace Transform of "n1" is

N1=ilaplace(n1)

N1 =

%(o)
n=3;
x=t^n;
disp('(o) laplace Transform of "t^n" is')

(o) laplace Transform of "t^n" is

o1=laplace(x)

o1 =

disp('(O) Inverse laplace Transform of "o1" is')

(O) Inverse laplace Transform of "o1" is

O1=ilaplace(o1)

O1 =

%(P)
x=t^(n-1)/factorial(n-1);
disp('(p) laplace Transform of "t^(n-1)/factorial(n-1)" is')

(p) laplace Transform of "t^(n-1)/factorial(n-1)" is

p1=laplace(x)

p1 =

disp('(P) Inverse laplace Transform of "p1" is')

(P) Inverse laplace Transform of "p1" is

P1=ilaplace(p1)

P1 =

%(q)

13
x=(t^n)*exp(-a*t);
disp('(q) laplace Transform of "(t^n)*exp(-a*t)" is')

(q) laplace Transform of "(t^n)*exp(-a*t)" is

q1=laplace(x)

q1 =

disp('(Q) Inverse laplace Transform of "q1" is')

(Q) Inverse laplace Transform of "q1" is

Q1=ilaplace(q1)

Q1 =

%(r)
x=(t^(n-1)*exp(-a*t))/(factorial(n-1));
disp('(r) laplace Transform of "(t^(n-1)*exp(-a*t))/factorial(n-1)" is')

(r) laplace Transform of "(t^(n-1)*exp(-a*t))/factorial(n-1)" is

r1=laplace(x)

r1 =

disp('(R) Inverse laplace Transform of "r1" is')

(R) Inverse laplace Transform of "r1" is

R1=ilaplace(r1)

R1 =

%(s)
x=t^2-(3*t);
disp('(s) laplace Transform of "t^2-(3*t)" is')

(s) laplace Transform of "t^2-(3*t)" is

s1=laplace(x)

s1 =

disp('(S) Inverse laplace Transform of "s1" is')

14
(S) Inverse laplace Transform of "s1" is

S1=ilaplace(s1)

S1 =

%(t)
x=1+0.4*exp(-(2*t))*sin(3*t);
disp('(t) laplace Transform of "1+0.4*exp(-(2*t))*sin(3*t)" is')

(t) laplace Transform of "1+0.4*exp(-(2*t))*sin(3*t)" is

t1=laplace(x)

t1 =

disp('(T) Inverse laplace Transform of "t1" is')

(T) Inverse laplace Transform of "t1" is

T1=ilaplace(t1)

T1 =

%(u)
x=3*sin(2*t)+cos(2*t);
disp('(u) laplace Transform of "3*sin(2*t)+cos(2*t)" is')

(u) laplace Transform of "3*sin(2*t)+cos(2*t)" is

u1=laplace(x)

u1 =

disp('(U) Inverse laplace Transform of "u1" is')

(U) Inverse laplace Transform of "u1" is

U1=ilaplace(u1)

U1 =

RESULT : Transformations of a given signals are obtained using MATLAB. Magnitude and Phase spectrum of
the Fourier transform are plotted using MATLAB functions.

15

You might also like