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

Dsp_lab_5

This lab manual focuses on the Discrete Time Fourier Transform (DTFT) and its properties, guiding students through computations and interpretations of DTFT for discrete signals. The experiment includes verifying properties such as linearity, time shifting, frequency shifting, and convolution using MATLAB. Students are expected to document their findings and results in a structured report format.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Dsp_lab_5

This lab manual focuses on the Discrete Time Fourier Transform (DTFT) and its properties, guiding students through computations and interpretations of DTFT for discrete signals. The experiment includes verifying properties such as linearity, time shifting, frequency shifting, and convolution using MATLAB. Students are expected to document their findings and results in a structured report format.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Experiment 5 Lab Manual

American International University- Bangladesh


Department of Electrical and Electronic Engineering
EEE3211: Digital Signal Processing Laboratory

Title: Discrete Time Fourier Transform.

Introduction:

Discrete Time Fourier Transform is an important feature of DSP system. It helps us


to determine different frequency component of any discrete time signal.

This experiment will guide to


1. learn how to compute and interpret the Discrete Time Fourier Transform (DTFT) of
a discrete signal
2. investigate basic properties of DTFT.

Theory and Methodology:

Discrete-time Fourier transform (DTFT) transforms a time-domain function into the


frequency domain. The DTFT requires an input function that is discrete signal to transfer it to
frequency domain. The DTFT is a special case of the Z-transform that has been introduced in previous
lab. Z-transform is defned as:
X(z) = ∑ ( ) -n
So the special case is z = . If x(n) is absolutely summable ,then its DTFT is given by

X( )=∑ ( )
inverse Discrete Time Fourier Transform (IDFT) is defined as

The e

x(n) = ∫ ( ) d

IDFT converts frequency domain signal to time domain.


Some of the important properties of the DTFT are as follows:

1. Periodicity: The Discrete Time Fourier Transform (DTFT) of a signal x(n) is periodic in

with a period of 2π.

X ( e jω ) = X ( e j (ω + 2π ))

2. Symmetry: For a real valued signal x(n) , its DTFT X ( e jω ) is a conjugate symmetric.

X ( e jω ) = X * (e jω )

3. Linearity: The DTFT is a linear transformation; that is ;


