Sunteți pe pagina 1din 6

Analogue and Digital Communication Lab

(EL-323)

LABORATORY MANUAL

Engr. Hina Ashraf


Engr. Fakhar Abbas
Engr. Ihtisham Khalid

Implementation of Baseband & Bandpass Modulation


Schemes
(LAB # 14)
Student Name: Fahad Mehmood

Roll No: 15I-0315 Section: A

Date performed: 22nd :Nov, 2017

____________________________________________________________________________________________________________________________________________________________

NATIONAL UNIVERSITY OF COMPUTER AND EMERGING SCIENCES, ISLAMABAD

Prepared by: Engr. Fakhar Abbas Version: 2.01


Last Edited by: Engr. Ihtisham Khalid
Verified by: Dr. Waqas Bin Abbas Updated: Fall 2017
Analogue and Digital National University Roll No: __________

Lab #
Communication Lab
(EL-323)
of Computer and Emerging Sciences
Islamabad Fall 2017
14
____________________________________________________________________________________

Lab Tasks:-
Lab Task # 01: Binary PAM
Implement Binary PAM on this data:

x = [1 1 1 0 1 0 1 0].
The output of the program should look like as follows: Cosnisider each bit duration is 1 sec. Take “x” as input from
user. The length of “x” can vary.
clc; clear all; close all;
%%%%%%%%%%%%%%% Binary PAM
%%%%%%Transmitter%%%%%%
N=8;
data_bits = [1 1 1 0 1 0 1 0];
% data_bits =rand(1,N)>0.5
samp_sym =2000; % Number of samples per symbol or bit
pulse_bit_1 = ones(1,samp_sym);
pulse_bit_0 = -1*ones(1,samp_sym);
X = [];
for i = 1:N
if data_bits(i)==1
X = [X pulse_bit_1];
Else`
X = [X pulse_bit_0];
end
end
t=linspace(0,N,length(X));
plot(t,X,'linewidth',3)
axis ([0 length(data_bits) -1.2 1.2])
title('Binary PAM','fontsize',12);
xlabel('Time');
ylabel('Amplitude');
grid on;

_____________________________________________________________________________________________
Page 2 of 6
Analogue and Digital National University Roll No: __________

Lab #
Communication Lab
(EL-323)
of Computer and Emerging Sciences
Islamabad Fall 2017
14
____________________________________________________________________________________

Lab Task # 02: Binary ASK


Implement Binary ASK on this data:

x = [0 0 1 1 0 0 1 0].
The output of the program should look like as follows: Cosnisider each bit duration is 1 sec. Take “x” as input from
user. The length of “x” can vary.

clc; clear all; close all;


%%%%%%%%%%%%%%% Binary ASK
%%%%%%Transmitter%%%%%%
N=8;
f=3;
t=linspace(0,1,500);
c=cos(2*pi*f*t);
A1=1;A2=0;
data_bits=[0 1 0 0];
% data_bits =rand(1,N)>0.5
X = [];
for i = 1:N
if data_bits(i)==1
X = [X A1*c];
else
X = [X A2*c];
end
end
t=linspace(0,N,length(X));
plot(t,X,'linewidth',3)
axis ([0 length(data_bits) -1.2 1.2])
title('Binary ASK','fontsize',12);
xlabel('Time');
ylabel('Amplitude');
grid on;

_____________________________________________________________________________________________
Page 3 of 6
Analogue and Digital National University Roll No: __________

Lab #
Communication Lab
(EL-323)
of Computer and Emerging Sciences
Islamabad Fall 2017
14
____________________________________________________________________________________

Lab Task # 03: Binary PSK


Implement Binary PSK on this data:

x = [0 1 0 0 ].
The output of the program should look like as follows: Cosnisider each bit duration is 1 sec. Take “x” as input from
user. The length of “x” can vary.
clc; clear all; close all;
data_bits = [0 1 0 0];
samp_sym =2000;
Bit_1 = -ones(1,samp_sym);
Bit_0 = ones(1,samp_sym);
Result = [];
for i = 1:length(data_bits)
if data_bits(i)==1
Result = [Result Bit_1];
else
Result = [Result Bit_0];
end
end
t=linspace(0,length(data_bits),length(Result));
y=cos(2*pi*2*t).*Result;
plot(t,y,'linewidth',2)
ylim([-1.2 1.2])
xlabel('Time');
ylabel('Amplitude');
title('Binary PSK','fontsize',12);
grid on;

_____________________________________________________________________________________________
Page 4 of 6
Analogue and Digital National University Roll No: __________

Lab #
Communication Lab
(EL-323)
of Computer and Emerging Sciences
Islamabad Fall 2017
14
____________________________________________________________________________________

Lab Task # 04: Binary FSK


Implement Binary FSK on this data:

x = [0 1 0 1 0 0 1 1].
The output of the program should look like as follows: Cosnisider each bit duration is 1 sec. Take “x” as input from
user. The length of “x” can vary.
clc; clear all; close all;
%%%%%%%%%%%%%%% Binary FSK Modulation
%%%%%%Transmitter%%%%%%
N=4;
f1=3;
f2=1;
t=linspace(0,1,500);
c1=cos(2*pi*f1*t);
c2=cos(2*pi*f2*t);
data_bits = [0 1 0 0];
% data_bits =rand(1,N)>0.5
X = [];
for i = 1:N
if data_bits(i)==1
X = [X c1];
else
X = [X c2];
end
end
t=linspace(0,N,length(X));
plot(t,X,'linewidth',2)
axis ([0 length(data_bits) -1.2 1.2])
title('Binary FSK','fontsize',12);
xlabel('Time');
ylabel('Amplitude');
grid on;

_____________________________________________________________________________________________
Page 5 of 6
Analogue and Digital National University Roll No: __________

Lab #
Communication Lab
(EL-323)
of Computer and Emerging Sciences
Islamabad Fall 2017
14
____________________________________________________________________________________

_____________________________________________________________________________________________
Page 6 of 6

S-ar putea să vă placă și