Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Reconstruction
1. Lab Report 03:
Submitted By :
Syed Abuzar Hussain Shah
SP15-BEE-096
Uzair Ahmed
SP15-BEE-106
Syed Hasnain Shah
SP15-BEE-100
Submitted To: Sir Usman
Class: BEE-5A
Dated: 30/03/2017
2. 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 timeperiod on continuous time signal will
also be analyzed.
Commands to be used:
• plot
• real
• exp
• imag
• diff
• sin/cos
• fft
• fftshift
• hold on/off
Task 1:
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.
3. Matlab Coding:
DTFT Function:
function [w, X] = DTFT(x)
w = -2*pi:0.01:2*pi;
n = 0:length(x)-1;
temp = w'*n;
temp = -1i*temp;
e = exp(temp);
X = e*x';
end
Coding:
clc
clear all;
close all;
load signal
fs=1000;
samp_freq=2*sf;
[w,Z]=DTFT(z);
subplot(231)
stem(z)
ylabel('x[n]')
title(['Original Signal sf=' num2str(sf) 'Hz'])
xlabel('n')
subplot(232)
plot(w,abs(Z))
title('FFT of x[n]')
ylabel('|X(e^j^ omega)|')
xlabel('omega')
4. Task 2:
Let Tr be the reconstruction time period, and let it value be 1/100.
(Fr=1/ Tr)
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.
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 visualmanner:
1. Let x be our standing signal and sinc be the moving.
2. Flip sinc but as sinc is symmetric on ‘0’ so flipping will result in the
same step.
3. Let x_r be 0 & there be a loop with integer value k. And let it be
initialized by 0.
4. Shift the sinc function to by n(Fr k+1) & dot multiply by x by shifted
sinc and add into x_r.
5. 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.
Now change the value of Fr to the actual sampling frequency as taken in
Lab 2, and analyze the reconstruction.
Alter the Fr, to different scales of actual sampling frequency as taken in
Lab 2 and analyze the reconstructed signal.
Matlab Coding:
fr=samp_freq;
Tr=1/fr;
len=length(z)-1;
n=(0:len*fr)/fr;
x=zeros(1,len*fr+1);
for i=0:len
x(1,i*fr+1)=z(i+1);
end
5. %Sinc Function And Zero Padding:
s=sinc(pi*n); %sin(2 pi t/2 Tr)
subplot(233)
stem(n,x)
title('zero padded signal')
xlabel('nT_r')
ylabel('x[nT_r]')
subplot(234)
plot(n,s)
title('sinc function')
ylabel('s(t)=sinc(2* pi /Tr *t)')
xlabel('t(msec)')
%Convolution Step by Step
x_rec=0;
for i=0:length(z)-1
u=z(i+1)*sinc(pi*(n-n(i*fr+1))/2);
x_rec=x_rec+u;
subplot(235)
stem(n,x)
hold on
plot(n,z(i+1)*sinc(pi*(n-n(i*fr+1))/2),'r')
hold off
grid on
subplot(236)
plot(n,x_rec)
title(['Tr=' num2str(fr/samp_freq) 'Ts & T actual is 20 msec' ]);
xlabel 't(ms)'
ylabel 'x_r(t)'
grid on
waitforbuttonpress
end
7. Q1): Provide a full analysis of reconstruction process and effect of different
sampling rates onreconstruction using your MATLAB outputs, (Fr=Fs,
Fr> Fs, Fr< Fs).
Ans: The sampling frequency or sampling rate, Fs, is the average number of
samples obtained in one second (samples per second) and Fs = 1/Ts.
If Fr>=Fs then our reconstructed signal is approximately equals to the original
signal but if Fr<Fs then our signal differs from the original signal.
Conclusion:
In this lab I learnt to reconstruct the original signal from samples. If
Reconstruction signal frequency (Fr) is greater then the sampling frequency we
can reconstruct our original signal quite well so we have more information
about the signal.