def trim_downbeats(downbeat_times, downbeat_labels, ini_bar, num_bars):
    """ Trim downbeats to select certain section within the recording.

    Parameters
    ----------
    downbeat_times : np.ndarray
        time instants of the downbeats
    downbeat_labels : list
        labels at the downbeats
    ini_bar : int
        initial bar to trim from
    num_bars : int
        number of bars to trim

    Returns
    -------
    downbeat_times_trimmed : np.ndarray
        time instants of the downbeats after trimming
    downbeat_labels_trimmed : list
        labels at the downbeats after trimming

    """

    downbeat_times_trimmed = downbeat_times[ini_bar-1:ini_bar-1+num_bars]
    downbeat_labels_trimmed = downbeat_labels[ini_bar-1:ini_bar-1+num_bars]

    return downbeat_times_trimmed, downbeat_labels_trimmed