Skip to main content
. 2019 Jul 25;19(15):3268. doi: 10.3390/s19153268
Algorithm 1 Find Most Frequent Scale.
Require:B—an array of best scale factors, ξ—the range threshold (default: ξ=0.0002), n—the length of the array B
  • 1:

    i0

  • 2:

    whilei<ndo

  • 3:

        siB.bi

  • 4:

        fi1

  • 5:

        Ψi{(B.ii,B.ki)}

  • 6:

        ji1

  • 7:

        while (j>0 &B.biB.bj<ξ) do

  • 8:

            si(si+B.bj)/2

  • 9:

            fifi+1

  • 10:

            ΨiΨi{(B.ij,B.kj)}

  • 11:

            jj1

  • 12:

        end while

  • 13:

        ji+1

  • 14:

        while (j<n &B.biB.bj<ξ) do

  • 15:

            si(si+B.bj)/2

  • 16:

            fifi+1

  • 17:

            ΨiΨi{(B.ij,B.kj)}

  • 18:

            jj+1

  • 19:

        end while

  • 20:

        ij

  • 21:

    end while