Skip to main content
. 2021 Oct 17;21(20):6881. doi: 10.3390/s21206881
Algorithm 1. The pseudocode of the proposed ED process.
1: INPUT: mimo_ofdm_received_signal_M× r, number of samples (N), SNR_loop, DT factor (ρ), NU factor (ρ), noise variance (σni2), range ofPfaiand number of Monte Carlo simulations (kk)
 2: OUTPUT: Probability of detection (Pd)
 3: ON INITIALIZED Received MIMO-OFDM signal (mimo_ofdm_received_signal_M×r) do:
 Step 1: Simulation of interdependence between the detection probability (Pd) and false alarm probability (Pfa)
 4:              set kk = number of Monte Carlo simulations
 5:              setPfa= probability of false alarm in interval [0,1]
 6:     FOR        p = 1:length (Pfa)
 7:                  i1= 0;
 8:    FOR i = 1:10,000;
 Step 2: Modeling the impact of NU on the received signal
 9:                Noise uncertiaity (ρ> 1.00) = sqrt(σw2r(n)>1.00). * randn (1, framelen);
 10:      received_signal_M× r = mimo_ofdm_received_signal_M×r + Noise uncertaiity;
 Step 3: Calculation of energy of received signal based on SLC method
 11:                           REPEATE FOR r = 1:R
 12:      energy_calc_r = abs(received_signal_M×r).^2;
 13: END
 Step 4:Test statistic calculation (based on (7))
 14:                         FOR r = 1:R
 15:      test_stat = sum(energy_calc_r);
 16: END
 Step 5: Threshold evaluation
 17:            thresh (p) = ((qfuncinv(Pfa(p)). * ρ./sqrt(N))+ ρ)./ρ;
 Step 6:     Decision making process (based on (8), (9))
 18:                      IF (test_stat >= thresh (p));
 19:                      i1 = i1 + 1;
 20:                      END
 21:      END
 Step 7: Monte Carlo simulation-determiningPd(based on (15))
 22:      Pdi(p) = i1/kk;
 23:        END
 24:        UNTIL    Pdi= [0,1]