def make_gain_db(conf):
    """Generate a db domain gain function

    Args:
        conf: a dict {'db': #float}
            'db': the gaining value

    Returns:
        The db gain function, which could be applied on
        a float amplitude value
    """
    db = conf['db']

    def gain_db(x):
        return min(0.997, x * pow(10, db / 20))

    return gain_db