If ) x1(n)⟷ X1(

& ) x2(n)⟷ X2(

Then
X1( )+ β X2( )
x1(n)+β x2(n) ⟷

© Dept. of EEE, Faculty of Engineering, American Internatonal University-Bangladesh (AIUB) 1


4. Time Shifting: A shift in the time domain corresponds to the phase shifting in
frequency domain.
x(n-k)⟷ X1( )

5. Frequency Shifting: Multiplication by a complex exponential corresponds to a shift in


the frequency domain. ( )
x(n) ⟷X( )

6. Convolution Property: Convolution in time domain corresponds to the multiplication


in frequency domain.
x1(n)∗x2(n)⟷ X1( ) X2( )

Pre-Lab Homework:

Students are supposed to learn about the important properties of DTFT (stated above)
before appearing to lab.

Apparatus:

1. Computer (Desktop/Laptop)
2. MATLAB (at least version 6)

Precautions:

Make sure that all the m-files are saved in the current directory of MATLAB. Otherwise, the m-
files will not be found and executed when they are called from the command window.

Experimental Procedure:

1. Find DTFT of the signal defined by x(n) = (0 .9 exp( jπ / 3))n where 0 ≤n≤10.
2. Verify Linearity property [Assume, x1(n ) and x2(n) be two random
sequences uniformly distributed between [0,1] over 0≤n≤10].
3. Verify Time shif property.
[To verify the time shifting property , generate a random sequence uniformly
distributed between [0,1] over 0 ≤n≤10 and generate another signal y(n)=x(n-2).
Then verify the sample shif property.]
4. Verify Frequency shif property. [To verify the frequency shif property, we
will generate two signals x(n) and y(n) defned by x(n)=cos(πn /2) ,where
0≤n≤100 and
jπ n / 4
y(n)=e x ( n )]
5. Verify Convolution property using the following
signals-x(n)= {1 3 5 7 9 11 13 15 17}

and h(n)={1 -2 3 -2 1}

© Dept. of EEE, Faculty of Engineering, American Internatonal University-Bangladesh (AIUB) 2


Simulation and Measurement:

Simulaton And Measurement:


CODE RESULTS
1. Find DTFT of the signal defned by Magnitude Part
x(n) = 8
n = 0:10;
x = (0.9*exp(j*pi/3)).^n; 6
k = -200:200;

Magnitude
4
w =(pi/100)*k;
X = x*(exp(-j*pi/100)).^(n'*k);
2
magX = abs(X); angX = angle(X);
subplot(2,1,1); 0
plot(w/pi,magX); -2.5 -2 -1.5 -1 -0.5 0 0.5 1 1.5 2
grid Frequency in pi units
xlabel('Frequency in pi units');
0.5
ylabel('Magnitude');
title('Magnitude Part');
subplot(2,1,2);
plot(w/pi, angX/pi);

Radiansipi
0
grid
xlabel('Frequency in pi units');
ylabel('Radiansipi');
tille('Angle Part'); -0.5
-2.5 -2 -1.5 -1 -0.5 0 0.5 1 1.5 2
Frequency in pi units

2. DTFT of alpha*x1+ beta*DTFT of x2


30
x1=rand(1,11); % generate random number x1
x2=rand(1,11); % generate random number x2
DTFT of X cheek

20
x2=rand(1,11); % generate random number x2
10
alpha=2;
beta=3; 0
x3=alpha*x1+beta*x2; % generate left side of
-10
property axi(n)+ p x2(n) -1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1
frequency in pi units
w = -pi:pi/200: pi;
X1=freqz(x1,1,w); % DTFT of xl
X2=freqz(x2,1,w);% DTFT of x2
X3=freqz(x3,1,w);%DTFT of x3
subplot(2,1,1);
plot(w/pi,X3)
xlabel('frequency in pi units');
ylabel('CDTFT of x3');
title('DTFT of "a1pha*xl+betex2');
X_check=alpha*X1+beta*X2; % generate right
side of property ax,(4))+ p X2(w)
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 cheek');
title('DTFT of alpha*x1+ beta*DTFT of x2');
3.
x=rand(1,11);%generaterandomnumber w=- 10

pi:pi/250:pi;
X_L=freqz([0 0 x],1,w);

X(w)exp(-jwk)
5
%DTFTofleftpartofequation
subplot(2,1,1) 0
plot(w/pi,abs(X_L))
X= freqz(x,1,w); -5
-1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1
X_R=exp(-j*2*w).*X;%DTFTofrightpartofequation
frequencyinpiunits
subplot(2,1,2)
plot(w/pi, abs(X_R)) 10
subplot(2,1,1);
plot(w/pi, X_L)

DTFT of x(n-k)
5
xlabel('frequencyinpiunits');ylabel('X(w)exp(-
jwk)'); subplot(2,1,2);plot(w/pi,X_R) 0
xlabel('frequency in pi units');
ylabel('DTFT of x(n-k)'); -5
-1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1
frequency in pi units

4. DTFT of signal vs frequency


n=0:100; 60

x=cos(pi*n/2); % Generate signal x


40
w=-pi:pi/100:pi;
X=freqz(x,1,w); % DTFT of x
20
subplot(211)
plot(w,abs(X))
0
title(' DTFT of signal vs frequency') -4 -3 -2 -1 0 1 2 3 4
y=exp(j*pi*n/4).*x % generate y(n)
Frequency shift due to multiplying exp(jwn)
Y=freqz(y,1,w) % DTFT of y(n) 60
subplot(212)
plot(w,abs(Y)) % plot it 40
title('Frequency shift due to multiplying
exp(jwn)') 20

0
-4 -3 -2 -1 0 1 2 3 4

5. Product of magnitude spectrum Phasespectum


w=-pi:pi/256:pi; 100 4
x=[1 3 5 7 9 11 13 15 17];
h=[1 -2 3 -2 1]; 2
X=freqz(x,1,w);
%ThisisanalternativewaytofindDTFTofx1(n) 50 0
H=freqz(h,1,w);%DTFTofx2(n)
XP=X.*H; -2
subplot(221)
0 -4
plot(w/pi,abs(XP)) -1 -0.5 0 0.5 1 -1 -0.5 0 0.5 1
title('Product of magnitude spectrum')
% find the convolution of x1(n) and x2(n) Magnitudespectrumofconvoledsequence Phase of convolved sequence
subplot(222) 100 4
plot(w/pi,angle(XP))
2
title('Phasespectum')
y=conv(x,h);
50 0
Y=freqz(y,1,w);
subplot(223) -2
plot(w/pi,abs(Y))
title('Magnitudespectrumofconvoledsequence') 0 -4
subplot(224) -1 -0.5 0 0.5 1 -1 -0.5 0 0.5 1
plot(w/pi,angle(Y))
title(' Phase of convolved sequence')
Instructions for report writing:

1. Report should consist of plots, simulation results, and any additional assignment
your instructor might assign to you.
2. Include all the results in chronological manner in the ‘Simulation and
Measurement’ section.
3. Put the corresponding codes in appendix section at the end of the report.

Discussion and Conclusion:

In this lab the using of Discrete Time Fourier Transform in MATLAB was described. The
general concept Discrete Time Fourier Transform was successfully learned and implemented
the code carefully. A mathematical problem was done successfully and the output

Reference(s):

1. John G. Proakis & Dimitris G. Manolakis, “ Digital Signal Processing –


Principles, Algorithms and Applications”, Prentice – Hall India, 3 rd Edition.

© Dept. of EEE, Faculty of Engineering, American Internatonal University-Bangladesh (AIUB) 3

You might also like