0% found this document useful (0 votes)
4 views

DSP Lab Spring 25 Exp-04

The document is a laboratory manual for a Digital Signal Processing course, specifically focusing on the Discrete Time Fourier Transform (DTFT). It outlines learning objectives, required equipment, and detailed tasks for students to compute and analyze the DTFT using MATLAB, including properties like time-shifting, frequency-shifting, and convolution. The manual also includes programming tasks that require students to evaluate and plot the DTFT for various sequences and verify certain properties.

Uploaded by

fakhar_fast
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

DSP Lab Spring 25 Exp-04

The document is a laboratory manual for a Digital Signal Processing course, specifically focusing on the Discrete Time Fourier Transform (DTFT). It outlines learning objectives, required equipment, and detailed tasks for students to compute and analyze the DTFT using MATLAB, including properties like time-shifting, frequency-shifting, and convolution. The manual also includes programming tasks that require students to evaluate and plot the DTFT for various sequences and verify certain properties.

Uploaded by

fakhar_fast
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

DIGITAL SIGNAL PROCESSING LAB

(EL-3031)
LABORATORY MANUAL

Discrete Time Fourir Transform(DTFT)


(LAB # 04)
Student Name: ______________________________________________

Roll No: ________________ Section: ____

Date performed: _____________, 2025

____________________________________________________________________________________________________________________________________________________________

NATIONAL UNIVERSITY OF COMPUTER AND EMERGING SCIENCES, ISLAMABAD

Prepared by: Engr. Muhammad Asim


Last Edited by: Engr. Muhammad Asim, Feb 06, 2016
Verified by: Dr. Shahzad Saleem, Dr. Farhan Khalid Updated: Spring 2023
DSP - Lab National University Roll No: __________
04

Lab #
of Computer and Emerging Sciences
(EL3031) Islamabad Spring 2025
_____________________________________________________________________________________
Lab # 04: Discrete Time Fourir Transform
Learning Objectives
To study various properties of discrete time Fourier transform and verify these properties on
various signals in Matlab.
Equipment Required
1. PC
2. MATLAB

1. Introduction
If x [n] is absolutely summable, that is

∑|x [ n ]|< ∞
−∞
Then it’s discrete-time Fourier transform is given by

X ( e jw )= ∑ x [ n ] e− jwn
n=−∞

The inverse discrete-time Fourier transform (IDTFT) of X ( e jw ) is given by

π
1
x [n]= ∫ X ( e jw ) e jwn dw
2 π −π

The discrete-time Fourier transform (DTFT) X (e jw ) of a sequence x [n] is a continuous

function of ω. Since the data in MATLAB is in vector form, X (e jw ) can only be evaluated

at a prescribed set of discrete frequencies. Moreover, only a class of the DTFT that is

expressed as a rational function ine− jw in the form


− jw − jwm
p0 + p1 e + … … … … … … .. p m e
X ( e )=
jw
− jw − jwn
1¿
d 0 +d 1 e + … … … … … … .. d n e

can be evaluated.

2. DTFT Computation
The DTFT X ( e jw )of a sequence x [n]of the form of Eq. (1) can be computed easily
at a prescribed set of L discrete frequency points ω=ω l using the MATLAB function
freqz. Since X (e jw ) is a continuous function of ω, it is necessary to make L as large as
possible so that the plot generated using the command plot provides a reasonable replica
of the actual plot of the DTFT. In MATLAB, freqz computes the L-point DFT of the
_____________________________________________________________________________________________
Page 2 of 6
DSP - Lab National University Roll No: __________
04

Lab #
of Computer and Emerging Sciences
(EL3031) Islamabad Spring 2025
_____________________________________________________________________________________
sequences { p0 p 1 ... pM } and {d 0 d 1 ... d M } ,and then forms their ratio to arrive at X (e jwl )
l=1 , 2 , … … … … , L .For faster computation, L should be chosen as a power of 2, such as 256
or 512.

Task 01
1) Evaluate the DTFT of follwing in the range 0 ≤ w ≤ π (512 points)
− jw −2 jw −3 jw
0.7−0.5 e + 0.3 e +e
U ( e )=
jw
− jw −2 jw −3 jw
1+0.3 e −0.5 e +0.7 e
2) Compute and Plot the magnitude response, phase response, real part and imaginary part
w
of U ( e jw ) w.r.t. . Label your plots properly.
π
Hint : Commands used; “freqz”, “angle” ,”abs” , “imag”, “real”

Task 02
Is the DTFT a periodic function of ω? If it is, what is the period?

