BPSK-based relay fading channel bit error rate simulation, compared with AF, DF, CF and other relay modes

Table of contents

1. Theoretical basis

1.1AF

1.2CF

1.3DF

2. Core program

3. Simulation conclusion


1. Theoretical basis

       In wireless communication, relay technology is an important technical means, which is used to expand communication distance, enhance communication quality and increase communication capacity. Relays can be divided into three types: AF (Amplify and Forward), DF (Decode and Forward) and CF (Compress and Forward). This article will introduce in detail the principles, advantages and disadvantages of these three relays and the implementation of Matlab.

1.1AF


        AF relay is a simple relay technology based on amplifying the relayed signal and forwarding the signal to the receiving end. Specifically, the steps of AF relay are as follows:
the relay node receives the signal, amplifies the signal and forwards it to the receiving end.
The receiving end receives two signals: the original signal and the relay signal. These two signals are added to get the final signal.
       The advantage of the AF relay is that it is simple to implement and relatively simple to process the signal. However, since noise and distortion are introduced during the signal amplification process, the performance of the AF relay is poor, and problems such as signal interference and bit errors are prone to occur.
      To realize the AF relay in Matlab, the following steps can be followed:
Generate the original signal, for example, by using the randn function to generate a Gaussian white noise signal.
A relay signal is generated, for example, by amplifying and adding noise to the original signal.
Generate a receiver signal, for example by adding the original signal and the relay signal.
Draw the time-domain waveform and frequency-domain waveform of the signal, as well as performance indicators such as bit error rate curves.

1.2CF

       CF relay is a relay technology based on signal compression. It compresses and sends relay signals to reduce the amount of transmitted data. Specifically, the steps of CF relay are as follows:
       the relay node receives the signal, compresses and encodes the signal, and obtains the compressed signal.
       The relay node forwards the compressed signal to the receiver.
        The receiving end receives the relay signal and uses a decompression algorithm to decompress the signal to obtain the original signal.
        The receiving end adds the decompressed signal to the original signal to obtain the final signal.
         The advantage of CF relay is that it can reduce the amount of transmitted data and improve communication efficiency. However, CF relay also has some disadvantages, such as the high complexity of the decompression algorithm, and certain requirements on the quality and reliability of the signal.
To implement CF relay in Matlab, the following steps can be followed:
Generate an original signal, for example, by using the randn function to generate a Gaussian white noise signal.
Compress the original signal, for example, using compression methods such as wavelet transform.
Coding the compressed signal, for example, using a coding method such as a convolutional code or a Turbo code.
The relay node receives the signal, decodes and decompresses the signal to obtain the original signal.
A relay signal is generated, for example, by compressing, encoding and adding noise to the original signal.
The relay node forwards the decoded signal and the relay signal to the receiving end.
The receiving end receives the relay signal and uses a decompression algorithm to decompress the signal to obtain the original signal.
The receiving end adds the decompressed signal to the original signal to obtain the final signal.
Draw the time-domain waveform and frequency-domain waveform of the signal, as well as performance indicators such as bit error rate curves.

1.3DF

       DF relay is a more complex relay technology than AF relay. It decodes the received signal based on the relay node and forwards the decoded signal to the receiving end. Specifically, the steps of DF relay are as follows:
the relay node receives the signal and decodes the signal to obtain the original signal.
The relay node forwards the decoded signal to the receiver.
       The receiving end receives two signals: the original signal and the relay signal. The final signal is obtained by decoding the relay signal and using the decoding result to perform interference cancellation on the original signal.
       The advantage of DF relay is that it can reduce signal interference and distortion, and improve signal quality and reliability. However, DF relay also has some disadvantages, such as high complexity of decoding and encoding, and sensitivity to channel changes.
To implement DF relay in Matlab, the following steps can be followed:
Generate the original signal, for example, by using the randn function to generate a Gaussian white noise signal.
Coding the original signal, for example, using a coding method such as a convolutional code or a Turbo code.
The relay node receives the signal and decodes the signal to obtain the original signal.
A relay signal is generated, for example, by processing the original signal with noise.
The relay node forwards the decoded signal and the relay signal to the receiving end.
       The receiving end receives two signals: the original signal and the relay signal. The final signal is obtained by decoding the relay signal and using the decoding result to perform interference cancellation on the original signal.
