0% found this document useful (0 votes)
87 views6 pages

Labno8: Fourier Transform &inverse Fourier Transform

This document discusses Fourier transforms and inverse Fourier transforms in MATLAB. It provides examples of using the int(), fourier(), and ifourier() functions to calculate integrals, Fourier transforms, and inverse Fourier transforms of various functions both symbolically and numerically. Key objectives covered are performing integration in MATLAB, computing Fourier transforms and inverse Fourier transforms, and computing Laplace transforms. Equations for the Fourier transform of common functions like cosine, sine, exponentials, Dirac delta, unit step, and their inverse transforms are also provided.

Uploaded by

Syed Waqas Shah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
87 views6 pages

Labno8: Fourier Transform &inverse Fourier Transform

This document discusses Fourier transforms and inverse Fourier transforms in MATLAB. It provides examples of using the int(), fourier(), and ifourier() functions to calculate integrals, Fourier transforms, and inverse Fourier transforms of various functions both symbolically and numerically. Key objectives covered are performing integration in MATLAB, computing Fourier transforms and inverse Fourier transforms, and computing Laplace transforms. Equations for the Fourier transform of common functions like cosine, sine, exponentials, Dirac delta, unit step, and their inverse transforms are also provided.

Uploaded by

Syed Waqas Shah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Lab no 8

FOURIER TRANSFORM &INVERSE FOURIER


TRANSFORM

OBJECTIVE

 Learn to perform integration in MATLAB


 Learn to compute Fourier Transform and Inverse Fourier Transform
 Learn to compute Laplace Transform in MATLAB

10.1 SYMBOLIC EXPRESSION

The sym function can be used to create 'symbolic objects' in MATLAB. For example,
typing >>x=sym('x') creates the symbolic variable with name x.

The syms function enables you to combine more than one such statement into a single
statement. For example, typing syms x is equivalent to typing x=sym('x'), and typing syms x y
u v creates the four variables x, y, u and v.

You can use sym function to create symbolic constants by single numerical value for the
argument. For example, typing pi=sym('pi'), fraction=sym('1/3')and sqroot2=sym('sqrt(2)')
create symbolic constants that avoid the floating point approximations inherent in the values
of pi, 1/3 and sqrt(2). If you create a symbolic constant pi this way, it temporarily replaces the
built-in numeric constant, and you no longer obtain a numeric value when you type its name.

The advantage of using symbolic constants is that they need not be evaluated (with
the accompanying round-off error) until a numeric answer is required.

10.2 INTEGRATION IN MATLAB

int(S)
int(S,
a,b)

int(S) returns the indefinite integral of S with respect to its symbolic variable.

int(S,a,b) returns the definite integral from a to b of each element of S with respect to
each element's default symbolic variable a and b are symbolic or double scalars.

Write following code in MATLAB and write your results in space provided

>>syms x t n
>>int(x)

>>int(cos(x))
>>int(sin(x))
>>int(exp(-2*t))

>>int(exp(-2*j*t))

>>int(t*exp(-t))

>>int(cos(x),0,2*pi)

>>int(sin(x),0,2*pi)

>>int(exp(-t/2)*cos(n*t),0,pi)

>> a0=int(exp(-t/2),0,pi

FOURIER TRANSFORM IN MATLAB


The Fourier transform of the symbolic scalar with default independent variable. The default
return is a function of. The Fourier transform is applied to a function of and returns a function
of.

Explain what is Dirac () function


MATLAB?
Dirac function is a function whose value is infinite at zero input and zero at all the other input
values. We cannot plot an infinite value, so we have to give it a finite value and then plot it using
the plot () or stem () function in MATLAB. The plot () function will show a continuous plot,
whereas the stem () function will show a discrete plot. To create a Dirac function, you can create it
manually or using the Dirac () function. 
Write following code in MATLAB and observe the output?

syms t
fourier(cos(t))

Find the Fourier transform of δ(t) in MATLAB?

Unit step Function is defined as Heaviside (t) in MATLAB. Find Fourier


transform of in MATLAB.
Fourier () function takes in a symbolic variable and cannot plot the function as long as its
variable is a symbol. So after you have derived Fourier transform of a function, definer’s’ for
some fixed value e.g. t=[-10:0.01:10] and w=[-3π:0.1:3π], and rewrite the equations to plot the
graphs.

Example 1:

Example 2:
INVERSE FOURIER TRANSFORM

If you have obtained the frequency domain expression , then you can find the corresponding
time domain expression by finding its inverse Fourier transform. In MATLAB, this is
obtained by the function. The inverse Fourier transform of the scalar symbolic object F with
default independent variable ω. The default return is a function of x. The inverse Fourier
transform is applied to a function of ω and returns a function of takes F to be a function of v
and f to be a function of u instead of the default ω and , respectively.

POST LAB QUESTIONS:

Q.1 Parseval’s relation states that the energy of a signal can be computed by integrating the
squared magnitude of the signal either over the time domain or frequency domain. If x(t) and

X(f) are a Fourier transform pair, then

You might also like