def restore_signal(uni_signal, channels):
    """ Uniformize a signal between 0.0 and 1.0
        Requires every channel to have bounds, or be discretized.
    """
    signal = {}
    for c in channels:
        factor = 1.0
        if c.bounds[0] != c.bounds[1]:
            assert c.bounds[0] < c.bounds[1]
            factor = c.bounds[1] - c.bounds[0]
        signal[c.name] = uni_signal[c.name] * factor + c.bounds[0]
    return signal
