Matlab simulation of bit error rate of DS-CDMA communication link on Gaussian and Rayleigh channels respectively

Table of contents

1. Theoretical basis

2. Core program 

3. Simulation conclusion


1. Theoretical basis

        DS-CDMA (Direct Sequence Spread Spectrum Code Division Multiple Access) is a commonly used communication technology for data transmission between multiple users. In the DS-CDMA communication link, the user's data is broadened to a larger bandwidth through the spread spectrum technology, thereby improving the anti-interference and multiple access capabilities. The DS-CDMA communication link is mainly composed of a source, an encoder, a modulator, a spreader, a transmission channel, a despreader, a demodulator and a sink. Among them, the encoder is used to encode data, the modulator modulates the encoded data into a baseband signal, the spreader expands the baseband signal into a spread spectrum signal, the transmission channel is the medium for data transmission, the despreader restores the received spread spectrum signal to the baseband signal, the demodulator demodulates the despread signal, and the sink is used to receive the demodulated data.

       In a Gaussian channel, the noise of the channel conforms to a Gaussian distribution, while in a Rayleigh channel, the noise of the channel is caused by multipath effects and presents a Rayleigh distribution. The bit error rate is one of the important indicators to measure the performance of the communication system, which indicates the probability of misjudging bits at the receiving end. This article will introduce the DS-CDMA bit error rate calculation methods on Gaussian channel and Rayleigh channel respectively.
Bit error rate calculation on Gaussian channel
        In Gaussian channel, the bit error rate of the received signal can be calculated by the bit error rate formula. Assuming that the sent binary coherent BPSK modulated signal passes through a Gaussian channel, the signal-to-noise ratio of the received signal is $SNR$, and the bit error rate can be given by the following formula:

      Among them, $\text{erfc}(\cdot)$ is the complementary error function. For a multi-user DS-CDMA system, the signals interfere with each other, and the bit error rate will be affected by the interference factor.

        In a Rayleigh channel, the signal propagates through multiple paths, resulting in random variables in both amplitude and phase of the received signal. The signal-to-noise ratio of a received signal in a Rayleigh channel is composed of signal power and fading caused by multipath effects, and is usually represented by $SNR$. For the transmitted binary coherent BPSK modulated signal, the bit error rate on the Rayleigh channel can be given by the following formula:

 

For the DS-CDMA system, due to mutual interference between multiple users, the bit error rate is also affected by the interference factor.

        The performance analysis of DS-CDMA system involves many factors, including the choice of spreading code, transmission power, multiple access interference and so on. The choice of spreading code will affect the anti-interference ability and spectral efficiency of the system, and usually needs to be traded off. The increase of transmission power can improve the signal-to-noise ratio of the signal, but it will increase the power consumption and interference of the system.

       Multiple access interference is a key issue in DS-CDMA systems, and simultaneous transmission by multiple users will cause interference to received signals. Different multiple access technologies can be used in the system, such as Orthogonal Code Division Multiple Access (OCDMA for short) to reduce multiple access interference.

       Different mathematical formulas are used to calculate the bit error rate of DS-CDMA communication link on Gaussian channel and Rayleigh channel respectively. In a Gaussian channel, the bit error rate can be calculated using a complementary error function. In the Rayleigh channel, considering the multipath effect, a specific formula is used to calculate the bit error rate. The calculation of bit error rate is of great significance for system performance analysis and design. In order to improve the performance of the DS-CDMA system, appropriate multiple access techniques and modulation schemes can be adopted, optimized and improved.

2. Core program 

clc;
clear;
close all;
warning off;
addpath(genpath(pwd));
rng('default')

format long;
%set up the threshold Vt 
Vt = 0;

Plot_Pe = [];

N = 64;
x_num = 10000;
plot_EbNo = -20:2:10;
for EbNo = -20:2:10,
   
%convert back from dB
Eb_No = EbNo; %dB
Eb_No = 10.^(Eb_No/10);
%assume No = 2;
No = 2;
Eb = No * Eb_No;
%calculate power p
Tc = 1;
Ts = N * Tc;
p = Eb / Ts;

%generate BPSK symbols randomly with value +1 or -1
x = bingen(x_num);

%DS-SS modulate symbols with user code
c = bingen(N);
y = ds_mod(c(:),x);

%scale by appropriate power factor
y = sqrt(p)*y;

%add AWGN to signal
y = awgn(y,1);

%DS-SS demodulate symbols with user code
x_de = ds_demod(c(:),y);

%decision
x_de(find(x_de < 0)) = -1;
x_de(find(x_de >=0)) =  1;

Pe = length(find(x - x_de))/x_num;

Plot_Pe = [Plot_Pe Pe];
end %end for EbNo

%---------------------------------------------
%return;
%---------------------------------------------

%display the calculated Pd and Pfa
Plot_Pe

%plot Pe versus Eb/No
semilogy(plot_EbNo,Plot_Pe,'m*:')
xlabel('Eb/No (dB)')
ylabel('BER')
s=sprintf('BER versus Eb/No in the AWGN channel');
title(s);
up2170

3. Simulation conclusion

 

 

Guess you like

Origin blog.csdn.net/ccsss22/article/details/131838808