def dig2phys(signal, dmin, dmax, pmin, pmax):
    """
    converts digital edf values to analogue values 
    
    :param signal: A numpy array with int values (digital values)  or an int
    :param dmin: digital minimum value of the edf file (eg -2048)
    :param dmax: digital maximum value of the edf file (eg 2048)
    :param pmin: physical maximum value of the edf file (eg -200.0)
    :param pmax: physical maximum value of the edf file (eg 200.0)
    :returns: converted physical values
    """
    m = (pmax-pmin) / (dmax-dmin)
    physical = m * signal
    return physical