Skip to main content
. 2017 Nov 8;17(11):2573. doi: 10.3390/s17112573
Algorithm 7. Step detection framework
  Initiate adaptive filter frequencies and coefficients
  Repeat for each sample:
  ------- peak extraction and update section -------
  If in motion
    Filter measurements
    S ← Detect candidate
    If S = 1
      If Sk1 = −1 && time_since_valley > ta/r
        Valid peak detected
      Elseif Sk1 = S
        Δt= tSK tSK1
        apeakk = peak update (thu, Sk1, Sk)
        If Δt  step duration && significant motion detected
          Account for valley miss
        Endif
      Endif
    Elseif S = −1
      If Sk1 = 1 && time_since_peak > ta/r
        Valid valley detected
      Elseif Sk1 = S
        Δt= tSK tSK1
        avalleyk = peak update (thu, Sk1, Sk)
        If Δt  step duration && significant motion detected
          Account for peak miss
        Endif
      Endif
    Endif
  ------- peak validation from gyroscope and magnetometer -------
    dominant axis extraction(ω(n), m(n))
    If dr > 0
       Sω , Sm ← Detect candidate(ω(n), m(n))
       If Sω = 1 || Sω = −1
        peak matching(tapeak, tωpeak, tmpeak)
        validate matching peaks
      Endif
    Endif
  ------- step validation -------
    step validation (Ask)
    adaptive filter frequency selector (LPD)