Iec 61672 1 2013
IEC 61672-1:2013
This module implements IEC 61672-1:2013 which provides electroacoustical performance specifications for three kinds of sound measuring instruments:
- Time-weighting sound level meters that measure exponential-time-weighted, frequency-weighted sound levels
- Integrating-averaging sound level meters that measure time-averaged, frequency-weighted sound levels
- Integrating sound level meters that measure frequency-weighted sound exposure levels
The module provides functions for: - Frequency weighting (A, C, Z) - Time weighting (Fast, Slow) - Sound level calculations
Reference
IEC 61672-1:2013: http://webstore.iec.ch/webstore/webstore.nsf/artnum/048669
Attributes
WEIGHTING_DATA
module-attribute
WEIGHTING_DATA = read_csv(
BytesIO(
get_data(
"acoustic_toolbox",
join("data", "iec_61672_1_2013.csv"),
)
),
sep=",",
index_col=0,
)
DataFrame with indices, nominal frequencies and weighting values.
NOMINAL_THIRD_OCTAVE_CENTER_FREQUENCIES
module-attribute
Nominal ⅓-octave frequencies. See table 3.
NOMINAL_OCTAVE_CENTER_FREQUENCIES
module-attribute
Nominal 1/1-octave frequencies. Based on table 3.
REFERENCE_FREQUENCY
module-attribute
REFERENCE_FREQUENCY: float = 1000.0
Reference frequency. See table 3.
EXACT_THIRD_OCTAVE_CENTER_FREQUENCIES
module-attribute
EXACT_THIRD_OCTAVE_CENTER_FREQUENCIES: NDArray[float64] = (
REFERENCE_FREQUENCY * 10.0**0.01 * arange(10, 44) - 30
)
Exact third-octave center frequencies. See table 3.
WEIGHTING_A
module-attribute
Frequency weighting A. See table 3.
WEIGHTING_C
module-attribute
Frequency weighting C. See table 3.
WEIGHTING_Z
module-attribute
Frequency weighting Z. See table 3.
WEIGHTING_VALUES
module-attribute
WEIGHTING_VALUES: Dict[str, NDArray[float64]] = {
"A": WEIGHTING_A,
"C": WEIGHTING_C,
"Z": WEIGHTING_Z,
}
Dictionary with weighting values 'A', 'C' and 'Z' weighting.
_POLE_FREQUENCIES
module-attribute
Approximate values for pole frequencies f_1, f_2, f_3 and f_4.
See section E.4.1 of the standard.
_NORMALIZATION_CONSTANTS
module-attribute
Normalization constants \(C_{1000}\) and \(A_{1000}\).
See section E.4.2 of the standard.
WEIGHTING_FUNCTIONS
module-attribute
WEIGHTING_FUNCTIONS: Dict[str, callable] = {
"A": weighting_function_a,
"C": weighting_function_c,
"Z": weighting_function_z,
}
Dictionary with available weighting functions 'A', 'C' and 'Z'.
WEIGHTING_SYSTEMS
module-attribute
WEIGHTING_SYSTEMS: Dict[str, callable] = {
"A": weighting_system_a,
"C": weighting_system_c,
"Z": weighting_system_z,
}
Dictionary with available weighting systems 'A', 'C' and 'Z'.
Functions
time_averaged_sound_level
time_averaged_sound_level(
pressure: NDArray[float64],
sample_frequency: float,
averaging_time: float,
reference_pressure: float = REFERENCE_PRESSURE,
) -> Tuple[NDArray[float64], NDArray[float64]]
Calculate time-averaged sound pressure level.
| PARAMETER | DESCRIPTION |
|---|---|
pressure
|
Dynamic pressure. |
sample_frequency
|
Sample frequency in Hz.
TYPE:
|
averaging_time
|
Averaging time in seconds.
TYPE:
|
reference_pressure
|
Reference pressure. Defaults to REFERENCE_PRESSURE.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Tuple[NDArray[float64], NDArray[float64]]
|
Tuple containing: - Time points in seconds - Time-averaged sound pressure levels in dB |
Source code in acoustic_toolbox/standards/iec_61672_1_2013.py
average
average(
data: NDArray[float64],
sample_frequency: float,
averaging_time: float,
) -> NDArray[float64]
Average the sound pressure squared.
| PARAMETER | DESCRIPTION |
|---|---|
data
|
Energetic quantity, e.g. p². |
sample_frequency
|
Sample frequency in Hz.
TYPE:
|
averaging_time
|
Averaging time in seconds.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
NDArray[float64]
|
Averaged data with time weighting applied using a low-pass filter |
NDArray[float64]
|
with one real pole at -1/τ. |
Note
Because fs·ti is generally not an integer, samples are discarded. This results in a drift of samples for longer signals (e.g. 60 minutes at 44.1 kHz).
Source code in acoustic_toolbox/standards/iec_61672_1_2013.py
time_weighted_sound_level
time_weighted_sound_level(
pressure: NDArray[float64],
sample_frequency: float,
integration_time: float,
reference_pressure: float = REFERENCE_PRESSURE,
) -> Tuple[NDArray[float64], NDArray[float64]]
Calculate time-weighted sound pressure level.
| PARAMETER | DESCRIPTION |
|---|---|
pressure
|
Dynamic pressure. |
sample_frequency
|
Sample frequency in Hz.
TYPE:
|
integration_time
|
Integration time in seconds.
TYPE:
|
reference_pressure
|
Reference pressure. Defaults to REFERENCE_PRESSURE.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Tuple[NDArray[float64], NDArray[float64]]
|
Tuple containing: - Time points in seconds - Time-weighted sound pressure levels in dB |
Source code in acoustic_toolbox/standards/iec_61672_1_2013.py
integrate
integrate(
data: NDArray[float64],
sample_frequency: float,
integration_time: float,
) -> NDArray[float64]
Integrate the sound pressure squared using exponential integration.
| PARAMETER | DESCRIPTION |
|---|---|
data
|
Energetic quantity, e.g. p². |
sample_frequency
|
Sample frequency in Hz.
TYPE:
|
integration_time
|
Integration time in seconds.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
NDArray[float64]
|
Integrated data with time weighting applied using a low-pass filter |
NDArray[float64]
|
with one real pole at -1/τ. |
Note
Because fs·ti is generally not an integer, samples are discarded. This results in a drift of samples for longer signals (e.g. 60 minutes at 44.1 kHz).
Source code in acoustic_toolbox/standards/iec_61672_1_2013.py
fast
Apply fast (F) time-weighting.
| PARAMETER | DESCRIPTION |
|---|---|
data
|
Energetic quantity, e.g. p². |
fs
|
Sample frequency in Hz.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
NDArray[float64]
|
Data with FAST time-weighting applied. |
See Also
integrate: Base integration function used for time-weighting.
Source code in acoustic_toolbox/standards/iec_61672_1_2013.py
slow
Apply slow (S) time-weighting.
| PARAMETER | DESCRIPTION |
|---|---|
data
|
Energetic quantity, e.g. p². |
fs
|
Sample frequency in Hz.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
NDArray[float64]
|
Data with SLOW time-weighting applied. |
See Also
integrate: Base integration function used for time-weighting.
Source code in acoustic_toolbox/standards/iec_61672_1_2013.py
fast_level
Calculate time-weighted (FAST) sound pressure level.
| PARAMETER | DESCRIPTION |
|---|---|
data
|
Dynamic pressure. |
fs
|
Sample frequency in Hz.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Tuple[NDArray[float64], NDArray[float64]]
|
Tuple containing: - Time points in seconds - FAST time-weighted sound pressure levels in dB |
See Also
time_weighted_sound_level: Base function for calculating time-weighted levels.
Source code in acoustic_toolbox/standards/iec_61672_1_2013.py
slow_level
Calculate time-weighted (SLOW) sound pressure level.
| PARAMETER | DESCRIPTION |
|---|---|
data
|
Dynamic pressure. |
fs
|
Sample frequency in Hz.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Tuple[NDArray[float64], NDArray[float64]]
|
Tuple containing: - Time points in seconds - SLOW time-weighted sound pressure levels in dB |
See Also
time_weighted_sound_level: Base function for calculating time-weighted levels.
Source code in acoustic_toolbox/standards/iec_61672_1_2013.py
weighting_function_a
Calculate A-weighting function in decibels.
| PARAMETER | DESCRIPTION |
|---|---|
frequencies
|
Vector of frequencies at which to evaluate the weighting. |
| RETURNS | DESCRIPTION |
|---|---|
NDArray[float64]
|
Vector with A-weighting scaling factors in dB, calculated using |
NDArray[float64]
|
equation E.6 from the standard with A₁₀₀₀ = -2 dB. |
Note
Implementation of equation E.6 from the standard.
Source code in acoustic_toolbox/standards/iec_61672_1_2013.py
weighting_function_c
Calculate C-weighting function in decibels.
| PARAMETER | DESCRIPTION |
|---|---|
frequencies
|
Vector of frequencies at which to evaluate the weighting. |
| RETURNS | DESCRIPTION |
|---|---|
NDArray[float64]
|
Vector with C-weighting scaling factors in dB, calculated using |
NDArray[float64]
|
equation E.1 from the standard with C₁₀₀₀ = -0.062 dB. |
Note
Implementation of equation E.1 from the standard.
Source code in acoustic_toolbox/standards/iec_61672_1_2013.py
weighting_function_z
Calculate Z-weighting function in decibels.
| PARAMETER | DESCRIPTION |
|---|---|
frequencies
|
Vector of frequencies at which to evaluate the weighting. |
| RETURNS | DESCRIPTION |
|---|---|
NDArray[float64]
|
Vector of zeros (Z-weighting applies no frequency weighting). |
Source code in acoustic_toolbox/standards/iec_61672_1_2013.py
weighting_system_a
Get A-weighting filter as polynomial transfer function.
| RETURNS | DESCRIPTION |
|---|---|
Tuple[NDArray[float64], NDArray[float64]]
|
Tuple containing: - Numerator coefficients of the transfer function - Denominator coefficients of the transfer function |
Note
Implementation of equation E.6 from the standard.
Source code in acoustic_toolbox/standards/iec_61672_1_2013.py
weighting_system_c
Get C-weighting filter as polynomial transfer function.
| RETURNS | DESCRIPTION |
|---|---|
Tuple[NDArray[float64], NDArray[float64]]
|
Tuple containing: - Numerator coefficients of the transfer function - Denominator coefficients of the transfer function |
Note
Implementation of equation E.1 from the standard.
Source code in acoustic_toolbox/standards/iec_61672_1_2013.py
weighting_system_z
Get Z-weighting filter as polynomial transfer function.
| RETURNS | DESCRIPTION |
|---|---|
Tuple[list[float], list[float]]
|
Tuple containing: - [1] (numerator for unity gain) - [1] (denominator for unity gain) |
Note
Z-weighting applies no frequency weighting (0.0 dB at all frequencies), therefore corresponds to multiplication by 1.