m Based on spread spectrum despreading + turbo decoding communication link MATLAB bit error rate simulation, modulation comparison QPSK, 16QAM, 64QAM, spread spectrum parameters can be set

Table of contents

1. Algorithm simulation effect

2. Algorithms involve an overview of theoretical knowledge

3. MATLAB core program

4. Complete algorithm code file


1. Algorithm simulation effect

The matlab2022a simulation results are as follows:

2. Algorithms involve an overview of theoretical knowledge

       The bit error rate simulation of communication link based on spread spectrum despreading and Turbo coding and decoding, and compare the performance under different modulation methods. First, we discuss the implementation steps in detail, including spread spectrum despreading, modulation, encoding and decoding, etc. Then, the relevant mathematical formulas are given, including the spread spectrum despread formula, the modulation mapping formula in the modulation process and the Turbo coding formula in the encoding and decoding. Finally, we discuss the implementation difficulties of each step and point out possible directions for improvement.

  1. Introduction In the wireless communication system, spread spectrum despreading and Turbo codec are commonly used technologies, which are used to improve the system's fault tolerance and anti-interference. The purpose of this paper is to evaluate the performance differences of communication links based on spread spectrum despreading and Turbo coding and decoding under different modulation methods through MATLAB simulation.

  2. Implementation steps 2.1 Spreading and despreading In the process of spreading and despreading, the transmitting end performs spreading operation on the original data sequence through the spreading code, and the receiving end uses the same spreading code to perform the despreading operation. The specific implementation steps are as follows:

  • Sending end: Suppose the original data sequence is d[n], and the spreading code is c[n]. Then the spread spectrum signal output by the transmitter is s[n] = d[n] * c[n], where * represents the dot multiplication operation.

  • Receiver: After the received signal is despread, the despread signal r[n] = s[n] * c[n] is obtained.

        During modulation, the despread signal is converted to an analog signal for transmission. The commonly used modulation methods are QPSK, 16QAM and 64QAM.

  • QPSK modulation: QPSK modulation maps every two bits to a phase point on the complex plane. Assuming that the received despread signals are r_I[n] and r_Q[n], the QPSK modulated signal is x[n] = r_I[n] + j*r_Q[n], where j is the imaginary unit.

  • 16QAM modulation: 16QAM modulation maps every four bits to a phase point on the complex plane. Assuming that the received despread signals are r_I[n] and r_Q[n], the 16QAM modulated signal is x[n] = r_I[n1] + j*r_Q[n1], where n1 indicates that the first bit corresponds to index of.

  • 64QAM modulation: 64QAM modulation maps every six bits to a phase point on the complex plane. Assuming that the received despread signals are r_I[n] and r_Q[n], the 64QAM modulated signal is x[n] = r_I[n2] + j*r_Q[n2], where n2 indicates that the second bit corresponds to index of.

       Turbo coding is an iterative encoding and decoding method that can provide performance close to channel capacity.

  • Encoding: Turbo encoding encodes the input data sequence through two encoders. The specific implementation steps are as follows:

    • Suppose the input data sequence is b[n], the first encoder outputs c1[n], and the second encoder outputs c2[n].
    • The output c1[n] of the first encoder is XORed with the input b[n] of the second encoder to obtain the interleaved sequence c2[n].
    • The final encoded output is c[n] = [c1[n], c2[n]].
  • Decoding: Turbo decoding uses an iterative method for decoding, alternately performing information transmission and decoding. The specific implementation steps are as follows:

    • Suppose the received modulated signal is y[n].
    • Using the soft information passing algorithm, iterative decoding is performed by updating and passing soft information until the maximum number of iterations is reached or the stopping criterion is met.
    • The final decoding output is the decoding sequence b_hat[n].
  1. Mathematical formula 3.1 Spread spectrum despread
  • Sender: s[n] = d[n] * c[n]
  • Receiver: r[n] = s[n] * c[n]

modulation

  • QPSK modulation: x[n] = r_I[n] + j*r_Q[n]
  • 16QAM modulation: x[n] = r_I[n1] + j*r_Q[n1]
  • 64QAM modulation: x[n] = r_I[n2] + j*r_Q[n2]

Turbo coding

  • Encoding: c[n] = [c1[n], c2[n]]
  • Decoding: b_hat[n] = TurboDecoding(y[n])
  1. Implementation Difficulties and Improvement Directions 4.1 Implementation Difficulties
  • Proper implementation of spread spectrum despreading and modulation process ensures that the signal is correctly mapped to the corresponding phase point.
  • Implement Turbo encoders and decoders, and design appropriate iteration strategies.
  • Handles channel noise and interference, and possible error propagation issues.

        The bit error rate simulation of communication link based on spread spectrum despreading and Turbo coding and decoding, and compare the performance under different modulation methods. We give the implementation steps and related mathematical formulas, and discuss the implementation difficulties of each step. Through MATLAB simulation, the performance of the system under different modulation modes can be evaluated, and possible improvement directions can be proposed. These results have important reference value for the design and optimization of wireless communication systems.

3. MATLAB core program

.....................................................................
N        = 512;%设置奇偶校验矩阵大小     
M        = 255; 
%得到扩频倍数,设置1,4,8
fp       = 8;

if fp==1
   SNR      = [-8:2:22];
   TJL      = 2*[6000,6000,5000,4000,4000,4000,4000,4000,4000,4000,4000,4000,4000,4000,3000,2500,2000,1800,1500,1000,1000,1000,500,500,400,400,300,300,200,200,100,100,100];
end
if fp==4
   SNR      = [-8:2:12];
   TJL      = 2*[4000,3000,2500,2000,1800,1500,1000,1000,1000,500,500,400,400,300,300,200,200,100,100,100,100,100,100,100,100,100,100,100,100];
end
if fp==8
   SNR      = [-8:2:8];
   TJL      = 2*[3000,2500,2000,1800,1500,1000,1000,1000,500,500,400,400,300,300,200,200,100,100,100,100,100,100];
end



for i=1:length(SNR)
    Bit_err(i) = 0;
    Num_err    = 0;
    Numbers    = 0; %误码率累加器
    while Num_err <= TJL(2*i)
          Num_err
          fprintf('Eb/N0 = %f\n', SNR(i));
          %产生需要发送的随机数
          Trans_data = round(rand(1,N-M));  
          turbo_code = turbo_encode(Trans_data); 
          %DSSS   
          pseudoNumber          = round(rand(1,fp)');

          [dsss,converted,PN2]  = func_dsss(turbo_code,pseudoNumber,fp);

          Trans_BPSK            = QAM64_modulation(dsss);
          %通过高斯信道
          Rec_BPSK   = awgn(Trans_BPSK,SNR(i),'measured');   
 

          ReData     = QAM64_demodulation(Rec_BPSK);
          %DSSS
          dsss2      = func_dsss2(ReData,pseudoNumber,fp);
          %turbo译码 
          x_hat      = round(turbo_decode(dsss2));


          [nberr,rat]= biterr(x_hat,Trans_data);
          Num_err    = Num_err+nberr;
          Numbers    = Numbers+1;    
    end 
    Bit_err(i)=Num_err/(N*Numbers);
end

figure;
semilogy(SNR,Bit_err,'o-r');
xlabel('Eb/N0(dB)');
ylabel('BER');
grid on;

if fp==1
   save data_QAM641.mat SNR Bit_err
end
if fp==4
   save data_QAM644.mat SNR Bit_err
end
if fp==8
   save data_QAM648.mat SNR Bit_err
end
0X_008m

4. Complete algorithm code file

V

Guess you like

Origin blog.csdn.net/hlayumi1234567/article/details/131730759