Project 4.1
% Compute the frequency samples of the DTFT
w = -4*pi:8*pi/511:4*pi;
num = [2 1];den = [1 -0.6];
h = freqz(num, den, w);
% Plot the DTFT
subplot(2,1,1)
plot(w/pi,real(h));grid
title('Real part of H(e^{j\omega})')
xlabel('\omega /\pi');
ylabel('Amplitude');
subplot(2,1,2)
plot(w/pi,imag(h));grid
title('Imaginary part of H(e^{j\omega})')
xlabel('\omega /\pi');
ylabel('Amplitude');
figure;
subplot(2,1,1)
plot(w/pi,abs(h));grid
title('Magnitude Spectrum |H(e^{j\omega})|')
xlabel('\omega /\pi');
ylabel('Amplitude');
subplot(2,1,2)
plot(w/pi,angle(h));grid
title('Phase Spectrum arg[H(e^{j\omega})]')
xlabel('\omega /\pi');
ylabel('Phase, radians');
Task 03:

1) What is the expression of the DTFT being evaluated in the above Program and on what
range this DTFT is computed in the program?

_____________________________________________________________________________________________
Page 3 of 6
DSP - Lab National University Roll No: __________
04

Lab #
of Computer and Emerging Sciences
(EL3031) Islamabad Spring 2025
_____________________________________________________________________________________
2) Comment on your results. Can you explain the jump in the phase spectrum ? The jump
can be removed using the MATLAB command “unwrap”. Evaluate the phase
spectrum with the jump removed.
3) Is the DTFT a periodic function of ω? If it is, what is the period?

Task 04:

1) Write matlab Program to evaluate and plot the magnitude and phase response of DTFT
of the following finite-length sequence in the range 0 ≤ w ≤ π (512 points)

g [ n ] =[1 3 57 91113 15 17]

2) Modify the your code to plot the phase response in degrees.


3) Explain the jumps in your phase spectrum?

DTFT Properties:
The DTFT satisfies a number of useful properties that are often uitilized in a number
of applications. A detailed listing of these properties and their analytical proofs can be
found in any text on digital signal processing. These properties can also be verified using
MATLAB. We list below a few selected properties that will be encountered later in this
exercise.
Time-Shifting Property – If G( e jω )denotes the DTFT of a sequence g[n] , then the DTFT

of the time-shifted sequence g[n−no] is given by e− jωn G ( e jω ) .


0

Frequency-Shifting Property – If G( e jω ) denotes the DTFT of a sequence g[n] , then the

DTFT of the sequence e j w n g[n] is given by G(e j(ω−ω ) ).


0 0

Convolution Property – If G(e jω )and H (e jω )denote the DTFTs of the sequences g[n] and

h [n ], respectively, then the DTFT of the sequence g[n]∗h [ n ] is given by G(e jω )H (e jω ).

Time-Reversal Property – If G(e jω ) denotes the DTFT of a sequence g[n], then the DTFT

of the time-reversed sequence g[−n] is given by G(e− jω ) .

Task 05:

1) Write matlab Program to evaluate and plot the magnitude and phase response of DTFT
of the following finite-length sequence in the range −π ≤ w ≤ π (256 points)

g [ n ] =[1 2 3 4 5 6 7 8 9]

_____________________________________________________________________________________________
Page 4 of 6
DSP - Lab National University Roll No: __________
04

Lab #
of Computer and Emerging Sciences
(EL3031) Islamabad Spring 2025
_____________________________________________________________________________________
2) Verify the time shifting property of of DTFT using n 0=10. Plot the magnitude and
phase response of the DTFT of time shifted sequence and then also plot the magnitude
and phase spectrum of e− jωn G ( e jω ) .
0

3) Verify the frequency shifting property of of DTFT using w 0=0.5 π . Plot the magnitude
and phase response of the DTFT of frequency shifted sequence and then also plot the
magnitude and phase spectrum of G ( e j (ω−ω ) ). 0

Task 06:

1) Write matlab Program to evaluate and plot the magnitude and phase response of DTFT
of the following finite-length sequences in the range −π ≤ w ≤ π (256 points)

g [ n ] =[1 2 3 4 5 6 7 8 9] , h [ n ] =[1−2 3−2 1]

2) Verify the Convolution property of DTFT by performing convolution on both of above


sequences. Plot the magnitude and phase response of the DTFT of convolved sequence
and then also plot the magnitude and phase response of G ( e jω ) H ( e jω ).

_____________________________________________________________________________________________
Page 5 of 6
DSP - Lab National University Roll No: __________
04

Lab #
of Computer and Emerging Sciences
(EL3031) Islamabad Spring 2025
_____________________________________________________________________________________

_____________________________________________________________________________________________
Page 6 of 6

You might also like