def _split_channels(num_chan, num_groups):
    """Split range(num_chan) in num_groups intervals. The first one is larger if num_chan is not a multiple of num_groups"""
    split = [num_chan // num_groups for _ in range(num_groups)]
    # add the remaining channels to the first group
    split[0] += num_chan - sum(split)
    return split