Atmosphere¶
The atmosphere module contains functions and classes related to atmospheric
acoustics and is based on acoustics.standards.iso_9613_1_1993
.
Atmosphere class¶
-
class
acoustics.atmosphere.
Atmosphere
(temperature=293.15, pressure=101.325, relative_humidity=0.0, reference_temperature=293.15, reference_pressure=101.325, triple_temperature=273.16)[source]¶ Class describing atmospheric conditions.
-
REF_PRESSURE
= 101.325¶ International Standard Atmosphere in kilopascal
-
REF_TEMP
= 293.15¶ Reference temperature
-
TRIPLE_TEMP
= 273.16¶ Triple point isotherm temperature.
-
__init__
(temperature=293.15, pressure=101.325, relative_humidity=0.0, reference_temperature=293.15, reference_pressure=101.325, triple_temperature=273.16)[source]¶ Parameters: - temperature – Temperature in kelvin
- pressure – Pressure
- relative_humidity – Relative humidity
- reference_temperature – Reference temperature.
- reference_pressure – Reference pressure.
- triple_temperature – Triple temperature.
-
attenuation_coefficient
(frequency)[source]¶ Attenuation coefficient \(\alpha\) describing atmospheric absorption in dB/m as function of
frequency
.Parameters: frequency – Frequencies to be considered. The attenuation coefficient is calculated using
acoustics.standards.iso_9613_1_1993.attenuation_coefficient()
.
-
frequency_response
(distance, frequencies, inverse=False)[source]¶ Frequency response.
Parameters: - distance – Distance between source and receiver.
- frequencies – Frequencies for which to compute the response.
- inverse – Whether the attenuation should be undone.
-
impulse_response
(distance, fs, ntaps=None, inverse=False)[source]¶ Impulse response of sound travelling through atmosphere for a given distance sampled at fs.
Parameters: - atmosphere – Atmosphere.
- distance – Distance between source and receiver.
- fs – Sample frequency
- ntaps – Amount of taps.
- inverse – Whether the attenuation should be undone.
See also
-
molar_concentration_water_vapour
¶ Molar concentration of water vapour \(h\).
The molar concentration of water vapour is calculated using
acoustics.standards.iso_9613_1_1993.molar_concentration_water_vapour()
.
-
plot_attenuation_coefficient
(frequency)[source]¶ Plot the attenuation coefficient \(\alpha\) as function of frequency and write the figure to
filename
.Parameters: - filename – Filename
- frequency – Frequencies
Note
The attenuation coefficient is plotted in dB/km!
-
pressure
= None¶ Ambient pressure \(p_a\).
-
reference_pressure
= None¶ Reference pressure.
-
reference_temperature
= None¶ Reference temperature.
-
relative_humidity
= None¶ Relative humidity
-
relaxation_frequency_nitrogen
¶ Resonance frequency of nitrogen \(f_{r,N}\).
The resonance frequency is calculated using
acoustics.standards.iso_9613_1_1993.relaxation_frequency_nitrogen()
.
-
relaxation_frequency_oxygen
¶ Resonance frequency of oxygen \(f_{r,O}\).
The resonance frequency is calculated using
acoustics.standards.iso_9613_1_1993.relaxation_frequency_oxygen()
.
-
saturation_pressure
¶ Saturation pressure \(p_{sat}\).
The saturation pressure is calculated using
acoustics.standards.iso_9613_1_1993.saturation_pressure()
.
-
soundspeed
¶ Speed of sound \(c\).
The speed of sound is calculated using
acoustics.standards.iso_9613_1_1993.soundspeed()
.
-
temperature
= None¶ Ambient temperature \(T\).
-
triple_temperature
= None¶ Triple temperature.
-
From ISO 9613-1 1993¶
Constants¶
-
iso_9613_1_1993.
SOUNDSPEED
= 343.2¶
-
iso_9613_1_1993.
REFERENCE_TEMPERATURE
= 293.15¶
-
iso_9613_1_1993.
REFERENCE_PRESSURE
= 101.325¶
-
iso_9613_1_1993.
TRIPLE_TEMPERATURE
= 273.16¶
Functions¶
-
acoustics.standards.iso_9613_1_1993.
soundspeed
(temperature, reference_temperature=293.15)[source]¶ Speed of sound \(c\).
Parameters: - temperature – Ambient temperature \(T_0\)
- reference_temperature – Reference temperature \(T\)
The speed of sound is calculated using
\[c = 343.2 \left( \frac{T}{T_0} \right)\]
-
acoustics.standards.iso_9613_1_1993.
saturation_pressure
(temperature, reference_pressure=101.325, triple_temperature=273.16)[source]¶ Saturation vapour pressure \(p_{sat}\).
Parameters: - temperature – Ambient temperature \(T\)
- reference_pressure – Reference pressure \(p_r\)
- triple_temperature – Triple point temperature water \(T_{01}\)
The saturation vapour pressure is calculated using
\[p_{sat} = 10^C \cdot p_r\]with exponent \(C\) given by
\[C = -6.8346 \cdot \left( \frac{T_{01}}{T} \right)^{1.261} + 4.6151\]
-
acoustics.standards.iso_9613_1_1993.
molar_concentration_water_vapour
(relative_humidity, saturation_pressure, pressure)[source]¶ Molar concentration of water vapour \(h\).
Parameters: - relative_humidity – Relative humidity \(h_r\)
- saturation_pressure – Saturation pressure \(p_{sat}\)
- pressure – Ambient pressure \(p\)
The molar concentration of water vapour is calculated using
\[h = h_r \frac{p_{sat}}{p_a}\]
-
acoustics.standards.iso_9613_1_1993.
relaxation_frequency_nitrogen
(pressure, temperature, h, reference_pressure=101.325, reference_temperature=293.15)[source]¶ Relaxation frequency of nitrogen \(f_{r,N}\).
Parameters: - pressure – Ambient pressure \(p_a\)
- temperature – Ambient temperature \(T\)
- h – Molar concentration of water vapour \(h\)
- reference_pressure – Reference pressure \(p_{ref}\)
- reference_temperature – Reference temperature \(T_{ref}\)
The relaxation frequency of nitrogen is calculated using
\[f_{r,N} = \frac{p_a}{p_r} \left( \frac{T}{T_0} \right)^{-1/2} \cdot \left( 9 + 280 h \exp{\left\{ -4.170 \left[ \left(\frac{T}{T_0} \right)^{-1/3} -1 \right] \right\} } \right)\]
-
acoustics.standards.iso_9613_1_1993.
relaxation_frequency_oxygen
(pressure, h, reference_pressure=101.325)[source]¶ Relaxation frequency of oxygen \(f_{r,O}\).
Parameters: - pressure – Ambient pressure \(p_a\)
- reference_pressure – Reference pressure \(p_r\)
- h – Molar concentration of water vapour \(h\)
The relaxation frequency of oxygen is calculated using
\[f_{r,O} = \frac{p_a}{p_r} \left( 24 + 4.04 \cdot 10^4 h \frac{0.02 + h}{0.391 + h} \right)\]
-
acoustics.standards.iso_9613_1_1993.
attenuation_coefficient
(pressure, temperature, reference_pressure, reference_temperature, relaxation_frequency_nitrogen, relaxation_frequency_oxygen, frequency)[source]¶ Attenuation coefficient \(\alpha\) describing atmospheric absorption in dB/m for the specified
frequency
.Parameters: - pressure – Ambient pressure \(T\)
- temperature – Ambient temperature \(T\)
- reference_pressure – Reference pressure \(p_{ref}\)
- reference_temperature – Reference temperature \(T_{ref}\)
- relaxation_frequency_nitrogen – Relaxation frequency of nitrogen \(f_{r,N}\).
- relaxation_frequency_oxygen – Relaxation frequency of oxygen \(f_{r,O}\).
- frequency – Frequencies to calculate \(\alpha\) for.