DSP Lab 7
DSP Lab 7
Date: 04/25/2024
Grade and Signature given by instructor:
Digital Signal Processing (Lab 7)
Experiment 6: Discrete Time Fourier Transform (DTFT) using MATLAB
Course Name: Digital signal processing Course Code: CMPE-371L
Assignment Type: Assignment/Lab/Project Dated:
Semester:6TH Session:2020
Lab/Project/Assignment #: 7 CLOs to be covered:
Lab Title: Discrete Time Fourier Series (DTFT) using Teacher Name: Ms. Sana Tasleem
MATLAB
Lab Evaluation:
CLO1 Students will be able to perform signal processing tasks and display
their results, using a DSP board or a modern software tool such as
MATLAB.
Levels (Marks) Level1 Level2 Level3 Level4 Level5 Level6
Psychomotor (8)
Total /10
CLO2 Students will be able to report in written form what they have learnt in
the lab after discussions with their peers.
Level1 Level2 Level3 Level4 Level5 Level6
Affective (3)
Dressing (2)
Total /5
LAB DETAILS:
Lab Goals/Objectives:
Generate the basic Matlab graph.
Create the histogram in Matlab .
Improve performance to create different types of signals and their analysis.
Problem 1
1. Write a MATLAB function to compute the DTFT of a finite duration sequence. The
function will compute 101 samples (from −π to π) of the DTFT of a discrete time signal. The
format of the function should be
Similarly, if a signal is odd and real, then its DTFT is odd and purely imaginary. This follows
from Hermitian symmetry for real signals, and the fact that the DTFT of any odd signal is
imaginary. Since signal is odd than dtft is purely imaginary
This code first defines the signal x[n] using the given expression, and then computes the DTFT of
x[n] using the DTFT function we created earlier. Finally, it plots the magnitude and phase of
X(w) over the range from -pi to pi.
The resulting plot shows that the DTFT of x[n] is a periodic function with a period of 2*pi/51.
The magnitude of the DTFT is constant at 1 for all frequencies, indicating that the signal is a pure
tone. The phase of the DTFT varies linearly with frequency, indicating that the signal is a linearly
frequency-modulated (LFM) signal
4. Plot the spectrum of x[n] in MATLAB using the DTFT which you have computed, as
the angular frequency varies from −5π to 5π.
The plot shows that the DTFT of x[n] is purely imaginary, with zero magnitude at all frequencies. This can
be explained by the conjugate antisymmetry property of the DTFT, which states that the DTFT of a
conjugate antisymmetric signal is purely imaginary. This property can be expressed mathematically as
follows:
If x[n] is a conjugate antisymmetric sequence,
i.e., x[-n] = conj(x[n]), then X(e^(jw)) = -jIm{X(e^(jw))}
Since x[n] is a real sequence, it follows that x[-n] = conj(x[n]) implies that x[n] is an odd function of n.
Therefore, we can use the fact that the DTFT of an odd function is purely imaginary to conclude that the
DTFT of x[n] is also purely imaginary. This is consistent with the plot above.
Problem 2
Let x1[n] = {1, 2, 2, 1} Starting index = 0
A new sequence x2[n] is formed using such that x2[n] = x1[n−1] + x1[n+4]. Notice
that x2[n] is conjugate symmetric and is also even.
Since x2[n] is conjugate symmetric and even, its DTFT X2(e^jω) can be expressed as:
where Re{•} denotes the real part. Now, using the time-shifting property of the DTFT, we
have:
3 Using the appropriate symmetry property of the DTFT explain why is the DTFT of
x[n] purely imaginary.
If a signal is even in addition to being real, then its DTFT is also real and even. This follows
immediately from the Hermitian symmetry of real signals, and the fact that the DTFT of any
even signal is real.
Similarly, if a signal is odd and real, then its DTFT is odd and purely imaginary. This follows
from Hermitian symmetry for real signals, and the fact that the DTFT of any odd signal is
imaginary.
In question wasn’t defined that we have to work for x1[n] or x2[n]. But for both signal the
DTFT is even and real not imaginary as both signal are even and real.
4 Verify your result using MATLAB by computing and plotting magnitudes of the respective
DTFTs.
x1(n - 1), 1 ≤ n ≤ 4;
0, Otherwise.
Problem 3
1 Write a MATLAB function to compute the inverse DTFT of a finite duration sequence.
The function will compute the discrete time signal using 101 samples (from −π to π) of its
DTFT. The format of the function should be