0% found this document useful (0 votes)
24 views7 pages

DSP Lab 7

The document is a lab manual for a Digital Signal Processing course at American International University - Bangladesh, focusing on Discrete Fourier Series (DFS) and Discrete Fourier Transform (DFT). It outlines the objectives, theory, methodology, experimental procedures, and simulation tasks for students to understand and apply DFT in a simulated environment using MATLAB. Additionally, it includes pre-lab homework, apparatus needed, precautions, and questions for report writing to facilitate learning and assessment.
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)
24 views7 pages

DSP Lab 7

The document is a lab manual for a Digital Signal Processing course at American International University - Bangladesh, focusing on Discrete Fourier Series (DFS) and Discrete Fourier Transform (DFT). It outlines the objectives, theory, methodology, experimental procedures, and simulation tasks for students to understand and apply DFT in a simulated environment using MATLAB. Additionally, it includes pre-lab homework, apparatus needed, precautions, and questions for report writing to facilitate learning and assessment.
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/ 7

Experiment 07 Lab Manual

American International University - Bangladesh


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

Title: Discrete Fourier Series and Discrete Fourier Transform.

Introduction:

A Fourier series is a representation of a function in terms of a summation of an infinite


number of harmonically-related sinusoids with different amplitudes and phases. The
amplitude and phase of a sinusoid can be combined into a single complex number, called a
Fourier coefficient. When the function being represented, whether finite-length or periodic,
is discrete, the Fourier series coefficients are periodic, and can therefore be described by
a finite set of complex numbers. That set is called a discrete Fourier transform (DFT).

The primary objective of this simulation experiment is to-


1. Have an in-depth understanding of DFT using simulated environment.
2. Representing DFS as a suitable tool for manipulating discrete-time signals.

Theory and Methodology:

If a discrete signal x(n) is periodic with a period of N. It means the signal satisfies the
following condition x(n) = x(n + kN) , where k is integer and N is the fundamental period of
the sequence. Then this signal can be expressed
1
as
N–1
2G kn
j
x(n) = ∑k=0 N......................... (A)
X(k)e N

where n = 0 , ± 1 , ± 2 ,......... and X ( k ), k = 0 , ± 1 , ± 2 ,..........are called the discrete Fourier


series coefficients, which is given by
X(k) = ∑N–1 x( n) kn–j
2G
…. … …(B)
n=0
e N

where k = 0, ± 1 , ± 2 ,......... . The discrete Fourier series coefficients X(k) is itself a complex-
valued periodic sequence with fundamental period of N. Using WN=exp(-2n/ N), we express
equation (A) & (B) as-
nk............
X(k) = ∑N–1
n=0 x( n) W N (C)
..............
x(n) = 1 ∑N–1 X(k)W N -nk (D)
N k=0

Discrete Fourier Transform (DFT)


To compute the Fourier transform numerically on a computer, discretization plus numerical
integration are required. This is an approximation of the true (i.e., mathematical), analytically-
defined FT in a synthetic (digital) environment, and is called Discrete Fourier Transformation
(DFT). The DFT of a continuous time signal sampled over the period of T, with a sampling rate
of Δt can beT given as
S(m∆f) = ∑N–1 s(n∆t)e –j2nN ∆fn∆t
N n=0
where Δf=1/T, and, is valid at frequencies up to fmax = 1/(2Δt).
The Discrete Fourier Series (DFS) is practically equivalent to the Discrete Fourier
Transform (DFT) when 0≤n≤N-1. [The students are asked to check the text book for
proof] Therefore, the implementation of DFT should be similar to that of DFS.

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


Pre-Lab Homework:

Study the formulae of Discrete Fourier Series (DFS) and Discrete Fourier Transform from
Theory and methodology section.

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:

Example 1: Find the DFT of a periodic discrete signal defined by


x(n)={ ……. 0,1,2,3,0,1,2,3,0,1,2,3......................}

Also find one period of the signal from the DFS coefficients implementing Inverse Discrete
Fourier Transform. [For the given signal, the fundamental period is N=4. The signal can be
defined one period as xn={0,1,2,3}. By calling the dfs function written in Appendices
section, compute the DFS]

