You are on page 1of 11

ECE 4001 – Digital Communication Systems

Lab Task – 4

Name: Harshith C S

Reg No: 18BEC0585

Slot: L35+36
Title: Bandpass modulation – BASK, BPSK, BFSK
Date: 21/09/2020

Aim: To analyze the digital bandpass modulation techniques and transmit the modulated signal
through AWGN channel.

Theory:

1. BASK - Binary amplitude shift keying (ASK) s a type of Amplitude Modulation


which represents the binary data in the form of variations in the amplitude of a
signal. In this, we key the carrier frequency as one of two discrete levels during the
bit time T b for the representation of binary logic signals for the transmission of
information. A convenient set of amplitudes for binary ASK is 1 V for binary 1 and
0 V for binary 0, which is also known as on-off keying (OOK). The modulated
sinusoidal carrier signal has an amplitude of A V, a carrier frequency of f c Hz, and
a 0-reference phase angle, as given below:
2. BPSK - Phase Shift Keying PSK is the digital modulation technique in which the
phase of the carrier signal is changed by varying the sine and cosine inputs at a
particular time. Binary Phase Shift Keying (BPSK), also called as 2-phase PSK or
Phase Reversal Keying. In this technique, the sine wave carrier takes two phase
reversals such as 0° and 180°. In it, we shift the phase angle of the carrier frequency to
one of two discrete phases during the bit time T b for the representation of binary logic
signals for the transmission of information. The modulated sinusoidal carrier signal
has an amplitude of A V, a frequency of f c Hz, as given below:

PSK technique is widely used for wireless LANs, bio-metric, contactless operations,
along with RFID and Bluetooth communications. BPSK is basically a Double Side
Band Suppressed Carrier DSBSC modulation scheme, for message being the digital
information.

3. BFSK - Binary frequency shift keying (BFSK) is the digital modulation technique in
which the frequency of the carrier signal varies according to the digital signal changes.
FSK is a scheme of frequency modulation. In this, we shift the carrier frequency to one
of two discrete frequencies during the bit time T b for the representation of binary
logic signals for the transmission of information. The modulated sinusoidal carrier
signal has an amplitude of A V, a frequency of f c Hz, and a 0-reference phase angle,
as given between.
BASK:
Program:
clear all;
close all;
clc;
% % BASK modulation and demodulation
% % Following are the steps:
% 1. Provide the no bits (n=number of bits)
% 2. Unipolar NRZ line coding (m)
% 3. Carrier signal(c)
% 4.BASK Signal
% x=nc
% 5. Noise is present
% coherent detection(Product modulator output)
% y1=x*c
% 6. integration
% 7. threshold=0.50
% if int_op>threhold then det bit=1 otherwise 0
% 8. BER calculation
%% input bit generation
N=10; % input bit size
n=randi([0 1],1,N)
% unipolar mapping
for ii=1:N;
if n(ii)==0;
nn(ii)=0;
else
nn(ii)=1;
end
end
% unipolar NRZ signal
S=100; % no of samples per bit
i=1; % index of input bits
t=0:1/S:N; % time instants
for j=1:length(t);
if t(j)<=i;
m(j)=nn(i);
else
m(j)=nn(i);
i=i+1;
end
end
subplot(411);
plot(t,m);
xlabel('time');
ylabel('Amplitude');
title('NRZ unipolar line coded signal');
%% carrier signal generation
c=cos(2*pi*2*t);
subplot(412);
plot(t,m,'m');
xlabel('time');
ylabel('Amplitude');
title('carrier signal');
%% BASK signal generation
x=m.*c;
subplot(413);
plot(t,x,'r');
xlabel('time');
ylabel('amplitude');
title('BASK modulation signal');
%% demodulation
% coherent detection
y=awgn(x,-2); % signal received at the receiver with noise
%% product modulator output
y1=y.*c;
subplot(414);
plot(t,y1,'k');
xlabel('time');
ylabel('amplitude');
title('product modulator o/p');
%% integrator
int_op=[];
for ii=0:S:length(y1)-S
int_o=1/S*trapz(y1(ii+1:ii+S));
int_op=[int_op int_o];
end
%% decision device
threshold=0.50 % threshold for BASK
disp('detected bits:');
det=(round(int_op,1)>=threshold)
%% BER computation
ber=sum(n~=det)/N
Output:

n =

1 1 0 1 1 0 0 1 1 1

threshold =
0.5000

detected bits:

det =
1×10 logical array
1 1 0 1 0 0 0 1 0 0

