Matlab simulation of phase synchronization algorithm based on physical layer network coding

Table of contents

1. Preview of algorithm operation renderings

2.Algorithm running software version

3. Some core programs

4. Overview of algorithm theory

5. Algorithm complete program engineering


1. Preview of algorithm operation renderings

2.Algorithm running software version

matlab2022a

3. Some core programs

..........................................................................

%数据长度
Len    = 504;
%网络数据包长度
Npkt   = 1000;  
%网络译码迭代次数
Niter  = 5;    
per    = randperm(2*Len);
SNRs   = [0:2:12];
ij     = 0;
    
for i = SNRs
    i
    sigma = 1/sqrt(0.5*10^(i/10));
    Error = 0;
    ij    = ij+1;
    for k = 1:Npkt
        %QPSK
        Id     = round(rand(1,Len));%I路
        Qd     = round(rand(1,Len));%Q路
        %网络编码
        Id_enc = func_enc(Id,per);
        Qd_enc = func_enc(Qd,per);
        Id_enc2= 1-2*Id_enc;
        Qd_enc2= 1-2*Qd_enc;
        Rec_ref= Id_enc2+Qd_enc2;
        
        theta1 = pi/6;
        Id_enc2= Id_enc2.*exp(-sqrt(-1)*theta1)+sigma*randn(1,2*Len);
        Qd_enc2= Qd_enc2.*exp(-sqrt(-1)*theta1)+sigma*randn(1,2*Len);
        %通过干扰
        Rec0   = Id_enc2  + Qd_enc2; 
        %接收
        %MLE进行相位估计
        if k <= 10
           thest0  = atan(sum(imag(conj(Rec_ref).*Rec0))/sum(real(conj(Rec_ref).*Rec0))); 
           thest   = thest0;
        else
           %相位跟踪
           Rec   = Rec0.*exp(sqrt(-1)*thest);
           err   = real(mean(Rec0-Rec));
           C1    = 0.00015;
           thest = thest+C1*err;
        end
 
        Rec    = Rec0.*exp(-sqrt(-1)*thest);
        h      = func_H(Id,per);
        Y      = func_dec(Rec,h,1,1,sigma,Niter);
        Error  = Error + sum(abs(mod(Id+Qd,2) - Y));
    end
    ber(ij) = Error/Npkt/Len;
end
    
figure;
semilogy(SNRs,ber,'b-o')
xlabel('SNR(dB)');
ylabel('BER ');
grid on
save R1.mat SNRs ber
15_007m

4. Overview of algorithm theory

        The phase synchronization algorithm based on physical layer network coding is an algorithm that uses physical layer network coding technology to achieve phase synchronization. The principle of this algorithm is to superimpose two or more signals with different phases to generate a superimposed signal, and then realize phase synchronization by analyzing the phase information of the superimposed signal.

physical layer network coding

        Physical layer network coding is a technique that superimposes two or more signals with different phases. The basic principle of this technique is to properly adjust the amplitude and phase of two or more signals, and then add them to generate a superimposed signal. In this way, we can fuse the information of two or more signals to improve signal transmission efficiency and reliability.

Phase synchronization algorithm

         Phase synchronization algorithm is a technique used to achieve synchronization of two or more signals with different phases. The basic principle of this technology is to achieve phase synchronization by analyzing the phase information of the signal. Specifically, we need to demodulate the received signal and then extract the phase information of the signal. We can then calculate the phase difference between different signals by comparing their phase information. Finally, we can achieve phase synchronization by adjusting the phase of the signal to eliminate the phase difference.

        The principle of the phase synchronization algorithm based on physical layer network coding is to superimpose two or more signals with different phases to generate a superimposed signal. Then, we demodulate this superimposed signal and extract the phase information of the signal. We can then calculate the phase difference between different signals by comparing their phase information. Finally, we can achieve phase synchronization by adjusting the phase of the signal to eliminate the phase difference.

       The phase synchronization algorithm based on physical layer network coding involves many formulas. Below we only list some of the key formulas:

  1. Signal superposition formula: s(t)=∑i=1n​Ai​(t)cos(ωi​t+φi​(t))
  2. 解调公式:y(t)=s(t)cos(θ(t))=∑i=1n​Ai​(t)cos(ωi​t+φi​(t))cos(θ(t))
  3. Phase extraction formula: φ=atan2(ℑ(y),ℜ(y))
  4. Phase difference calculation formula: Δφ=atan2(ℑ(y1​−y2​),ℜ(y1​−y2​))
  5. Phase adjustment formula: φ1​=φ0​+Δφ

       Among them, s(t) represents the superimposed signal, Ai​(t) and φi​(t) represent the amplitude and phase of the i-th signal, respectively, ωi​ represents the angular frequency of the i-th signal, θ(t) represents Demodulation angle, y(t) represents the demodulated signal, ℑ(y) and ℜ(y) represent the imaginary part and real part of y(t) respectively, φ represents the phase of the signal, and Δφ represents the phase of the two signals Difference, φ0​ represents the phase of the reference signal, φ1​ represents the phase of the signal that needs to be adjusted.

       The phase synchronization algorithm based on physical layer network coding is a method that uses physical layer network coding technology to achieve phase synchronization. This algorithm superimposes two or more signals with different phases, and then calculates their phase difference by demodulating and analyzing the superimposed signals, and finally achieves phase synchronization by adjusting the phase of the signals. This algorithm has high reliability and transmission efficiency, so it has broad application prospects in the field of communications.

5. Algorithm complete program engineering

OOOOO

OOO

O

Guess you like

Origin blog.csdn.net/aycd1234/article/details/132724716
Recommended