Electronic – Simulation of BPSK in fading channels

bpskdigital modulationsignal-to-noisesimulation

I'm trying to simulate BPSK in a channel with Rayleigh fading and AWGN, then obtain the Bit Error Probability (BEP). My program is written in C.

I compared my BEP vs \$\frac{E_b}{N_0}\$ (SNR per bit) plot with one generated using the formula BEP = \$\frac{1}{2}(1-\sqrt{\frac{\bar{\gamma_b}}{1+\bar{\gamma_b}}})\$. It appears that my simulated BEP is always about twice that of the theoretical BEP.

enter image description here

In my simulation, the received BPSK signal model is given by
\$r(k) = \sqrt{E_s}\alpha e^{j\phi(k)}+n(k)\$
where k is the time step, alpha is the Rayleigh distributed random variable, and n(k) is the noise due to AWGN.

\$E[\alpha^2] = 2\sigma^2\$, and \$\alpha\$ is generated as \$\alpha = \sqrt{w_1^2 + w_2^2}\$ where \$w_1, w_2 \sim N(0,\sigma^2)\$. Here, \$\sigma^2 = 0.25\$.

This is how my program is implemented.

1) Set the message phase in 2D (msg_phase[0] = 0.0, msg_phase[1] = \$\pi\$)

2) For different SNR values, do the following:

2a) Calculate \$E_s = E_b = 10^\frac{SNR}{10} * N_0\$

2b) Randomly select signal to transmit, with each signal equally likely to be sent.

2c) Generate \$\alpha\$ by first generating a pair of independent, zero-mean gaussian random variables with variance equal to 0.25, then setting \$\alpha\$ based on the equation above.

2d) Generate another pair of independent standard gaussian random variables as AWGN.

2e) Set the received signal to (\$\alpha\$ * transmitted_signal + AWGN noise)

2f) Calculate the received signal magnitude and phase as follows:

\$\text{Magnitude} = \sqrt{\text{Rx}_0^2 + \text{Rx}_1^2}\$

\$\text{phase} = \text{tan}^{-1}\frac{\text{Rx}_1}{\text{Rx}_0}\$

They are used in my receiver decision.

2g) Receiver decision. For incorrect decision, count the number of error bits.

Repeat Step 2b to 2g until 500 error bits are obtained, then calculate BEP.

The same code was used to simulate differential BPSK and the results matched the formula for BDPSK. The received signal model for the differential simulations is \$r(k) = \sqrt{E_s}\alpha e^{j(\phi(k)+\theta)}+n(k)\$, so I've basically used the same code but with \$\theta = 0\$ and the generation of \$\alpha\$.

I don't know why my BEP is twice the BEP obtained from the formula.

I've seen a few Matlab simulations that do something called "equalization" to remove the fading effect at the receiver, before computing the decision metric.

For example,

for ii = 1:length(Eb_N0_dB)

n = 1/sqrt(2)*[randn(1,N) + j*randn(1,N)]; % white gaussian noise, 0dB variance 
h = 1/sqrt(2)*[randn(1,N) + j*randn(1,N)]; % Rayleigh channel

% Channel and noise Noise addition
y = h.*s + 10^(-Eb_N0_dB(ii)/20)*n; 

% equalization
yHat = y./h;

% receiver - hard decision decoding
ipHat = real(yHat)>0;

% counting the errors
nErr(ii) = size(find([ip- ipHat]),2);

I don't do that, but is that necessary? As the Matlab simulations are implemented rather differently from my program, I'm not sure how the "equalization" would work for my case.

Best Answer

It appears the SNR from your simulation is 3 dB too low. Since you are working in MATLAB, it is easy to check. Look the values of h, s, n, and Eb_N0_db and make sure you have scaled them all correctly.

Related Topic