MATLAB code to test SPIM approach for SS

Citation Author(s):
Jorge Y.
Hernández García
Submitted by:
Jorge Y. Hernan...
Last updated:
Mon, 11/23/2020 - 23:38
DOI:
10.21227/40y2-pj28
Data Format:
License:
0
0 ratings - Please login to submit your rating.

Abstract 

MATLAB code for test spectrum sensing algorithm based on statistical processing of instantaneous magnitude (SPIM). The associated SCRIPTs allow: Generating different signals to check the method, FHSS, LFM, CW Pulse, etc. Plot the generated signal, the detection threshold and compare it with the ideal detection. Determine the errors for the different hypotheses based on SNR. Calculate errors in the determination of the amplitude and frequency for different SNRs. Evaluate the probability of detection with different threshold control values A and U. Compare the errors in detection for the SPIM method and the energy detector. Plot the values of the TPR FPR rates to calculate the ROC curve. Determines the MAD PDF of the instantaneous phase and the average instantaneous amplitude for comparison.

Instructions: 

SSEPIM_V1\A_SSEPIM_RepresDetecFHSS.m
    % SCRIPT for implementation of the detection module based on the statistical processing of instantaneous magnitudes (SPIM). The generated signal, the detection threshold are plotted and compared with the ideal detection.

    SSEPIM_V1\B_SSEPIM_DetermErrores.m
    % SCRIPT to graph the errors in the detection process. The errors for the different hypotheses are represented as a function of SNR.

    SSEPIM_V1\B2_SSEPIM_DetermErroresAmplitFrecSNR.m
    % SCRIPT to calculate amplitude and frequency errors for different signal sampling frequency / frequency ratios as a function of SNR.

    SSEPIM_V1\C_SSEPIM_DetermErroresVarAyU.m
    % SCRIPT to check for errors in detection. The detection probability is evaluated with different threshold control values A and U (U + A * Fa_iDAMprom)
    % L_snr = length (snrVec) iterations are performed for the calculation at a sample rate of 2e3Hz.

    SSEPIM_V1\D_CompErroSSSPIMconDetecEnerg.m
    % SCRIPT to check the detection errors for the SPIM method and the energy detector.
    % The probabilities of detection and false alarm are displayed for both methods.

    SSEPIM_V1\E1_AnalROC_SPIM_SNRVari.m
    % SCRIPT to plot the values of the rates TPR FPR to calculate the
    % ROC curve for different SNR values vSNR_dB = [- 5 0 0 5] and number of samples vNs = [15 15 2 2]. For the SPIM method, it is calculated
    % ROC for different combinations of U and A. The result is compared with
    % the energy detector (ED). This version implements the code of the function
    % to determine the values we obtain of U and A from the analysis of
    % maximum values of FPR and minimum values of TPR.

    SSEPIM_V1\E2_AnalCompROC_SPIMandED_N15.m
    % SCRIPT to plot the values of the rates TPR FPR to calculate the
    % ROC curve for vSNR_dB = -5 and Ns = 15.

    SSEPIM_V1\E3_AnalCompROC_SPIMandED_NVari.m
    % SCRIPT to plot the values of the rates TPR FPR to calculate the
    % ROC curve for different SNR values vSNR_dB = [- 5 0] and vNs = [15 2]. The result is compared with
    % the energy detector (ED).

    SSEPIM_V1\F_FunsDensProbUmbrConAmi.m
    % SCRIPT that determines the PDF of the MAD of the instantaneous phase and the average of the instantaneous amplitude for comparison.

    The signals that can be generated are:
                                       
    TEST SIGNAL GENERATOR
    % 1 % Señal de FHSS;
    % 2 % Señal LFM con control del ancho de banda
    % 3 % Señal DSSS
    % 4 % Señal Pulso CW
    % 5 % Señal BPSK
    % 6 % Señal CW Coseno
    % 7 % Señal CW Seno
    % 8 % Señal DSSS Pulso
    % 9 % Señal de FHSS continua;
    % otherwise %Señal VCO Frecuencia variable

To select a signal, the number of the signal to be generated is assigned to the variable (TipSx)