Lab Rubrics DSP Lab
Lab #:                    05
Lab Title:                Discrete time Fourier transform
Submitted by:
                                       Names                                                              Registration #
Saman Nosheen                                                                                       FA17-BEE-012
Maryum Zafar                                                                                        FA17-BEE-006
Faiz ur Rehman                                                                                      FA17-BEE-031
Ali Sajjad                                                                                          FA17-BEE-001
                                 Rubrics name & number                                                           Marks
                                                                                                      In-Lab             Post-Lab
Engineering     R2: Use of Engineering Knowledge and follow Experiment Procedures:
Knowledge       Ability to follow experimental procedures, control variables, and record
                procedural steps on lab report.
                R3: Interpretation of Subject Knowledge: Ability to interpret and explain
                mathematical and/or visual forms, including equations, diagrams, graphics,
                figures and tables.
Problem         R5: Data/Evidence Measurements:
Analysis        Ability to record raw data / evidence.
                R6: Experimental Data Analysis:
                Ability to interpret findings, compare them to values in the literature, identify
                weaknesses and limitations.
Design          R7: Implementing Design Strategy: Ability to execute a solution
                taking into consideration design requirements and pertinent
                contextual elements. [Block Diagram/Flow chart/Circuit Diagram]
                R8: Best Coding Standards:
                Ability to follow the coding standards and programming practices.
Modern          R9: Understand Tools: Ability to describe and explain the principles behind
Tools Usage     and applicability of engineering tools.
                R11: Tools Evaluation:
                Ability to simulate the experiment and then using hardware tools to verify the
                results.
 Individual     R12: Individual Work Contributions: Ability to carry out individual
    and         responsibilities.
 Teamwork
                R13: Management of Team Work:
                Ability to appreciate, understand and work with multidisciplinary team
                members.
                                                          Rubrics to follow
Rubrics#        R2          R3          R5           R6           R7           R8           R9      R11        R12          R13
  In –Lab
 Post- Lab
                   Lab 05 Discrete Time Fourier Transform
   1. Objectives:
    To become familiar with DTFT and its properties.
    To find the DTFT of signal in MATLAB.
   2. Introduction:
Discrete Time Fourier Transform (DTFT) is a frequency analysis tool for a periodic discrete
time signals The DTFT of x[n] , X(e^jw) is given by following equation :
                                               ∞
                                 X(e )= ∑ x [n¿ ]e− jwn ¿
                                     jw
                                             n=−∞
 Fourier transform, X(ejw) is also called spectrum and is a continuous function of the
frequency parameter. To convert X(ejw) to x[n] , we use inverse DTFT equation which is given
by:
                                                π
                                            1
                                   x[n]=       ∫  X ( e jw )e jwn
                                           2 π −π
DTFT Properties:
We can compute DTFT in following three ways
   a) DTFT Using exact transformation (Analytic form)
   b) DTFT using definition/formulae (Numerical computation form)
   c) DTFT using function
   3. In Lab Tasks:
Task 01: Compute DTFT of a one-sided exponential:
                CODE
 a=1.5
 w = linspace(-pi,pi,2^8);
 X = exp(1j*w)./(exp(1j*w) - a);
 subplot(2,1,1)
 plot(w/pi,abs(X));grid
 xlabel('frequency in \pi');
 ylabel('|X|')
 title('Magnitude Part')
 subplot(2,1,2);
 plot(w/pi,angle(X));grid
 xlabel('frequency in \pi');
 ylabel('radians')
 title('Angle Part')
Task 02: Compute DTFT of a following signal:
   4. Post Lab Tasks:
Task 01: Compute DTFT of a following triangle:
 n=-15:15
 m=12
 x=[zeros(1,m) 1 2 3 4 3 2 1
 zeros(1,m)]
 N = 100;
 k = -N:N-1;
 w = (pi/N)*k;
 X = x*(exp(-1j*pi/N)).^(n'*k); %
 DTFT
 magX = abs(X); angX = angle(X);
 subplot(2,1,1); plot(w/pi,magX);grid
 xlabel('frequency in \pi'); ylabel('|X|')
 title('Magnitude Part')
 subplot(2,1,2); plot(w/pi,angX);grid
 xlabel('frequency in \pi');
 ylabel('radians')
 title('Angle Part')
Task 02: Prove frequency shift property of DTFT.
 CODE                                        title('Magnitude of X')
 clc                                         subplot(2,2,2);
 n=1:15                                      plot(w/pi,angX);grid
 m=12                                        xlabel('frequency in \pi');
 x=[ 4 3 1 ones(1,m)]                        ylabel('radians')
 N = 100;                                    title('Angle of X')
 k = -N:N-1;                                 subplot(2,2,3);
 w = (pi/N)*k;                               plot(w/pi,magY); grid
 X = x*(exp(-1j*pi/N)).^(n'*k); %            xlabel('frequency in \pi');
 DTFT of x                                   title('Magnitufe of Y');
 y=exp(j*pi*n/4).*x                          ylabel(' Magnitude')
 Y=y*(exp(-j*pi/100)).^(n'*k) %DTFT          subplot(2,2,4);
 OF y                                        plot(w/pi,angY); grid
 magX=abs(X); angX = angle(X);               xlabel('frequency in \pi');
 magY=abs(Y); angY = angle(Y);               title('Angle of Y');
 subplot(2,2,1);                             ylabel(' Radians')
 plot(w/pi,magX);grid
 xlabel('frequency in \pi');
 ylabel('Magnitude')
   5. Conclusions:
Through this lab, I came to know about DTFT and its properties. It is computed for the
frequency response analysis of a signal. . I also came to know about how to implement code in
MATLAB to compute DTFT in three different ways.