def split_overlapping(signal, freq=257, time=2, shift=0.5):
    """
    Splits the signal data into segments. Expects signal with dim-0 samples, dim-1 leads (12)
    :param signal: the signal
    :param freq: frequency rate of the signal
    :param time: time length of the segments
    :param shift: time shift in taking different section
    :return: list of signal segments and list of starting sample of segment
    """
    seglen = int(freq*time)
    shiftlen = int(shift*time)
    siglen = signal.shape[0]

    times = range(0, siglen-seglen, shiftlen)
    segments = [signal[i:i+seglen, :] for i in times]

    return segments, times