Вы находитесь на странице: 1из 3

BER Vs Eb/N0 for BPSK modulation over AWGN

In the previous post we saw about how BPSK modulation and demodulation can be done. This
concept is extended further to simulate the performance of BPSK modulation technique over an
AWGN.

Transmitter:
For the BPSK modulation , a series of binary input message bits are generated of which '1's are
represented by 1v and '0's are translated as '-1' v (equivalent to NRZ coding as discussed in the
previous post).
AWGN channel:
For BPSK modulation the channel can be modeled as

where y is the received signal at the input of the BPSK receiver, x is the modulated signal
transmitted through the channel , a is a channel amplitude scaling factor for the transmitted
signal usually 1. 'n' is the Additive Gaussian White Noise random random variable with zero
mean and variance 2.
For AWGN the noise variance in terms of noise power spectral density (N0) is given by,

For M-PSK modulation schemes including BPSK, the symbol energy is given by

where Es =Symbol energy per modulated bit (x), Rm = log2(M) , (for BPSK M=2, QPSK M=4,
16 QAM M=16 etc..,). Rc is the code rate of the system if a coding scheme is used. In our case
since no coding scheme is used Rc = 1. Eb is the Energy per information bit.
Assuming Es=1 for BPSK (Symbol energy normalized to 1) Eb/N0 can be represented as (using
above equations),

From the above equation the noise variance for the given Eb/N0 can be calculated as

For the channel model randn function in Matlab is used to generate the noise term. This function
generates noise with unit variance and zero mean. In order to generate a noise with sigma for
the given Eb/N0 ratio , use the above equation , find , multiply the 'randn' generated noise with
this sigma , add this final noise term with the transmitted signal to get the received signal.
Receiver:
BPSK receiver can be a simple threshold detector which categorizes the received signal as '0' or
'1' depending on the threshold that is being set.

MATLAb code:

% Demonstration of Eb/N0 Vs BER for BPSK modulation scheme


% Author: Mathuranathan (http://gaussianwaves.blogspot.com)
% License : creative commons : Attribution-NonCommercial-ShareAlike 3.0 Unported
clear;
clc;
%---------Input Fields-----------------------N=10000000; %Number of input bits
EbN0dB = -6:2:10; % Eb/N0 range in dB for simulation
%--------------------------------------------data=randn(1,N)>=0; %Generating a uniformly distributed random 1s and 0s
bpskModulated = 2*data-1; %Mapping 0->-1 and 1->1
M=2; %Number of Constellation points M=2^k for BPSK k=1
Rm=log2(M); %Rm=log2(M) for BPSK M=2
Rc=1; %Rc = code rate for a coded system. Since no coding is used Rc=1
BER = zeros(1,length(EbN0dB)); %Place holder for BER values for each Eb/N0
index=1;
for k=EbN0dB,
%------------------------------------------%Channel Noise for various Eb/N0
%------------------------------------------%Adding noise with variance according to the required Eb/N0
EbN0 = 10.^(k/10); %Converting Eb/N0 dB value to linear scale
noiseSigma = sqrt(1./(2*Rm*Rc*EbN0)); %Standard deviation for AWGN Noise
noise = noiseSigma*randn(1,length(bpskModulated));
received = bpskModulated + noise;

%------------------------------------------%Threshold Detector
estimatedBits=(received>=0);
%-----------------------------------------%Bit Error rate Calculation
BER(index) = sum(xor(data,estimatedBits))/length(data);
index=index+1;
end
%Plot commands follows
plotHandle=plot(EbN0dB,log10(BER),'r--');
set(plotHandle,'LineWidth',1.5);
title('SNR per bit (Eb/N0) Vs BER Curve for BPSK Modulation Scheme');
xlabel('SNR per bit (Eb/N0) in dB');
ylabel('Bit Error Rate (BER) in dB');
grid on;
hold on;
theoreticalBER = 0.5*erfc(sqrt(10.^(EbN0dB/10)));
plotHandle=plot(EbN0dB,log10(theoreticalBER),'k*');
set(plotHandle,'LineWidth',1.5);
legend('Simulated','Theoretical');
grid on;

Вам также может понравиться