You are on page 1of 7

American International University- Bangladesh

Department of Computer Engineering

Data Communication

Lab Report-05

NAME : Jubayer Ahamed


ID : 18-36325-1
SECTION :D
SEMESTER : 2020-21 Spring
Course : Data Communication

1
My id is 18-36325-1.
So, E = 3; F = 2; G = 5.
Convert it to 8 bit ASCII:
3 = 00110011,
2 = 10110010,
5 = 00110101.
Now, 24 bits Bit stream is 00110011 10110010 00110101.

Consider->
r = 3, L = 8
Stream '000', '001', '010', '011','100','101','110','111'

8-ASK: f = 10 Hz, p = 0, '000'-> 2 volt, '001'-> 4 volt,'010'-> 6 volt, '011'-> 8


volt,'100'-> 10 volt,'101'-> 12 volt,'110'-> 14 volt,'111'-> 16 volt
8-FSK: a = 1 volt, p = 0, '000'-> 2 Hz, '001'-> 4 Hz,'010'-> 6 Hz, '011'-> 8
Hz,'100'-> 10 Hz, '101'-> 12 Hz,'110'-> 14 Hz,'111'->16 Hz
8-PSK: a = 1 volt, f = 10 volt, '000'-> -pi/4 , '001'-> -3*pi/4 ,'010'-> +3*pi/4 ,
'011'-> +pi/4 ,'100'-> +pi/2 , '101'-> +pi/3 ,'110'-> -pi/2 ,'111'-> -pi/3

pulse duration = 4.5 s

2
Ans to the ques no. 1,2 &3

close all;
clc;
f = 10;
f1 = 2;
f2 = 4;
f3 = 6;
f4 = 8;
f5 = 10;
f6 = 12;
f7 = 14;
f8 = 16;
a = 1;
a1 = 2;
a2 = 4;
a3 = 6;
a4 = 8;
a5 = 10;
a6 = 12;
a7 = 14;
a8 = 16;
p1 = -pi/4;
p2 = -3*pi/4;

3
p3 = +3*pi/4;
p4 = +pi/4;
p5 = +pi/2;
p6 = +pi/3;
p7 = -pi/2;
p8 = -pi/3;
x=[001 100 111 011 001 000 110 101]; % input signal
nx = length(x);
i=1;
pd = 4.5; %pulse_duration
while i<nx+1
t = (i-1)/2*pd:0.00001:(i+1)/2*pd;
if x(i)==0 && x(i+1)==0
ask = a1*sin(2*pi*f*t);
fsk = a*sin(2*pi*f1*t);
psk = a*sin(2*pi*f*t + p1);
elseif x(i)==0 && x(i+1)==1
ask = a2*sin(2*pi*f*t);
fsk = a*sin(2*pi*f2*t);
psk = a*sin(2*pi*f*t + p2);
elseif x(i)==1 && x(i+1)==0
ask = a3*sin(2*pi*f*t);
fsk = a*sin(2*pi*f3*t);

4
psk = a*sin(2*pi*f*t + p3);
elseif x(i)==1 && x(i+1)==0
ask = a4*sin(2*pi*f*t);
fsk = a*sin(2*pi*f4*t);
psk = a*sin(2*pi*f*t + p4);
elseif x(i)==1 && x(i+1)==0
ask = a5*sin(2*pi*f*t);
fsk = a*sin(2*pi*f5*t);
psk = a*sin(2*pi*f*t + p5);
elseif x(i)==1 && x(i+1)==0
ask = a6*sin(2*pi*f*t);
fsk = a*sin(2*pi*f6*t);
psk = a*sin(2*pi*f*t + p6);
elseif x(i)==1 && x(i+1)==0
ask = a7*sin(2*pi*f*t);
fsk = a*sin(2*pi*f7*t);
psk = a*sin(2*pi*f*t + p7);
else
ask = a8*sin(2*pi*f*t);
fsk = a*sin(2*pi*f8*t);
psk = a*sin(2*pi*f*t + p8);
end
subplot(3,1,1);

5
plot(t,ask);
hold on;
grid on;
title('Amplitude Shift Key')
subplot(3,1,2);
plot(t,fsk);
hold on;
grid on;
title('Frequency Shift Key')
subplot(3,1,3);
plot(t,psk);
hold on;
grid on;
title('Phase Shift Key')
i=i+2;
end

6
Fig: Different type of Shift keying

Discussion: Some of the bugs with the definite organizational complementation


with the MATLAB functions are concluded. I face some problems to select the
width 4.5 sec in this lab report and also face problem to fix the shift keying. So,
that is why my shift keying outputs are not accurate in this report.

You might also like