DC Lab Pes186
DC Lab Pes186
DC Lab Pes186
UE18EC355
MOHAMMED ZAKI SALMAN
PES2201800186
ECE 6 A
Lab 6: BIT ERROR RATE FOR BPSK
PES2201800186
ECE 6 A
random QPSK symbols (+1,-1). Set Eb/No range (in dB) as -4:2:12. Plot the bit
error rate (on log scale) vs Eb/No(in dB). Use semilogy function. Plot the
THEORY:
scheme, where the 0's and 1's in a binary message are represented by two
different phase states in the carrier signal: for binary 1 and. for binary 0. In digital
modulation scheme.
MATLAB CODE:
clc;
clear all;
close all;
N=10^7;
EbNo=-4:2:10;
Pe(i)=0.5*erfc(sqrt(1/No)); end
ylabel("quadrature phase");
%xlim([-4 4]);
%ylim([-4 4]);
PES2201800186
ECE 6 A
SIMULATED WAVEFORM
RESULT:
PES2201800186
ECE 6 A
random QPSK symbols (+1,-1). Set Eb/No range (in dB) as -4:2:12. Plot the bit
error rate (on log scale) vs Eb/No(in dB). Use semilogy function. Plot the
THEORY:
It is a form of Phase Shift Keying in which two bits are modulated at once,selecting
One of four possible carrier phase shifts (0, 90, 180, or 270 degrees). QPSK allows
the signal to carry twice as much information as ordinary PSK using the same
bandwidth.
MATLAB CODE
clc;
clear all;
close all;
n=10^7;
s=(2*(rand(1,n)>0.5)-1)+1j*(2*(rand(1,n)>0.5)-1);
ebno=[-4:2:12];
nvar=no/2;
w=(randn(1,n)+1j*randn(1,n))*sqrt(nvar);
x=w+s;
s_h=(2*(real(x)>0)-1)+1j*(2*(imag(x)>0)-1);
nerr=size(find([s-s_h]),2);
ser(i)=nerr/n; pe(i)=erfc(sqrt(1/no));
end
semilogy(ebno,ser,'-m');
hold on;
semilogy(ebno,pe,'-dk');
title("ser of qpsk");
ebno=12;
scatterplot(x);
PES2201800186
ECE 6 A
RESULT :
QPSK and have observed the deviation. We have also plotted the
PES2201800186
ECE 6 A
THEORY:
has been widely used in digital communication systems. BFSK uses a pair of discrete
frequencies to transmit binary (0s and 1s) information. With this scheme, the 1 is
called the mark frequency and the 0 is called the space frequency.
MATLAB CODE
clear all;
close all;
n=10^7;
ebn=[0:2:14];
s=double(rand(1,n)>0.5);
st=s;
si=find(s==0);
st(si)=1*j;
for i=1:length(ebn)
no=10^(-ebn(i)/10);
nvar=no/2;
w=(randn(1,n)+(j*randn(1,n)))*sqrt(nvar);
x=st+w;
xr=real(x);
xi=imag(x);
sh=double(xr>xi);
nerr=size(find(s-sh),2);
ber(i)=nerr/n;
pe(i)=0.5*erfc(sqrt(1/(2*no)));
end
semilogy(ebn,ber,'-sb');
hold on
semilogy(ebn,pe,'-*r');
title('BER OF BFSK');
xlabel('EbNo in dB');
ylabel('BER');
legend('Practical BER','Theoretical BER');
Lab 8
PES2201800186
ECE 6 A
We have plotted the simulated and theoretical BER of BFSK and have observed the
deviation.
LAB 9:BER FOR DPSK
PES2201800186
ECE 6A
random symbols 0'sand 1's (rand function in matlab can be used). Perform
operation. Initial bit can be assumed to be 1 (or 0) to obtain the sequence d(n).
Convert the sequence d(n) into (+1, -1) here, Eb = 1. Set the Eb/N0 range (in dB)
as - 4:2:10. Plot the bit error rate (on log scale) vs. Eb/N0 (in dB).
Use the semilogy function.Plot the theoretical BER (the probability of error
THEORY:
Differential Phase Shift Keying DPSK, here the phase of the modulated signal is
here. The signal phase follows the high or low state of the previous element. This
MATLAB CODE
clear all;
close all;
n=10^7;
s=rand(1,n)>0.5;
d=zeros(1,n+1);
d(1)=1;
for i=1:n
d(i+1)=not(xor(d(i),s(i)));
end
d=d(1,2:end);
d=2*d-1;
ebn=[-4:2:10];
for j=1:length(ebn)
no=10^((-ebn(j))/10);
nvar=no/2;
w=randn(1,n)*sqrt(nvar);
x=d+w;
xd=[1 x(1:end-1)];
sh=(x.*xd)>0;
ner=sum(abs(s-sh));
ber(j)=ner/n;
pe(j)=0.5*exp(-1/no);
end
semilogy(ebn,ber,'-dk');
hold on;
semilogy(ebn,pe,'-*m');
xlabel('Eb by No in dB');
ylabel('BER');
title('Bit error rate of DPSK');
legend('Simulated BER','Theoretical BER');
SIMULATED WAVEFORM
RESULT :
We have plotted the simulated and theoretical BER of DPSK
and have observed that there is deviation.