You are on page 1of 5

Center for Advanced Studies in Engineering,

Islamabad
DIGITAL COMMUNICATIONS LAB

EXPERIMENT # 05: CORRELATION & REALIZATION OF MATCHED


FILTER

Name of Student: …………………………………………………….

Roll No.: ……………………………………………………………….

Date of Experiment: ………………………………………………….

Report submitted on: ………………………………………………..

Marks obtained: ……………………………………

Remarks: ……………………………………………

Instructor’s Signature: ……………………………...


Code
clc; clear all; close all
%%
% Data Collection
data=randi([0 1],1, 1000);
A=1;
Tb=10;
S_0= A * ones(1, Tb);
S_1= [A*ones(1, Tb/2) -A*ones(1, Tb/2)];
subplot(411), plot(S_0), title('Signal 1')
subplot(412), plot(S_1), title('Signal 2')

%Transmission
tr=[];
for a=1:length(data)
if(data(a)==1)
tr=[tr S_1];
else
tr=[tr S_0];
end
end

%Noise addition
for SNR=1:10
% SNR=10; %10db scale SNR=Eb/No
snr_linear=10^(SNR/10);
Eb=10; %Energy of signal is 1 down to 10 i.e. Tb
No=Eb/snr_linear;
Noise=((No/2)^1/2) * randn(1, length(tr));
noise_rec= Noise + tr;
subplot(413), plot(noise_rec), title ('Noise added through channel')

%Correlator
rec=[];
n=0;
for b=1:Tb:length(noise_rec)
n=Tb+b-1;
A_0=noise_rec(b:n).*S_0; %return a 1x10 matrix
a0=sum(A_0); %adds 1x10 numbers and returns a constant
A_1=noise_rec(b:n).*S_1;
a1=sum(A_1);
if (a0 > a1)
rec=[rec 0];
else
rec=[rec 1];
end
end
subplot(414), plot(rec), title('recieved signal')

[num(SNR) ratio(SNR)]=biterr (data, rec)


semilogy(1:SNR, ratio)
xlabel('SNR (db)')
ylabel('Bit array rate')

end
Center for Advance Studies in Engineering, Islamabad
Digital Communication
Lab # 05
Name: _____________________________ Roll No.: ____________________

Lab #05 Marks distribution:

ER1=30 ER4=20 ER7=20 ER9=30


Lab Task

Lab #05 Marks obtained:

ER1 ER4 ER7 ER9


Lab Task

Lab #05 Rubric Evaluation Guideline:

# Qualities & 0 < Poor <= 12 < 21 < Good <= 27 <
Criteria 12 Satisfactory <= 27 Excellent <=
21 30
ER1 Task No Tasks were Some tasks were Few tasks were All tasks
Completion completed/ completed. Could left to be completed in
minimal effort not justify the completed. due time. All
shown reasons for Provided goals achieved.
uncompleted tasks acceptable
and goals. justification for
the uncompleted
tasks and goals.
# Qualities & 0 < Poor <= 8 8 < Satisfactory 14 < Good <= 18 <
Criteria <= 14 18 Excellent <=
20
ER4 System None of the Incomplete Diagrams Correct
model/ requirements diagrams and without labels Diagrams,
Mathematical are fulfilled/ partially correct and few details. properly labeled
model/ Demonstrates labels/Circuit Construction is showing all the
Network minimal or no doesn’t incorporate fairly good / necessary
model/ Block understanding required Chooses a details and
diagram/ of the components/ mathematical Input/Outputs/
Circuit connection Blocks not model that Chooses an
Diagram/ between connected applies to an optimal
Simulation mathematical correctly/ Chooses engineering mathematical
Diagram models and a mathematical problem, and has model that
engineering model that applies some success in applies to an
problems/ to an engineering model engineering
minimal effort problem, but development. problem, and
shown requires assistance
in model develops new
development. models.

z# Qualities & 0 < Poor <= 8 8 < Satisfactory 14 < Good <= 18 <
Criteria <= 14 18 Excellent <=
20
ER7 Code No indentation Computationally Working code Good structure,
indentation, of code, no complex routine and good optimized code
optimization optimization with improper indentation or and good
and and no indentation and structure, but variable names
descriptive descriptive variable names not optimized and comments
variable variable names/ resulting in
name minimal effort unnecessary
shown computations
# Qualities & 0 < Poor <= 12 < 21 < Good <= 27 <
Criteria 12 Satisfactory <= 27 Excellent <=
21 30
ER9 Results and Unable to Inaccurate plots Correct plots Good
Plots produce any and results without any presentation of
plots or results necessary the correct plots
/minimal efforts identifying with proper
shown features such as labels, captions
labels, captions & visibility
& visibility

You might also like