def hz2bark(freq):
    """
    Function hz2bark calculates Bark scale. 
    Use Traunmueller-formula for f  >  200 Hz
              Linear mapping for f <=  200 Hz
    
    @param freq: Frequency.
    @returns: Corresponding Bark scale for given frequency.
    """
    z_less_200 = freq / 102.9
    z_greater_200 = 26.81 * freq / (1960 + freq) - 0.53
    return (freq > 200) * z_greater_200 + (freq <= 200) * z_less_200