def METHOD_NAME(mod, channel, normalize):
    """
    Automatically generate the lookup table that maps the FSM outputs
    to channel inputs corresponding to a channel 'channel' and a modulation
    'mod'. Optional normalization of channel to unit energy.
    This table is used by the 'metrics' block to translate
    channel outputs to metrics for use with the Viterbi algorithm.
    Limitations: currently supports only one-dimensional modulations.
    """
    dim = mod[0]
    constellation = mod[1]
    if normalize:
        p = 0
        for i in range(len(channel)):
            p = p + channel[i]**2
        for i in range(len(channel)):
            channel[i] = channel[i] / math.sqrt(p)
    lookup = list(range(len(constellation)**len(channel)))
    for o in range(len(constellation)**len(channel)):
        ss = dec2base(o, len(constellation), len(channel))
        ll = 0
        for i in range(len(channel)):
            ll = ll + constellation[ss[i]] * channel[i]
        lookup[o] = ll
    return (1, lookup)