LAB5
LAB5
Student Name:
Reg. No. :
Date :
Signature :
Objectives:
DTFT and Z-transform both provide frequency domain for discrete signals and are not numerically
computable transforms due to the following reasons:
The evaluations of those transforms in Matlab or any DSP system are just approximations to the exact
calculations.
We need to avoid these issues and use a transform that is suitable for computer implementations.
DFS resolves the second issue by sampling the frequency domain variables, w or z, but in time domain,
it uses periodic sequences with infinite duration.
DFT avoids the two mentioned issues by sampling the frequency domain and used for finite duration
sequences.
DFT is numerically computable transform. Its computations for long sequences is time consuming,
therefor several algorithms has been developed to efficiently compute DFT. They are called FFT
algorithms
Procedure:
Step1: Write down the following DFT and IDFT functions, open a new script (15 Minutes)
N = 10;
n = (0:N-1);
k = (-N/2:N/2);
xn = cos(0.48*pi*n) + cos(0.52*pi*n);
X = dft(xn,N);
Xamp = abs([X(N/2+1:N) X(1:N/2+1)]);
w = (2*pi)/N * k;
subplot(2,1,1), stem(n,xn),grid on;
subplot(2,1,2), stem(w,Xamp),grid on
Q2) Try using N = 10, 20, 50, 80, and 100 samples, Write your note?
end
plot(N,fft_time,N,dft_time),legend('FFT TIme','DFT Time');
grid on;xlabel('N Samples');ylabel('Processing Time');
Homework:
Using the above dft.m function, compute DFT for the following signal:
x(n) = [ 1 1 1 1 1 0 0 0 0 0 1 1 1 1 1 0 0 0 0 0]
Plot its time and amplitude spectrum.