def compute_attenuation_profile(a_zero, a_tilting, freq):
    """compute_attenuation_profile returns the attenuation profile at the frequencies freq

    :param a_zero: the attenuation [dB] @ the baseband central frequency. Scalar
    :param a_tilting: the attenuation tilt in dB/THz. Scalar
    :param freq: the baseband frequencies at which attenuation is computed [THz]. Array
    :return: attenuation: the attenuation profile in dB
    """

    if len(freq):
        attenuation = a_zero + a_tilting * freq

        # abs in order to avoid ambiguity due to the sign convention
        attenuation = abs(attenuation)
    else:
        attenuation = []

    return attenuation