Anda di halaman 1dari 6

Signals and Systems

Lab #09
Name: ____________________________________________Roll No: ______________

Score: ____________Signature of the Lab Tutor: _______________ Date:____________

Introduction to Fourier Transform its operation on Matlab

Objectives:
 To understand the basic concept behind Fourier transforms.
 To verify the Amplitude density and Phase spectra of continuous time signals
using Matlab
 To observe the practical implication of the fact that all the signals are actually
time-limited.
 To become familiar with FFT and IFFT functions of Matlab that are used for DFT

Equipments:

 An IBM compatible PC
 Matlab Software

Introduction to Fourier Transform:


In Fourier series Periodic signals can be approximated or represented as a series of Sines and
cosines while to see the spectrum of an aperiodic signal, we’ll take its Fourier transform. The
Fourier Transform is a generalization of the complex Fourier series in the limit as т →
∞.
The Fourier transform is developed from Fourier series, but it has following
characteristics that,
 The Fourier Transform actually transforms the domain of a signal from
time domain to frequency domain, which enables an easy analysis of
Phase, Amplitude and Energy density spectrum and that is not viable in
Time domain representation of Signals.
 Fourier Transform can work on Aperiodic signals.
 Fourier Transform has an inverse transform that allows for conversion
from the frequency domain back to the time domain.
The Fourier transform of a continuous time signal x(t) is represented by X(f) and is given
by:

X f    x t  e
 j 2ft
dt


And its inverse is known as Inverse Fourier Transform, and that is given by


 X ( f )e
j 2ft
x (t )  dt


Department Of Electrical Engineering


Signals and Systems

But since the signals generated by Matlab are discrete-time signals, we’ll use following discrete-
time equivalent of the above equation:

X  mf   T  x nT e  j 2  mf  nT

n

Where T represents the distance (in sec) between any two samples on the time- axis, n is an
integer that represents the sample index in the time-domain. The outcome of all this computation
is obviously also discrete, hence, m is an integer that represents the sample index in the frequency
domain f represents the distance (in Hz) between any two samples on the frequency axis.
The above two equations will provide same results for very small values of T (sample spacing).

Amplitude Density Spectrum


The amplitude density spectrum of a continuous time signal x(t) is magnitude of its
Fourier transform, i.e., |X(f)|. If x(t) has the unit of amperes, its resulting amplitude
density function shall have the units of amperes/Hz.

Phase Spectrum
The Phase Spectrum of a continuous time signal x(t) is angle of its Fourier Transform
X(f), i.e., X(f). Its unit is radians.

Energy Density Spectrum:

The energy density of a continuous time signal x (t) is the square of its amplitude density
function, i.e., |X (f) |2. Accordingly, its unit is square of that of |X (f)|.

Example:

1. First of all, we’ll see the spectra of signal x(t) = e-tu(t) i-e amplitude, and phase
spectra.

The Fourier transform of the above signal, i.e. x(t)=e-t u(t), is given by:

1
X( f ) 
1  j 2f

For Amplitude Spectrum:


t=-1:0.01:3;
ut=[zeros(1,100) ones(1,301)];
xt=exp(-t).*ut;
f=-1:0.01:1;
xamp=1./sqrt(1+4*(pi^2)*f.^2)

Department Of Electrical Engineering


Signals and Systems

subplot(1,2,1)
plot(t, xt);
xlabel('TIME');
ylabel('Amplitude');
title('your roll no: ')
grid on;
subplot(1,2,2)
plot(f, xamp)
xlabel('FREQUENCY');
ylabel('Amplitude Spectrum');
title('Isra')
grid on;

Result:

For Phase Spectrum:


t=-1:0.01:3;
ut=[zeros(1,100) ones(1,301)];
xt=exp(-t).*ut;
f=-1:0.001:1;
xp=-atand(2*pi*f);
xph=unwrap(xp);
subplot(1,2,1)
plot(t, xt);
grid on;
xlabel('TIME')
ylabel('Amplitude');
title('X(t)');
subplot(1,2,2)
plot(f, xph)
xlabel('FREQUENCY');

Department Of Electrical Engineering


Signals and Systems

ylabel('Your University');
title('Phase');
grid on;

Result:

Introduction to DFT(Discrete Fourier transform) in Matlab:


In Matlab signals are the signals are generated in discrete time so Fourier transform is
done in discrete fashion. The DFT is extremely important in the area of frequency
(spectrum) analysis because it takes a discrete signal in the time domain and transforms
that signal into its discrete frequency domain representation. Without a discrete-time to
discrete-frequency transform we would not be able to compute the Fourier transform with
a microprocessor or DSP(Digital Signal Processing ) based system.
 The functions used for DFT and IDFT in MATLAB are 'fft' and 'ifft' respectively.

Example:
2. Write a simple program to Demonstrate DFT
x=[1 4 2 1];
n=0:3;
a=fft(x);
m=abs(a);
ang=angle(a);

Department Of Electrical Engineering


Signals and Systems

subplot(3,1,1);
stem(n,x)
grid on;
title('x(n)')
subplot(3,1,2);
stem(n,m)
grid on;
title('amp')
subplot(3,1,3);
stem(n,ang)
grid on;
title ('phase')
Result:

Excercise:
1. Verify the results of example number 1 using FFT function,write code below
and attach the results.
_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________
2. consider the following code, type it in Matlab ,attach the result and write
your observation below

x=[8 -1-3i -2 -1+3i ];

Department Of Electrical Engineering


Signals and Systems

n=0:3;
a=ifft(x);
stem(n,a)

________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________

3. Write advantage of frequency domain representation of signals over time


domain representation.
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________
________________________________________________________________________

Department Of Electrical Engineering

Anda mungkin juga menyukai