Faculty of Engineering: Laboratory Report Cover Sheet
Faculty of Engineering: Laboratory Report Cover Sheet
Faculty of Engineering
Laboratory Report Cover Sheet
Students must complete all details except the faculty use part.
Please submit all reports to your subject supervisor or the office of the concerned faculty.
Individual Group
Group Number (if applicable): Submission Submission
Student
No. Student Name Student Number Signature Date
Submitted by:
Group Members:
2
3
4
5
Introduction:
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 as
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.
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:
idfs function
function
[Xk]=idfs(Xk,N
)
% Compute
Inverse
Discrete
Fourier Series
Co-efficients %
[xn]=one of period
of the periodic
sequence % [Xk]=DFS
coefficients error %
N= fundamental
period n=[0:1:N-1]
k=[0:1:N-1]
WN=exp(j*2*pi/N);
nk=n'*k;
WNnk=WN.^(nk);
Xk=(Xk*WNnk)/N
; end
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.00002.0000i]
xn=idfs(xk,N)
idft function
function
[Xk]=idft(Xk,N
)
% Compute
Inverse
Discrete
Fourier Series
Co-efficients %
[xn]=one of
period of the
periodic sequence
% [Xk]=DFS
coefficients
error % N=
fundamental period n=[0:1:N-1]
k=[0:1:N-1] WN=exp(j*2*pi/N);
nk=n'*k; WNnk=WN.^(nk);
Xk=(Xk*WNnk)/N end
-------------------------
w=0:pi/200:2*p i
H=1+exp(j*w)+exp(j*2*w)+exp(j*3
*w) subplot(111) plot(w,abs(H))
title('Magnitu de of DTFT of
x(n)') axis([0 6 0
4])
In this lab Discrete Fourier Series and Discrete Fourier Transform were performed in
MATLAB. The theory concept of discrete Fourier transform and the discrete Fourier
series were successfully learned and implemented. The output was obtained
smoothly during experiment time. The code was written as instructed.
Reference(s):