Transforms Kar
Transforms Kar
TRANSFORMS
AIM : To find the Fourier Transform of a given signal and plotting its magnitude and phase spectrum
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.
syms t;
disp('22071a1008')
22071a1008
x1 = exp(-t^2);
disp('The input equation x1 is :')
disp(x1)
X1=fourier(x1);
disp('The Fourier Transform of the given input signal is :')
disp(X1)
x11 = ifourier(X1);
disp('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 - 22071a1008')
disp('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 - 22071a1008')
subplot(3,1,3);
ezplot(atan(imag(X))/(real(X)));
title('Phase response of Fourier Transform - 22071a1008')
3
Fourier Transform of various functions :
syms t s;
syms A real;
syms W real;
syms o real;
syms b float;
disp('22071a1008')
22071a1008
f = dirac(t);
F = fourier(f);
disp('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 :')
disp(F1)
f2 = A*exp(-t)*heaviside(t);
F2 = fourier(f2);
disp('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 :')
4
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 :')
disp(F4)
disp('22071a1008')
22071a1008
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 :')
disp(f1)
f11=simplify(f1);
disp('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 :')
5
disp(f2)
f21=simplify(f2);
disp('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 :')
disp(f3)
f31=simplify(f3);
disp('The Inverse Fourier Transform of F3 after simplification :')
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 :')
disp(f4)
f41=simplify(f4);
disp('The Inverse Fourier Transform of F4 after simplification :')
6
disp(f41)
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')
a1=laplace(x)
a1 =
A1=ilaplace(a1)
A1 =
%(b)
x=exp(-a*t);
disp('(b) laplace Transform of "exp(-a*t)" is')
b1=laplace(x)
b1 =
B1=ilaplace(b1)
B1 =
7
%(c)
x=t*exp(-a*t);
disp('(c) laplace Transform of "t*exp(-a*t)" is')
c1=laplace(x)
c1 =
C1=ilaplace(c1)
C1 =
%(d)
x=sin(a*t);
disp('(d) laplace Transform of "sin(a*t)" is')
d1=laplace(x)
d1 =
D1=ilaplace(d1)
D1 =
%(e)
x=cos(a*t);
disp('(e) laplace Transform of "cos(a*t)" is')
e1=laplace(x)
e1 =
8
(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')
f1=laplace(x)
f1 =
F1=ilaplace(f1)
F1 =
%(g)
x=cosh(a*t);
disp('(g) laplace Transform of "cosh(a*t)" is')
g1=laplace(x)
g1 =
G1=ilaplace(g1)
G1 =
%(h)
x=exp(-a*t)*sin(b*t);
disp('(h) laplace Transform of "exp(-a*t)*sin(b*t)" is')
9
(h) laplace Transform of "exp(-a*t)*sin(b*t)" is
h1=laplace(x)
h1 =
H1=ilaplace(h1)
H1 =
%(i)
x=exp(-a*t)*cos(b*t);
disp('(i) laplace Transform of "exp(-a*t)*cos(b*t)" is')
i1=laplace(x)
i1 =
I1=ilaplace(i1)
I1 =
%(j)
x=t*sin(a*t);
disp('(j) laplace Transform of "t*sin(a*t)" is')
j1=laplace(x)
j1 =
10
J1=ilaplace(j1)
J1 =
%(k)
x=t*cos(a*t);
disp('(k) laplace Transform of "t*cos(a*t)" is')
k1=laplace(x)
k1 =
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')
l1=laplace(x)
l1 =
L1=ilaplace(l1);
L1=simplify(L1)
L1 =
%(m)
11
x=sinh(o*t);
disp('(m) laplace Transform of "sinh(o*t)" is')
m1=laplace(x)
m1 =
M1=ilaplace(m1)
M1 =
%(n)
x=exp(-a*t)*sinh(o*t);
disp('(n) laplace Transform of "exp(-a*t)*sinh(o*t)" is')
n1=laplace(x)
n1 =
N1=ilaplace(n1)
N1 =
%(o)
n=3;
x=t^n;
disp('(o) laplace Transform of "t^n" is')
o1=laplace(x)
o1 =
12
disp('(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')
p1=laplace(x)
p1 =
P1=ilaplace(p1)
P1 =
%(q)
x=(t^n)*exp(-a*t);
disp('(q) laplace Transform of "(t^n)*exp(-a*t)" is')
q1=laplace(x)
q1 =
Q1=ilaplace(q1)
Q1 =
%(r)
13
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')
r1=laplace(x)
r1 =
R1=ilaplace(r1)
R1 =
%(s)
x=t^2-(3*t);
disp('(s) laplace Transform of "t^2-(3*t)" is')
s1=laplace(x)
s1 =
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')
t1=laplace(x)
t1 =
14
(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')
u1=laplace(x)
u1 =
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