Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

Electrical Engineering Department

LAB 03
DTFT, Reconstruction of Sampled Signal & effect of reconstruction time period.
Objective:
In today’s Lab we will take results from previous lab i.e. the sampled signal achieved at the end of
Lab 2 and convert it back to continuous time signal. In this lab the effect of reconstruction time
period on continuous time signal will also be analyzed.
Commands to be used:
• plot • imag • fft
• real • diff • fftshift
• exp • sin/cos • hold on/off
Help on these commands is available in MATLAB help directory.

Procedure:
1. Open M-file or M-Book
2. Save it by any useful name but remember not to start the name by any numeric digit, do not use any
special character other than under-the-score ( _ ) and also remember not to give any space in the name.
3. Execute Lab two and import z[n] from previous lab, for this purpose you can use clear, save and load
commands.

Task I
4. Let your m-file be named DTFT as in this part we are generating a function that can be used in future.
a. Syntax for generating functions:
function [output parameters]=name_such_as_DTFT (input parameters)
b. Let us consider the DTFT Formula 𝑋(𝑒 𝑗𝜔 ) = ∑∞ 𝑛=−∞ 𝑥[𝑛]𝑒
−𝑗𝜔𝑛

c. Let variable w represent 𝝎 and its limits be −2𝜋 < 𝜔 < 2𝜋


d. Let the discrete signal retrieved from step 3 be x[n]. Then, with help of transpose multiplication
implement the above formula given in step 4.b.

Task II
5. Let Tr be the reconstruction time period, and let it value be 1/100. (Fr=1/ Tr)
6. Now generate a signal sinc(πn/T𝑟 ) using the command sinc & pi where n= [0:length(x)*Fr]./Fr. ‘n’
is normalized because a sinc function always generate a zero on all integer multiples of pi. In order to
generate a sinc(πn/T𝑟 ) , it is required that zero crossing occurs on only 1/Tr.
7. For convolution you can use conv command but then you will not be able to understand the step by
step analysis. Therefore, we would use the following steps to execute convolution in a step wise visual
manner:
a. Let x be our standing signal and sinc be the moving.
b. Flip sinc but as sinc is symmetric on ‘0’ so flipping will result in the same step.
c. Let x_r be 0 & there be a loop with integer value k. And let it be initialized by 0.
d. Shift the sinc function to by n(Fr k+1) & dot multiply by x by shifted sinc and add into x_r.
e. Let step 7.d be repeated for k values, where is maximum equal to length of x. Use plot, hold
& waitforbuttonpress to view each step of convolution visually.
8. Now change the value of Fr to the actual sampling frequency as taken in Lab 2, and analyze the
reconstruction.
9. Alter the Fr, to different scales of actual sampling frequency as taken in Lab 2 and analyze the
reconstructed signal.
Questions:
1. Provide a full analysis of reconstruction process and effect of different sampling rates on
reconstruction using your MATLAB outputs, (Fr= Fs, Fr> Fs, Fr< Fs).

1|Page

You might also like