Skip to main content
. 2025 Aug 29;25(17):5354. doi: 10.3390/s25175354
Algorithm 1 Iterative algorithm based on linear regression
  • 1:

    Input: Jump Measurement from Instr1-Instr2

  • 2:

    %Training phase

  • 3:

    Length of TS = subset of measures is considered for the training phase (TS1 and TS2)

  • 4:

      

  • 5:

    Tmean = Mean of TS1 and TS2

  • 6:

    Define Peak To Peak Initial Distance (PPID)

  • 7:

    PPIDTS1 = MAX(TS1)MIN(TS1)

  • 8:

    PPIDTS2 = MAX(TS2)MIN(TS2)

  • 9:

    iteration=1;

  • 10:

      

  • 11:

    repeat

  • 12:

      

  • 13:

       i=iteration

  • 14:

       [m1i,q1i]=polyfit(TS1,Tmean,1)

  • 15:

       [m2i,q2i]=polyfit(TS2,Tmean,1)

  • 16:

      

  • 17:

       TS1n=m1iTS1+q1i

  • 18:

       TS2n=m2iTS2+q2i

  • 19:

      

  • 20:

       Tmean=mean(TS2n,TS1n)

  • 21:

       MGValue=Distance(TS2n,TS1n)

  • 22:

       CohenKValue=CohenK(TS2n,TS1n)

  • 23:

      

  • 24:

       NPPDTS1n = MAX(TS1n)MIN(TS1n)PPIDTS1

  • 25:

      

  • 26:

       NPPDTS2n = MAX(TS2n)MIN(TS2n)PPIDTS2

  • 27:

      

  • 28:

       condition_1 = MGValue(i)<MGValue(i1);

  • 29:

      

  • 30:

       condition_2 = CohenKValue(i)>CohenKValue(1)

  • 31:

      

  • 32:

       condition_3 = (NPPDTS1n>0.60) & (NPPDTS2n>0.60)

  • 33:

      

  • 34:

       iteration=iteration+1;

  • 35:

      

  • 36:

    until condition_1 & condition_2 & condition_3

  • 37:

      

  • 38:

    %Test phase

  • 39:

    Length of TS = subset of measures is considered for the test phase (TS1 and TS2)

  • 40:

      

  • 41:

    TS1n = TS1i=1x1m1i+i=1x1q1ij=i+1x1m1j

  • 42:

      

  • 43:

    TS2n = TS2i=1x1m2i+i=1x1q2ij=i+1x1m2j

  • 44:

    with x=1number of iteration

  • 45:

    Output: TS1n, TS2n