Example 2: A periodic signal is given by


x ( n ) = 1; mN≤n≤mN+L-1
= 0; mN+L≤n≤(m+1)N-1
where m=0,±1, ±2, ……, N is the fundamental period, L/N is the duty cycle.
Find the DFS of the signal and plot the magnitude spectrum for different L and N.

Example 3: Let x(n) be a 4-point sequence define by


x(n) = 1, 0≤n≤3
= 0, otherwise
a. Compute the Discrete Time Fourier Transform (DTFT) of x(n)
b. Compute the 4-point DFT.
c. Compute the 8-point, 16-point and 64 point DFT of x(n.)
d. Compare the results of all DFTs.
Simulation and Measurement:
1.
xn=[0 1 2 3]
N=4
xk=dfs(xn,N)
FINDING ONE
PERIOD OF THE
SIGNAL FROM
THE DFS
COEFFICIENTS:
N=4
Xk=[6.0000
-2.0000+2.0000i
-2.0000-0.0000i
-2.0000-2.0000i]
xn=idfs(xk,N)

2.
L=5;
N=20;
n=[-N:N+1];
x1=[ones(1,L),
zeros(1,N-L+1)];
x=[x1 x1]
subplot(221)
stem(n,x)
title('Signal')
% find the DFS
with period N=20
and duty cycle
=5
k=[-N/2:N/2]
xn=[ones(1,L),
zeros(1,N-L)]
Xk=dfs(xn,N);
magXk=abs([Xk(
N/2+1:N)
Xk(1:N/2+1)])
subplot(222)
stem(k,magXk)
title('DFS with
N=20, L=5')
% find the DFS
with period N=50
and duty cycle=5
N=50;
L=5;
k=[-N/2:N/2]
xn=[ones(1,L),
zeros(1,N-L)]
Xk=dfs(xn,N);
magXk=abs([Xk(
N/2+1:N)
Xk(1:N/2+1)])
subplot(223)
stem(k,magXk)
title('DFS with
N=50, L=5')
% find the DFS
with period
N=100 and duty
cycle=5
N=200
L=5
k=[-N/2:N/2]
xn=[ones(1,L),
zeros(1,N-L)]
Xk=dfs(xn,N);
magXk=abs([Xk(
N/2+1:N)
Xk(1:N/2+1)])
subplot(224)
stem(k,magXk)
title('DFS with
N=200, L=5');
3.
w=0:pi/200:2*pi
H=1+exp(-j*w)
+exp(-j*2*w)
+exp(-j*3*w)
subplot(221)
plot(w,abs(H))
title('Magnitude
of DTFT of x(n)')
axis([0 6 0 4])
% computer the
4-point DFT
x=[1 1 1 1]
N=4
n=0:1:(N-1)
X4=dft(x,4)
subplot(222)
stem(n,abs(X4))
title('Magnitude
of 4-point DFT')
axis([0 3 0 4])
% compute the
16-point DFT
N=16
x=[ones(1,4)
zeros(1,12)] %
Note that x has
been zero
padded
n=0:1:(N-1)
X8=dft(x,N)
subplot(223)
stem(n,abs(X8))
hold on
plot(n,abs(X8),'-.k
')
title('Magnitude
of 16-point DFT')
axis([0 16 0 4])
% compute 32
point DFT
N=32
x=[ones(1,4)
zeros(1,28)] %
Note that x has
been zero
padded
n=0:1:(N-1)
X8=dft(x,N)
subplot(224)
stem(n,abs(X8))
hold on
plot(n,abs(X8),'-.k
')
title('Magnitude
of 32-point DFT')
axis([0 32 0 4])

Questions for report writing:

1. Compare the results with your theoretical understanding and comment on the
findings.
2. Give the clear screen-shots where appropriate and describe what the figures might
mean theoretically.
3. Give the simulation codes at the end of the report.
Discussion and Conclusion:

Interpret the data/findings and determine the extent to which the experiment was successful
in complying with the goal that was initially set. Discuss any mistake you might have made
while conducting the investigation and describe ways the study could have been improved.

Reference(s):

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


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

You might also like