ber =
0.3000
BPSK:
Program:
clear all;
close all;
clc;
%% input bit generation
N=10; % input bit size
n=randi([0 1],1,N)
% polar mapping
for ii=1:N;
if n(ii)==0;
nn(ii)=-1;
else
nn(ii)=1;
end
end
% polar NRZ signal
S=100; % no of samples per bit
i=1; % index of input bits
t=0:1/S:N; % time instants
for j=1:length(t);
if t(j)<=i;
m(j)=nn(i);
else
m(j)=nn(i);
i=i+1;
end
end
subplot(411);
plot(t,m);
xlabel('time');
ylabel('Amplitude');
title('NRZ polar line coded signal');
%% carrier signal generation
c=cos(2*pi*2*t);
subplot(412);
plot(t,m,'m');
xlabel('time');
ylabel('Amplitude');
title('carrier signal');
%% BPSK signal generation
x=m.*c;
subplot(413);
plot(t,x,'r');
xlabel('time');
ylabel('amplitude');
title('BPSK modulation signal');
%% demodulation
% coherent detection
y=awgn(x,-2); % signal received at the receiver with noise
%% product modulator output
y1=y.*c;
subplot(414);
plot(t,y1,'k');
xlabel('time');
ylabel('amplitude');
title('product modulator o/p');
%% integrator
int_op=[];
for ii=0:S:length(y1)-S
int_o=1/S*trapz(y1(ii+1:ii+S));
int_op=[int_op int_o];
end
%% decision device
threshold=0 % threshold for BPSK
disp('detected bits:');
det=(round(int_op,1)>=threshold)
%% BER computation
ber=sum(n~=det)/N

Output:
n =
0 0 1 0 0 0 0 1 1 0

threshold =
0

detected bits:

det =

1×10 logical array


0 0 1 0 0 0 0 1 1 0

ber =
0
BFSK:
Program:
clc;
clear all;
close all;
% ********************* Define transmitted signal *************************
N=10; % Number of bits , size of transmitted signal x_inp=[x_1 x_2 ... x_N]
xinp= randi([0 1],1,N); % binary signal 0 or 1 % message to be transmitted
Tb=0.0001; % bit period (second)
xinp
% ********************* Represent input signal as digital signal ****
xbit=[];
nb=100; % bbit/bit
for n=1:1:N %
if xinp(n)==1; %
x_bitt=ones(1,nb);
else xinp(n)==0;
x_bitt=zeros(1,nb);
end
xbit=[xbit x_bitt];
end
t1=Tb/nb:Tb/nb:nb*N*(Tb/nb); % time of the signal
f1 = figure(1);
set(f1,'color',[1 1 1]);
subplot(3,1,1);
plot(t1,xbit,'lineWidth',2);grid on;
axis([ 0 Tb*N -0.5 1.5]);
ylabel('Tmplitude(volt)');
xlabel(' Time(sec)');
title('Input signal as digital signal');
% ********************* Define BFSK Modulation ****************************
Ac=1; % Amplitude of carrier signal
mc1=10; % fc>>fs fc=mc*fs fs=1/Tb
mc2=4;
fc1=mc1*(1/Tb); % carrier frequency for bit 1
fc2=mc2*(1/Tb); % carrier frequency for bit 0
t2=Tb/nb:Tb/nb:Tb;
t2L=length(t2);
xmod=[];
for (i=1:1:N)
if (xinp(i)==1)
xmod0=Ac*cos(2*pi*fc1*t2);%modulation signal with carrier signal 1
else
xmod0=Ac*cos(2*pi*fc2*t2);%modulation signal with carrier signal 2
end
xmod=[xmod xmod0];
end
t3=Tb/nb:Tb/nb:Tb*N;
subplot(3,1,2);
plot(t3,xmod);
xlabel('Time(sec)');
ylabel('Amplitude(volt)');
title('Signal of BASK modulation ');
% ********************* Transmitted signal x ******************************
x=xmod;
% ********************* Channel model h and w *****************************

% ********************* Received signal y *********************************


y=awgn(x,-15);
subplot(3,1,3);
plot(t3,y);
xlabel('time');
ylabel('amplitude');
title('BFSK modulation signal with noise');

% ********************* Define BFSK Demodulation **************************


ydem=[];
for n=t2L:t2L:length(y)
t=Tb/nb:Tb/nb:Tb;
cdem1=cos(2*pi*fc1*t); % carrier siignal for information 1
cdem2=cos(2*pi*fc2*t); % carrier siignal for information 0
ydem1=cdem1.*y((n-(t2L-1)):n);
ydem2=cdem2.*y((n-(t2L-1)):n);
t4=Tb/nb:Tb/nb:Tb;
z1=trapz(t4,ydem1); % intregation
z2=trapz(t4,ydem2); % intregation
Adem1=round(2*z1/Tb);
Adem2= round(2*z2/Tb);
if(Adem1>Ac/2) % % logic level = (Ac)/2
a=1;
else(Adem2>Ac/2);
a=0;
end
ydem=[ydem a];
end

xout=ydem; % output signal


% *************** Represent output signal as digital signal ***************
[noe ber]=biterr(xinp,xout);
disp('Number of Errors');
noe
disp('Bit error rate');
ber
xout

Output:
xinp =

0 0 0 1 1 0 0 0 1 1

Number of Errors
noe =

Bit error rate


ber =

0.3000

xout =

1 0 0 1 1 0 1 0 1 0

Result: The experiment was performed and the coding of the BASK, BPSK, BFSK
modulation techniques were performed and understood.

Verification Signature

You might also like