def select_peaks(data, events, limit):
    """Check whether event is satisfies amplitude limit.

    Parameters
    ----------
    data : ndarray (dtype='float')
        vector with data
    events : ndarray (dtype='int')
        N x 3 matrix with start, peak/trough, end samples
    limit : float
        low and high limit for spindle duration

    Returns
    -------
    ndarray (dtype='int')
        N x 2+ matrix with start, peak, end samples

    """
    selected = abs(data[events[:, (1)]]) >= abs(limit)
    return events[(selected), :]
