windwhisper.atmospheric_absorption

This module contains functions to calculate the atmospheric absorption of sound.

Functions

load_atmospheric_absorption_coefficients()

Load atmospheric absorption coefficients from disk.

compute_weighted_absorption(absorption_coefficients)

Compute a weighted atmospheric absorption coefficient.

get_absorption_coefficient([temperature, humidity])

Return the weighted absorption coefficient for the given conditions.

Module Contents

windwhisper.atmospheric_absorption.load_atmospheric_absorption_coefficients()

Load atmospheric absorption coefficients from disk.

Returns:

Nested mapping keyed by temperature and relative humidity with absorption coefficients per frequency band.

Return type:

dict

windwhisper.atmospheric_absorption.compute_weighted_absorption(absorption_coefficients)

Compute a weighted atmospheric absorption coefficient.

Parameters:

absorption_coefficients (dict[str, float]) – Absorption coefficients in dB/km keyed by third-octave band centre frequency.

Returns:

Weighted absorption coefficient in dB/km.

Return type:

float

windwhisper.atmospheric_absorption.get_absorption_coefficient(temperature=20, humidity=70)

Return the weighted absorption coefficient for the given conditions.

Parameters:
  • temperature (float) – Air temperature in degrees Celsius.

  • humidity (float) – Relative humidity expressed as a percentage.

Returns:

Weighted absorption coefficient in dB/km.

Return type:

float

Raises:

ValueError – If the requested temperature or humidity is not available in the coefficient table.