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) - Decibel level calculations
It uses the pyoctaveband package for accurate time and frequency weighting filters.
Reference
IEC 61672-1:2013: http://webstore.iec.ch/webstore/webstore.nsf/artnum/048669 pyoctaveband package: https://pypi.org/project/pyoctaveband/
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.
Functions
time_averaged_level
time_averaged_level(
signal: NDArray[float64],
sample_frequency: float,
integration_time: float,
reference: float = REFERENCE_PRESSURE,
) -> Tuple[NDArray[float64], NDArray[float64]]
Calculate time-averaged level.
| PARAMETER | DESCRIPTION |
|---|---|
signal
|
Dynamic pressure. |
sample_frequency
|
Sample frequency in Hz.
TYPE:
|
integration_time
|
Integration time in seconds.
TYPE:
|
reference
|
Reference for decibels. Defaults to REFERENCE_PRESSURE.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Tuple[NDArray[float64], NDArray[float64]]
|
Tuple containing: - Time points in seconds - Time-averaged levels in dB |
Source code in acoustic_toolbox/standards/iec_61672_1_2013.py
time_weighted_level
time_weighted_level(
signal: NDArray[float64],
sample_frequency: float,
time_mode: str,
integration_time: float = None,
reference: float = REFERENCE_PRESSURE,
) -> Tuple[NDArray[float64], NDArray[float64]]
Calculate time-weighted levels at a given integration timestep.
| PARAMETER | DESCRIPTION |
|---|---|
signal
|
raw signal (can be multi-dimensional). |
sample_frequency
|
Sample frequency in Hz.
TYPE:
|
time_mode
|
Time weighting mode, either "fast" or "slow"
TYPE:
|
integration_time
|
timestep in seconds. defaults to 125ms for "fast" mode and 1s for "slow" mode.
TYPE:
|
reference
|
Reference for decibels. Defaults to REFERENCE_PRESSURE.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Tuple[NDArray[float64], NDArray[float64]]
|
Tuple containing: - Time points in seconds - Time-weighted levels in dB |
Source code in acoustic_toolbox/standards/iec_61672_1_2013.py
frequency_weighting
frequency_weighting(
signal: NDArray[float64],
sample_frequency: float,
weighting: str = "A",
zero_phase: bool = False,
) -> NDArray[float64]
Apply frequency weighting to a signal.
| PARAMETER | DESCRIPTION |
|---|---|
signal
|
Input signal (raw pressure/voltage). |
sample_frequency
|
Sample rate.
TYPE:
|
weighting
|
'A', 'C' or 'Z'.
TYPE:
|
zero_phase
|
Prevent phase shift. If True, processing is done in the frequency domain (FFT) to ensure zero phase shift while preserving the exact IEC 61672-1 magnitude response. (Note: Standard forward-backward filtering would square the magnitude response).
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
NDArray[float64]
|
Frequency-weighted signal. |
Source code in acoustic_toolbox/standards/iec_61672_1_2013.py
:::