def pam4_decision(x,l,m,h):
    """produces pam4 symbol from analog voltage
    
    Parameters
    ----------
    x : float
        the analog voltage
    
    l: float
        voltage threshold between 0 and 1 symbol
    
    m: float
        voltage threshold between 1 and 2 symbol
        
    h: float
        voltage threshold between 2 and 3 symbol
    
    Returns
    -------
    int
        the pam4 symbol that represents x
    """
    if x<l:
        return 0
    elif x<m:
        return 1
    elif x<h:
        return 2
    else:
        return 3