Draw the time-domain waveform and frequency-domain waveform of the signal, as well as performance indicators such as bit error rate curves.
 

2. Core program

.......................................................
    %%%%%%%%%Channel characteristics%%%%%%%%%%%%%%%% 
    SNRdB = -3:30; %Range of SNR for which BER is investigated. 

    %additive noise and channel response for the relay channel: 
    %Source uplink channel: 
    noise_d = 1/sqrt(2) * (randn(2 * N_bits,1) + j * randn(2 * N_bits,1)); 
    h_d = 1/sqrt(2) * (randn(2 * N_bits,1) + j * randn(2 * N_bits,1)); 

    %interuser channel: 
    noise_r1 = 1/sqrt(2) * (randn(2 * N_bits,1) + j * randn(2 * N_bits,1)); 
    h_r1 = 1/sqrt(2) * (randn(2 * N_bits,1) + j * randn(2 * N_bits,1)); 

    %for Relay uplink: 
    noise_r2 = 1/sqrt(2) * (randn(2 * N_bits,1) + j * randn(2 * N_bits,1)); 
    h_r2 = 1/sqrt(2) * (randn(2 * N_bits,1) + j * randn(2 * N_bits,1)); 

    for k = 1:length(SNRdB) 

    SNR = 10^(SNRdB(k)/10); %convert SNRdB to linear value SNR 

    ftx_r1 = sqrt(SNR) * h_r1 .* tx + noise_r1; 

    %%%%%%%%%%%%%%%%% At the Relay %%%%%%%%%%%%% 
    %%%%%%%%%%%%%%%%%%%%%%%%%Decode n F%%%%%% 
    %equalizing at relay 
    eq_rx1 = ftx_r1 .* conj(h_r1); 
    %hard decision and converting from bipolar to bits 
    r_bits = (sign(real(eq_rx1)) + 1)/2; 
    %channel decoding: 
    dec_dcf_r1 = vitdec(r_bits,trellis,3,'term','hard'); 
    %re-encoding using the same procedure as Source: 
    c_data2 = convenc(dec_dcf_r1,trellis); 
    %BPSK signal for the relay coded data: 
    tx2_dcf = 2 * c_data2 - 1; 
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 

    %%%%%%%%%%%%%%%%%%Detect n F%%% 

    dec_dtf_r1 = sign(real(eq_rx1)); 
    tx2_dtf = dec_dtf_r1; 

    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%Apmlify n F%% 

    beta = sqrt(1./((SNR * abs(h_r1).^2) + 1)); 
    %amplification: 
    ftx_amp = ftx_r1 .* beta; 

    %%%%%%%%%%%%%%%%%%%%%%%%%%Relay to Destination% 
    %DCF 
    ftx_dcf_r2 = sqrt(SNR) * tx2_dcf .* h_r2 + noise_r2 ; 
    %DTF 
    ftx_dtf_r2 = sqrt(SNR) * tx2_dtf .* h_r2 + noise_r2 ; 
    %AF 
    ftx_af_r2 = sqrt(SNR) * ftx_amp .* h_r2 + noise_r2 ; 

....................................................................................
 
figure 
semilogy(SNRdB,avgber_dcf,SNRdB,avgber_dtf,SNRdB,avgber_af,SNRdB,theberawgn,SNRdB,theberrayleigh,SNRdB,mrcth); 
axis([SNRdB(1) max(SNRdB) 10^-5 0.5]); 
grid on 
legend('DCF','DTF','AF','AWGN','Rayleigh','MRC 2 senders'); 
xlabel('SNR dB'); 
ylabel('BER'); 
title(['BER curves for comparison,(averaged for ',num2str(N_iter),' iterations)']); 
UP189

3. Simulation conclusion

 

Guess you like

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