def getWAMP(rawEMGSignal, threshold):
    """ Wilson or Willison amplitude is a measure of frequency information.
        It is a number of time resulting from difference between the EMG signal of two adjoining segments, that exceed a threshold.::

            WAMP = sum( f(|x[i] - x[i+1]|)) for n = 1 --> n-1
            f(x){
                1 if x >= threshold
                0 otherwise
            }

        * Input:
            * rawEMGSignal = EMG signal as list
            * threshold = threshold to avoid fluctuations caused by noise and low voltage fluctuations
        * Output:
            * Wilson Amplitude value

        :param rawEMGSignal: the raw EMG signal
        :type rawEMGSignal: list
        :param threshold: value to sum / substract to the zero when evaluating the crossing.
        :type threshold: int
        :return: Willison amplitude
        :rtype: float
    """

    N = len(rawEMGSignal)
    WAMP = 0
    for i in range(0, N - 1):
        x = rawEMGSignal[i] - rawEMGSignal[i + 1]
        if (x >= threshold):
            WAMP += 1
    return (WAMP)