ISO 1996-2:2007
ISO 1996-2:2007
ISO 1996-2:2007 describes how sound pressure levels can be determined by direct measurement, by extrapolation of measurement results by means of calculation, or exclusively by calculation, intended as a basis for assessing environmental noise.
Reference
ISO 1996-2:2007: Description, measurement and assessment of environmental noise
Attributes
TONE_WITHIN_PAUSE_CRITERION_DB
module-attribute
A tone may exist when the level of any line in the noise pause is 6 dB or more about....
TONE_BANDWIDTH_CRITERION_DB
module-attribute
Bandwidth of the detected peak.
TONE_LINES_CRITERION_DB
module-attribute
All lines with levels within 6 dB of the maximum level are classified as tones.
REGRESSION_RANGE_FACTOR
module-attribute
Range of regression is usually ± 0.75 critical bandwidth.
Classes
Tonality
Tonality(
signal,
sample_frequency,
window="hann",
reference_pressure=REFERENCE_PRESSURE,
tsc=TONE_SEEK_CRITERION,
regression_range_factor=REGRESSION_RANGE_FACTOR,
nbins=None,
force_tone_without_pause=False,
force_bandwidth_criterion=False,
)
Perform assessment of audibility of tones in noise.
Objective method for assessing the audibility of tones in noise.
| PARAMETER | DESCRIPTION |
|---|---|
signal
|
Time-domain signal samples.
|
sample_frequency
|
Sample frequency in Hz.
|
window
|
Window type for spectral analysis. Defaults to 'hann'.
DEFAULT:
|
reference_pressure
|
Reference pressure. Defaults to REFERENCE_PRESSURE.
DEFAULT:
|
tsc
|
Tone seeking criterion in dB. Defaults to TONE_SEEK_CRITERION.
DEFAULT:
|
regression_range_factor
|
Regression range factor. Defaults to REGRESSION_RANGE_FACTOR.
DEFAULT:
|
nbins
|
Number of frequency bins for FFT. Defaults to sample_frequency.
DEFAULT:
|
force_tone_without_pause
|
Force tone detection without noise pause. Defaults to False.
DEFAULT:
|
force_bandwidth_criterion
|
Force bandwidth criterion. Defaults to False.
DEFAULT:
|
Source code in acoustic_toolbox/standards/iso_1996_2_2007.py
Attributes
reference_pressure
instance-attribute
Reference sound pressure.
regression_range_factor
instance-attribute
Regression range factor.
nbins
instance-attribute
Amount of frequency nbins to use. See attribute nperseg of :func:scipy.signal.welch.
noise_pauses
property
Get determined noise pauses.
| YIELDS | DESCRIPTION |
|---|---|
NoisePause
|
Each noise pause found in the signal. |
critical_bands
property
Get critical bands.
A critical band is determined for each detected tone.
| YIELDS | DESCRIPTION |
|---|---|
CriticalBand
|
Each critical band around detected tones. |
spectrum
property
Get power spectrum of the input signal.
| RETURNS | DESCRIPTION |
|---|---|
|
pandas.Series: Power spectrum in dB re reference_pressure. |
frequency_resolution
property
Frequency resolution.
| RETURNS | DESCRIPTION |
|---|---|
float
|
Frequency resolution Δf in Hz. |
effective_analysis_bandwidth
property
Effective analysis bandwidth.
In the case of the Hanning window $$ B_{eff} = 1.5 \Delta f $$
with \(\Delta f\) the frequency_resolution.
| RETURNS | DESCRIPTION |
|---|---|
float
|
Effective analysis bandwidth in Hz. |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If window type is not supported. |
Note
See section C.2.2 Note 1 of the standard.
dominant_tone
property
Get most dominant tone.
The most dominant tone is the one with highest tonal audibility \(L_{ta}\).
| RETURNS | DESCRIPTION |
|---|---|
Tone
|
Most dominant tone, or None if no tones found. |
Functions
determine_noise_pauses
Find noise pauses in the spectrum.
Uses noise_pause_seeker to find potential noise pauses.
| PARAMETER | DESCRIPTION |
|---|---|
end
|
Optional end index to limit search range.
DEFAULT:
|
| RETURNS | DESCRIPTION |
|---|---|
self
|
For method chaining. |
Source code in acoustic_toolbox/standards/iso_1996_2_2007.py
analyse
Analyse the noise pauses for tones and put critical bands around each of these tones.
The tones are available via tones and the critical bands via critical_bands.
Per frequency line results are available via line_classifier.
| RETURNS | DESCRIPTION |
|---|---|
self
|
For method chaining. |
Source code in acoustic_toolbox/standards/iso_1996_2_2007.py
critical_band_at
Put at a critical band at frequency.
In order to use this function line_classifier needs to be available,
which means analyse needs to be used first.
| PARAMETER | DESCRIPTION |
|---|---|
frequency
|
Center frequency in Hz.
|
| RETURNS | DESCRIPTION |
|---|---|
CriticalBand
|
Critical band object. |
Note
Requires line_classifier to be available (call analyse first).
Source code in acoustic_toolbox/standards/iso_1996_2_2007.py
plot_spectrum
Plot power spectrum.
| RETURNS | DESCRIPTION |
|---|---|
|
matplotlib.figure.Figure: Figure with spectrum plot. |
Source code in acoustic_toolbox/standards/iso_1996_2_2007.py
plot_results
Plot analysis results.
| PARAMETER | DESCRIPTION |
|---|---|
noise_pauses
|
Whether to show noise pauses. Defaults to False.
DEFAULT:
|
tones
|
Whether to show tones. Defaults to True.
DEFAULT:
|
critical_bands
|
Whether to show critical bands. Defaults to True.
DEFAULT:
|
| RETURNS | DESCRIPTION |
|---|---|
|
matplotlib.figure.Figure: Figure with results plot. |
Source code in acoustic_toolbox/standards/iso_1996_2_2007.py
overview
Print overview of analysis results.
| RETURNS | DESCRIPTION |
|---|---|
str
|
Tabulated overview of results. |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If no tones have been determined yet. |
Source code in acoustic_toolbox/standards/iso_1996_2_2007.py
results_as_dataframe
Get analysis results as pandas DataFrame.
| RETURNS | DESCRIPTION |
|---|---|
|
pandas.DataFrame: DataFrame containing results for each tone. |
Source code in acoustic_toolbox/standards/iso_1996_2_2007.py
NoisePause
Container for noise pause information.
A noise pause is a section of the spectrum that may contain a tone.
| PARAMETER | DESCRIPTION |
|---|---|
start
|
Start index of noise pause.
|
end
|
End index of noise pause.
|
tone
|
Optional Tone object if a tone is found in this pause.
DEFAULT:
|
Source code in acoustic_toolbox/standards/iso_1996_2_2007.py
Tone
Container for tone information.
| PARAMETER | DESCRIPTION |
|---|---|
center
|
Center frequency in Hz.
|
tone_lines
|
Indices of spectral lines belonging to tone.
|
tone_level
|
Total level of tone in dB.
|
noise_pause
|
Parent NoisePause object.
|
bandwidth_3db
|
-3 dB bandwidth in Hz.
|
critical_band
|
Optional CriticalBand object.
DEFAULT:
|
Source code in acoustic_toolbox/standards/iso_1996_2_2007.py
CriticalBand
CriticalBand(
center,
start,
end,
bandwidth,
regression_range_factor,
regression_slope,
regression_intercept,
noise_level,
tone_level,
audibility,
adjustment,
tone=None,
)
Container for critical band information.
A critical band is a frequency band around a tone used for masking analysis.
| PARAMETER | DESCRIPTION |
|---|---|
center
|
Center frequency in Hz.
|
start
|
Lower band-edge frequency in Hz.
|
end
|
Upper band-edge frequency in Hz.
|
bandwidth
|
Bandwidth in Hz.
|
regression_range_factor
|
Factor for regression range.
|
regression_slope
|
Slope from linear regression.
|
regression_intercept
|
Intercept from linear regression.
|
noise_level
|
Masking noise level in dB.
|
tone_level
|
Total tone level in dB.
|
audibility
|
Tonal audibility in dB.
|
adjustment
|
Tonal adjustment in dB.
|
tone
|
Optional Tone object.
DEFAULT:
|
Source code in acoustic_toolbox/standards/iso_1996_2_2007.py
Attributes
regression_range_factor
instance-attribute
Range of regression factor. See also :attr:REGRESSION_RANGE_FACTOR.
regression_intercept
instance-attribute
Linear regression intercept.
masking_noise_level
instance-attribute
Masking noise level \(L_{pn}\).
Functions
window_correction
Get correction factor to be applied to \(L_{pt}\) due to window type.
| PARAMETER | DESCRIPTION |
|---|---|
window
|
Window type (e.g., 'hann').
|
| RETURNS | DESCRIPTION |
|---|---|
float
|
Correction factor in dB. |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
If window correction is not available for specified window. |
See Also
Tonality: Class that uses window correction in tonal analysis
Source code in acoustic_toolbox/standards/iso_1996_2_2007.py
critical_band
Bandwidth of critical band of frequency.
| PARAMETER | DESCRIPTION |
|---|---|
frequency
|
Center frequency of tone in Hz.
|
| RETURNS | DESCRIPTION |
|---|---|
tuple
|
A tuple containing: - float: Center frequency (minimum 50 Hz) - float: Lower band-edge frequency - float: Upper band-edge frequency - float: Bandwidth (100 Hz below 500 Hz, 20% of center frequency above) |
See Also
tonal_audibility: Function that uses critical band parameters
Source code in acoustic_toolbox/standards/iso_1996_2_2007.py
tones_level
Total sound pressure level of the tones in a critical band given the level of each of the tones.
| RETURNS | DESCRIPTION |
|---|---|
float
|
Total sound pressure level Lpt calculated as: $$ L_{pt} = 10 \log_{10}{\sum 10^{L_{pti}/10}} $$ |
Note
Implementation of equation C.1 from section C.2.3.1 of the standard.
See Also
masking_noise_level: Function to calculate masking noise level
Source code in acoustic_toolbox/standards/iso_1996_2_2007.py
masking_noise_level
Masking noise level \(L_{pn}\).
| PARAMETER | DESCRIPTION |
|---|---|
noise_lines
|
Array of masking noise lines Ln in dB.
|
frequency_resolution
|
Frequency resolution Δf in Hz.
|
effective_analysis_bandwidth
|
Effective analysis bandwidth B in Hz.
|
| RETURNS | DESCRIPTION |
|---|---|
float
|
Masking noise level calculated as: $$ L_{pn} = 10 \log_{10}{\sum 10^{L_n/10}} + 10 \log_{10}{\frac{\Delta f}{B}} $$ |
Note
Implementation of equation C.11 from section C.4.4 of the standard.
See Also
tones_level: Function to calculate total sound pressure level of tones
Source code in acoustic_toolbox/standards/iso_1996_2_2007.py
masking_noise_lines
masking_noise_lines(
levels: Series,
line_classifier,
center: float,
bandwidth: float,
regression_range_factor,
) -> tuple[ndarray, float, float]
Determine masking noise level lines using regression line. Returns array of \(L_n\).
| PARAMETER | DESCRIPTION |
|---|---|
levels
|
Levels as function of frequency
TYPE:
|
line_classifier
|
Categorical indicating line types.
|
center
|
Center frequency in Hz.
TYPE:
|
bandwidth
|
Critical band bandwidth in Hz.
TYPE:
|
regression_range_factor
|
Range factor for regression analysis.
|
| RETURNS | DESCRIPTION |
|---|---|
ndarray
|
Array of masking noise lines Ln |
float
|
Regression slope |
float
|
Regression intercept |
Source code in acoustic_toolbox/standards/iso_1996_2_2007.py
tonal_audibility
tonal_audibility(
tones_level, masking_noise_level, center
) -> float
Tonal audibility.
| PARAMETER | DESCRIPTION |
|---|---|
tones_level
|
Total sound pressure level of tones in critical band Lpt.
|
masking_noise_level
|
Total sound pressure level of masking noise Lpn.
|
center
|
Center frequency of critical band fc.
|
| RETURNS | DESCRIPTION |
|---|---|
float
|
Tonal audibility ΔLta calculated as: $$ \Delta L_{ta} = L_{pt} - L_{pn} + 2 + \log_{10}{1 + \left(\frac{f_c}{502}\right)^{2.5}} $$ |
Note
Implementation of equation C.3 from section C.2.4 of the standard.
See Also
critical_band: Function to calculate critical band parameters tonal_adjustment: Function to calculate tonal adjustment
Source code in acoustic_toolbox/standards/iso_1996_2_2007.py
tonal_adjustment
Calculate tonal adjustment Kt.
| PARAMETER | DESCRIPTION |
|---|---|
tonal_audibility
|
Tonal audibility \(L_{ta}\) in dB.
|
| RETURNS | DESCRIPTION |
|---|---|
float
|
Adjustment Kt in dB: - 6.0 dB if ΔLta > 10 dB - 0.0 dB if ΔLta < 4 dB - ΔLta - 4 dB otherwise |
Note
Implementation of equations C.4-C.6 from section C.2.4 of the standard.
See Also
tonal_audibility: Function to calculate tonal audibility
Source code in acoustic_toolbox/standards/iso_1996_2_2007.py
create_tone
Create an instance of Tone.
Source code in acoustic_toolbox/standards/iso_1996_2_2007.py
create_critical_band
create_critical_band(
levels,
line_classifier,
frequency,
frequency_resolution,
effective_analysis_bandwidth,
regression_range_factor,
window,
tone=None,
)
Create an instance of CriticalBand.
Source code in acoustic_toolbox/standards/iso_1996_2_2007.py
noise_pause_seeker
Given the levels of a spectrum and a tone seeking criterium this top level function seeks possible noise pauses.
| PARAMETER | DESCRIPTION |
|---|---|
levels
|
Spectral levels in dB.
|
tsc
|
Tone seeking criterion in dB.
|
| RETURNS | DESCRIPTION |
|---|---|
list
|
List of tuples containing (start_index, end_index) for each noise pause, sorted and filtered to avoid overlapping intervals. |
Note: Possible start and end indices of noise pauses are determined using `possible_noise_pauses.
Then, only those that correspond to the smallest intervals that do not overlap other intervals are kept.
Source code in acoustic_toolbox/standards/iso_1996_2_2007.py
determine_tone_lines
determine_tone_lines(
levels,
df,
start,
end,
force_tone_without_pause=False,
force_bandwidth_criterion=False,
)
Determine tone lines in a noise pause.
| PARAMETER | DESCRIPTION |
|---|---|
levels
|
Series with levels as function of frequency.
|
df
|
Frequency resolution in Hz.
|
start
|
Index of noise pause start.
|
end
|
Index of noise pause end.
|
force_tone_without_pause
|
Force tone detection without pause. Defaults to False.
DEFAULT:
|
force_bandwidth_criterion
|
Force bandwidth criterion. Defaults to False.
DEFAULT:
|
| RETURNS | DESCRIPTION |
|---|---|
tuple
|
A tuple containing: - ndarray: Indices of tone lines - float: -3 dB bandwidth in Hz |
Source code in acoustic_toolbox/standards/iso_1996_2_2007.py
950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 | |
:::