D. Y. Patil College of Engineering, Akurdi. Department of Electronics & Telecommunication
D. Y. Patil College of Engineering, Akurdi. Department of Electronics & Telecommunication
Experiment No: 02
Simulation Study of performance of BPSK receiver in presence of noise.
Aim: To write a MATLAB program for Simulation study of performance of BPSK Receiver
in presence of noise.
Theory:
In binary phase shift keying (BPSK) phase of the sinusoidal carrier is changed according to
the data bit to be transmitted, the carrier phase is changed between 0° and 180°.It uses two
phases which are separated by 180° and so can also be termed 2-PSK.
For generation of BPSK first the binary data signal (0s and 1s) is converted into a NRZ
signal. The graphical representation of BPSK is as shown in figure 1.
Figure 1
Block Diagram:
Transmitter:
Receiver:
BPSK Waveform:
Signal space representation of signals is a very effective and useful tool in the analysis of
digitally modulated signals. Any set of signals is equivalent to a set of vectors. A set of m
vectors is said to be orthonormal if the vectors are orthogonal and each vector has a unit
norm. With the help of signal space representation it is possible to signals used in
communications can be expressed and visualized graphically.
Algorithm:
1. Generate random input bit pattern.
2. Generate BPSK signal by assigning 0°phase shift to the 0 bit and 180°phase shift to 1
bit.
3. Plot constellation of BPSK signal without noise.
4. Define signal to noise ratio from 0 to 30 dB
5. Calculate sigma value as sqrt(10.0^(-SNR/10.0))
6. Generate noisy BPSK signal using sigma (noise variance)
7. Plot constellation of BPSK signal with noise.
8. To find the number of errors compare the original BPSK signal with the noisy BPSK
signal.
9. Find bit error rate by dividing the number of bits in error by the total number of bits
transmitted.
10. Repeat the process for various values of signal-to-noise ratio.
11. Plot the graph of BER vs SNR.
MATLAB Functions:
MATLAB Program:
clc;
clear all;
close all;
nr_data_bits=10000;
b_data=(randn(1,nr_data_bits))>.5;
b=[b_data];
d=zeros(1,length(b));
for n=1:length(b)
if(b(n)==0)
d(n)=exp(j*2*pi);
end
if(b(n)==1)
d(n)=exp(j*pi);
end
end
bpsk=d;
figure(1);
plot(d,'o');
axis([-2 2 -2 2]);
grid on;
xlabel('real');
ylabel('image');
title('BPSK constellation without noise');
SNR=0:30;
BER1=[];
SNR1=[];
for SNR=0:length(SNR);
sigma=sqrt(10.0^(-SNR/10.0));
snbpsk=(real(bpsk)+sigma.*randn(size(bpsk)))+i.*(imag(bpsk)+sigma*randn(size(bpsk)));
figure(2);
plot(snbpsk,'o');
axis([-2 2 -2 2]);
grid on;
xlabel('real');
ylabel('imag');
title('Bpsk constellation with noise');
%receiver
r=snbpsk;
bhat=[real(r)<0];
bhat=bhat(:)';
bhat1=bhat;
ne=sum(b~=bhat1);
BER=ne/nr_data_bits;
BER1=[BER1 BER];
SNR1=[SNR1 SNR];
end
figure(3);
semilogy(SNR1,BER1,'-*');
grid on;
xlabel('SNR=Eb/No(db)');
ylabel('BER or SER');
title('Simulation of BER/SER for BPSK with Gray coding');
legend('BER-simulated','SER-simulated');
Screenshots:
1. Editor Widow
Conclusion: