Skip to main content
. 2021 Oct 16;21(20):6872. doi: 10.3390/s21206872
Algorithm 1. Signal processing for obtaining the mean signal and RF power.
Input: Spread factor SF; bandwidth BW; sampling rate fs; the number of symbols in each frame Nsym; receiver impedance Z; number of frames FrameNumbers.
Output: histograms of the average chirp’s signal as a power signal.
Initialization: SF = 7, BW = 125×103 [Hz], fs = 5 ×106 [SPS], Nsym = 12.25 (C3), FrameNumbers = 100 and Z = 50 [Ω].
  • (1)

    Compute the symbol duration (Tsym), time on air (TA), and the number of samples (NS) as follows:

Tsym=2SFBW, (4)
where SF is the spread factor and BW is the bandwidth in Hertz.
TA=Nsym×Tsym,   (5)
where Nsym is the number of symbols in each frame and Tsym is the symbol duration in seconds.
NS=fs×TA. (6)
where fs is the sample rate in samples per second and TA is the time on air in seconds.
  • (2)
    Convert the captured I, Q signal from binary to complex:
    I,Qbinarydata.dat.
  • (3)
    Detect the start of each frame. Convolution is applied to the I, Q signal using the number of samples from (6) as follows:
    WindowSize 1Ns×np.ones1,NS,   
    signal=I,Q, 
    signalWindowSizenk=0NS1signalkWindowSizenk.
  • (4)
    Search the local maximum (peaks) to discard the frames with a considerable attenuation:
    PeaksVectorfind_peakssignalWindowSizen.
  • (5)
    Select an empirical threshold (on the peaks) to identify the start of each frame:
    indexesfindPeaksVector>thresholdmaxPeaksVector.

The threshold parameter for each distance and height was obtained empirically so that the noise did not significantly affect the analyzed signal. These values are shown in Table 3.

  • (6)
    At the beginning of each frame, determine its corresponding left and right indexes. The aim of this procedure is to create a vector of frames and to avoid the guard interval between each pair of frames:
    LeftIndexPeaksVectorindexesNs,
    RightIndex LeftIndex+Ns
    .
  • (7)

    Obtain a mean frame from the vector of 100 frames:


     for i=1FrameNumbers
          Frame I,QLeftIndexi:RightIndexi
FrameVectorFrameVector Frame
     end
     FrameVectorMatrixNS[FrameNumbers]←FrameVector.
MeanFrameNs1MeanValueForColumnsFrameVectorMatrix.
  • (8)
    Determine the signal power histograms of the mean frame:
    PowerHistdBm=hist10×log10realMeanFramen2+imagMeanFramen22Z+30.
  • (9)
    Compute the RF power of the mean frame:
    RFPower=meanPowerHistdBm.