You are on page 1of 6

AMERICAN INTERNATIONAL UNIVERSITY BANGLADESH

Faculty of Engineering
Laboratory Report Cover Sheet

Students must complete all details except the faculty use part.

Please submit all reports to your subject supervisor or the office of the concerned faculty.

Laboratory Title: Discrete Time Fourier Transform.


Experiment Number: ___05__ Due Date: 19-10-20 Semester: Summer 2019-2020
Subject Code: EEE_____ Subject Name: Digital Signal Processing Section: ___D__
Course Instructor: Tahia Fahrin Karim Degree Program: EEE_________

Declaration and Statement of Authorship:


1. I/we hold a copy of this report, which can be produced if the original is lost/ damaged.
2. This report is my/our original work and no part of it has been copied from any other student’s work or from
any other source except where due acknowledgement is made.
3. No part of this report has been written for me/us by any other person except where such collaboration has
been authorized by the lecturer/teacher concerned and is clearly acknowledged in the report.
4. I/we have not previously submitted or currently submitting this work for any other course/unit.
5. This work may be reproduced, communicated, compared and archived for the purpose of detecting
plagiarism.
6. I/we give permission for a copy of my/our marked work to be retained by the School for review and
comparison, including review by external examiners.
I/we understand that
7. Plagiarism is the presentation of the work, idea or creation of another person as though it is your own. It is a
form of cheating and is a very serious academic offence that may lead to expulsion from the University.
Plagiarized material can be drawn from, and presented in, written, graphic and visual form, including
electronic data, and oral presentations. Plagiarism occurs when the origin of the material used is not
appropriately cited.
8. Enabling plagiarism is the act of assisting or allowing another person to plagiarize or to copy your work

Individual Group
Group Number (if applicable): Submission Submission

Student
No. Student Name Student Number Signature Date
Submitted by:

1 NAHIN AKHTAR 17-34113-1 19-10-20

Group Members:
2
3
4
5

For faculty use only:


Total Marks: _______ Marks Obtained: _______

Faculty comments__________________________________________________________________________
Simulation:
PROBLEM MATLAB CODE OUTPUT
1. Find 1. clc;
DTFT of n = 0:10; x =
the signal (0.9*exp(j*pi/3)).^n; k =
defined by -200:200;
x(n) = (0 .9 w =(pi/100)*k;
exp( jπ / X = x*(exp(-
j*pi/100)).^(n'*k);
3))n where
magX = abs(X); angX =
0 ≤n≤10. angle(X);
subplot(2,1,1);
plot(w/pi, magX);
grid
xlabel('frequency in pi
units');
ylabel('Magnitude');
title('Magnitude Part');
subplot(2,1,2);
plot(w/pi, angX/pi);
grid
Alternative
way to find clc;
DTFT of a clc;
signal x(n) n=0:10;
x=(0.9*exp(i*pi/3)).^n;
w=-2*pi:pi/100:2*pi;
X=freqz(x,1,w)
plot(w,X)
grid on;

2. Verify clc;
Linearity x1=rand(1,11); % generate
property random number x1
x2=rand(1,11); % generate
[Assume, random number x2
x1(n ) and alpha=2;
x2(n) be beta=3;
two random x3=alpha*x1+beta*x2; %
sequences generate left side of
uniformly property ?x1(n)+ ? x2(n)
distributed w = -pi:pi/200: pi;
between X1=freqz(x1,1,w); % DTFT
of x1
[0,1] over
X2=freqz(x2,1,w) ;% DTFT
0≤n≤10]. of x2
X3=freqz(x3,1,w) ;% DTFT
of x3
subplot(2,1,1);
plot(w/pi,X3)
xlabel('frequency in pi
units');
ylabel('DTFT of x3');
title('DTFT of
"alpha*x1+beta*x2"');
X_check=alpha*X1+beta*X2;
% generate right side of
property ?X1(m)+ ? X2(m)
error=max(abs(X3-
X_check)); % check the
difference between left
and right side
subplot(2,1,2);
plot(w/pi,X_check)
xlabel('frequency in pi
units');
ylabel('DTFT of X
_check');
title('DTFT of alpha*x1+
beta*DTFT of x2');
3. Verify clc;
Time shift x=rand(1,11); %generate
property. randomnumber
w=-pi:pi/250:pi;
[To verify
X_L= freqz([0 0 x],1,w);
the time %DTFT of left part of
shifting equation
property , subplot(2,1,1)
generate a plot(w/pi, abs(X_L))
random xlabel('frequency in pi
sequence units');
uniformly ylabel('DTFT of x(nk)');
X= freqz(x,1,w);
distributed
X_R= exp(-j*2*w).*X;
between %DTFT of right part of
[0,1] over 0 equation
≤n≤10 and subplot(2,1,2)
generate plot(w/pi, abs(X_R))
another xlabel('frequency in pi
signal units');
y(n)=x(n-2). ylabel('X(w)exp(-jwk)');
Then verify
the sample
shift
property.]
4. Verify n=0:100;
Frequency x=cos(pi*n/2); % Generate
shift signal x
w=-pi:pi/100:pi;
property. X=freqz(x,1,w); % DTFT of
[To verify x
the subplot(211)
frequency plot(w,abs(X))
shift title(' DTFT of signal vs
property, frequency')
we will y=exp(j*pi*n/4).*x
generate %generate y(n)
Y=freqz(y,1,w) % DTFT of
two signals
y(n)
x(n) and subplot(212)
y(n) defined plot(w,abs(Y)) % plot it
by title('Frequency shift
x(n)=cos(πn due to multiplying
/2) ,where exp(jwn)')
0≤n≤100
and y ( n ) =
e jπ n / 4 x (
n )]
5. Verify clc;
Convolution w=-pi:pi/256:pi;
property x=[1 3 5 7 9 11 13 15
17];
using the
h=[1 -2 3 -2 1];
following X=freqz(x,1,w); % This is
signalsx(n)= an alternative way to
{1 3 5 7 9 find DTFT of x1(n)
11 13 15 H=freqz(h,1,w); % DTFT of
17} ↑ and x2(n)
h(n)={1 -2 XP=X.*H;
3 -2 1} subplot(221)
plot(w/pi,abs(XP))
title('Product of
magnitude spectrum') %
find the convolution of
x1(n) and x2(n)
subplot(222)
plot(w/pi,angle(XP))
title('Phase spectum')
y=conv(x,h);
Y=freqz(y,1,w);
subplot(223)
plot(w/pi,abs(Y))
title('Magnitude spectrum
of convoled sequence')
subplot(224)
plot(w/pi,angle(Y))
title(' Phase of
convolved sequence')

Discussion and conclusion:


Overall, throughout the laboratory experiment, we completed our objective of understanding
and computation and interpret the Discrete Time Fourier Transform of a discrete signal. We also
discussed some important properties of DTFT like periodicity, symmetry, linearity, time
shifting, Frequency shifting and convolution property and verified those properties using
MATLAB code. When we did this in MATLAB, we took some precautions by taking this
command close all or clc we make sure any previous command doesn’t interrupt with the new.
As we got the result as same as what we expected therefor our excrement was successful.

Reference(s):
1.John G. Proakis & Dimitris G. Manolakis, “Digital Signal Processing – Principles,
Algorithms and Applications”, Prentice – Hall India, 3rd Edition.

You might also like