Skip to main content
. 2021 Feb 3;21(4):1035. doi: 10.3390/s21041035
Algorithm 1 Adaptive threshold computation

Require: sound signal of n values

Ensure: adaptive threshold value Θ

  • 1:

    Carr← Nb of crosses between S and Θ, Θ ranging from 0.01 to 0.5

  • 2:

    Cmax=max(Carr)

  • 3:

    Θmax=argmaxΘ(Carr)

  • 4:

    ifCmax==0then

  • 5:

    return 0

  • 6:

    end if

  • 7:

    if elbow present in Carr then

  • 8:

    return Θ at the elbow

  • 9:

    end if

  • 10:

    ifmax(Carr)>2then

  • 11:

    return min(Θ) s.t. Carr<2,Θmax<Θ

  • 12:

    else

  • 13:

    return lowest Θ (0.01)

  • 14:

    end if