def compute_threshold(refs, units, threshold_value):
    """Compute the thresholds from reference values, unit values and the
    threshold value.

    Parameters
    ----------
    refs: array_like, shape(N, M)
        the reference values for all the times and elements.
    units: array_like, shape(N, M)
        the units values for all the the times and elements.
    threshold_value: float
        the number of units that the threshold is over the reference value.

    Returns
    -------
    thresholds: array_like, shape (N, M)
        the tresholds for each value and element.
    """

    thresholds = refs + threshold_value*units

    return thresholds