You are on page 1of 9

V th BER ca 2 phng php iu ch: BPSK &

QPSK
1) PSK (phase shift keying)
+ Khi nim: Pha ca sng mang thay i biu din cc bit 1 v 0 (bin v
tn s khng i).
V d:
0 => vc1(t) = Vcm sin(2fct+0) ; Tn ti trong 1 chu k bit
1 => vc2(t) = Vcm sin(2fct+180) ; Tn ti trong 1 chu k bit
+ Bng thng ca PSK: Ging bng thng ASK
( Bng thng ASK: C v s tn s (Khng tun hon). Sng mang fc gia, cc gi
tr fc Nbaud/2 v fc + Nbaud/2 hai bin.)

BW2-PSK = Rbaud
Nbaud = Rbaud: Tc baud
+ u im PSK (2-PSK, BPSK): khng b nh hng nhiu bin , Bng thng hp
(nh hn bng thng ca FSK)
BWASK = Rbaud ; nhiu bin
BWFSK = f + Rbaud ; khng b nh hng nhiu bin
BWPSK = Rbaud ; khng b nh hng nhiu bin
+ Gin trng thi pha:
0 => vc1(t)= 5 sin(2.20t+0 ) V ; 1 => vc2(t)= 5 sin(2.20t+180 )
PSK khng b nh hng ca cc dng nhiu tc ng nh ASK, ng thi cng khng
b nh hng ca yu t bng thng rng nh FSK. iu ny c ngha l mt thay i
nh ca tn hiu cng c th c my thu pht hin, nh th thay v ch dng hai thay
i ca tn hiu t mt bit, ta c th dng vi bn s thay i thng qua dch pha ca hai
bit.
2) BPSK (Binary phase shift keying)
2-PSK (BPSK): 2 pha, 1 pha c biu din 1 bit.
+ Gin trng thi pha:
0 => vc1(t)= 5 sin(2.20t+0 ) V ; 1 => vc2(t)= 5 sin(2.20t+180 )

3) QPSK (Quard phase shift keying)


+ 4-PSK (QPSK): 4 pha, 1 pha c biu din 2 bit.
+ Bng thng ca QPSK: Ging bng thng ASK

BW = Rbaud
Nbaud = Rbaud: Tc baud

+ u im QPSK: khng b nh hng nhiu bin , nu cng 1 bng thng cho trc
th tc ca d liu ln hn tc ca cc phng php iu ch khc.
+ Gin trng thi pha QPSK:
4) Mt s chng trnh m phng:
4.1) BER ca bpsk qua knh AWGN
clear all;
clc;
EbNodB=0:10;
EbNo=10.^(EbNodB./10);
SigLen=5*10^6;

%tao tin hieu BPSK{+1 -1}


s=1-2*(rand(1,SigLen)>=0.5);

%tinh toan nang luong bit tin hieu Eb

Eb=norm(s)^2/SigLen;

%mat do pho awgn


No= Eb./EbNo;

%vong lap tinh toan BER theo Eb/No


for k=1:length(EbNo)
%tao AWNR
N=sqrt(No(k)./2)*(randn(1,SigLen)+1i*randn(1,SigLen));
%tin hieu thu
y=s+N;
%tach tin hieu
shat=sign(real(y));
eror=s-shat;
noeror=length(find(eror~=0));
ber(k)=noeror/SigLen;

%ber ly thuyet
BERLT=1/2*erfc(sqrt(EbNo));
end

%ve do thi
semilogy(EbNodB,ber,'*',EbNodB,BERLT);
xlabel('Eb/No')
ylabel('BER')
legend('by simulation','by lt')
title('BER cua bpsk qua kenh AWGN')
grid
a) Kt qu m phng:

b) Chng trnh tm hiu thm:


%This program simulates BER of BPSK in AWGN channel%
clear all; close all; clc;
num_bit=100000; %Signal length
max_run=20; %Maximum number of iterations for a single
SNR
Eb=1; %Bit energy
SNRdB=0:1:9; %Signal to Noise Ratio (in dB)
SNR=10.^(SNRdB/10);

hand=waitbar(0,'Please Wait....');
for count=1:length(SNR) %Beginning of loop for different SNR
avgError=0;
No=Eb/SNR(count); %Calculate noise power from SNR

for run_time=1:max_run %Beginning of loop for different runs


waitbar((((count-1)*max_run)+run_time-1)/(length(SNRdB)*max_run));
Error=0;

data=randint(1,num_bit); %Generate binary data source


s=2*data-1; %Baseband BPSK modulation

N=sqrt(No/2)*randn(1,num_bit); %Generate AWGN

Y=s+N; %Received Signal

for k=1:num_bit %Decision device taking hard decision and


deciding error
if ((Y(k)>0 && data(k)==0)||(Y(k)<0 && data(k)==1))
Error=Error+1;
end
end
Error=Error/num_bit; %Calculate error/bit
avgError=avgError+Error; %Calculate error/bit for different runs
end %Termination of loop for different runs
BER_sim(count)=avgError/max_run; %Calculate BER for a particular SNR
end %Termination of loop for different SNR
BER_th=(1/2)*erfc(sqrt(SNR)); %Calculate analytical BER
close(hand);

semilogy(SNRdB,BER_th,'k'); %Plot BER


hold on
semilogy(SNRdB,BER_sim,'k*');
legend('Theoretical','Simulation',3);
axis([min(SNRdB) max(SNRdB) 10^(-5) 1]);
hold off
Kt qu m phng:
4.2) BER ca bpsk qua knh AWGN
a) Code m phng:
clear all; %Clear all variables
close all; %Close all figures

l=1e6;
EbNodB=0:2:10;
EbNo=10.^(EbNodB/10);

for n=1:length(EbNodB)
si=2*(round(rand(1,l))-0.5); %In-phase symbol generation
sq=2*(round(rand(1,l))-0.5); %Quadrature symbol generation
s=si+1i*sq; %Adding the two parallel symbol streams
w=(1/sqrt(2*EbNo(n)))*(randn(1,l)+1i*randn(1,l)); %Random noise generation
r=s+w; %Received signal
si_=sign(real(r)); %In-phase demodulation
sq_=sign(imag(r)); %Quadrature demodulation
ber1=(l-sum(si==si_))/l; %In-phase BER calculation
ber2=(l-sum(sq==sq_))/l; %Quadrature BER calculation
ber(n)=mean([ber1 ber2]); %Overall BER
end

semilogy(EbNodB, ber,'o-') %Plot the BER


xlabel('EbNo(dB)') %Label for x-axis
ylabel('BER') %Label for y-axis
grid on %Turning the grid on
b) Kt qu:

You might also like