Standards

The standards module provides implementations of standards.

ISO/TR 25417 2007

ISO/TR 25417:2007 specifies definitions of acoustical quantities and terms used in noise measurement documents prepared by ISO Technical Committee TC 43, Acoustics, Subcommittee SC 1, Noise, together with their symbols and units, with the principal aim of harmonizing the terminology used [ISO25417].

[ISO24517]http://www.iso.org/iso/home/store/catalogue_tc/catalogue_detail.htm?csnumber=42915
acoustics.standards.iso_tr_25417_2007.REFERENCE_ENERGY = 1e-12

Reference value of the sound energy \(J_0\) is 1 pJ.

acoustics.standards.iso_tr_25417_2007.REFERENCE_INTENSITY = 1e-12

Reference value of the sound intensity \(I_0\) is \(\mathrm{1 pW/m^2}\).

acoustics.standards.iso_tr_25417_2007.REFERENCE_POWER = 1e-12

Reference value of the sound power \(P_0\) is 1 pW.

acoustics.standards.iso_tr_25417_2007.REFERENCE_PRESSURE = 2e-05

Reference value of the sound pressure \(p_0\) is \(2 \cdot 10^{-5}\) Pa.

acoustics.standards.iso_tr_25417_2007.REFERENCE_SOUND_EXPOSURE = 4e-10

Reference value of the sound exposure \(E_0\) is \(4 \cdot 10^{-12} \mathrm{Pa}^2\mathrm{s}\).

acoustics.standards.iso_tr_25417_2007.equivalent_sound_pressure_level(pressure, reference_pressure=2e-05, axis=-1)[source]

Time-averaged sound pressure level \(L_{p,T}\) or equivalent-continious sound pressure level \(L_{p,eqT}\) in dB.

Parameters:
  • pressure – Instantaneous sound pressure \(p\).
  • reference_pressure – Reference value \(p_0\).
  • axis – Axis.
\[L_{p,T} = L_{p,eqT} = 10.0 \log_{10}{ \left( \frac{\frac{1}{T} \int_{t_1}^{t_2} p^2 (t) \mathrm{d} t }{p_0^2} \right)}\]

See section 2.3.

acoustics.standards.iso_tr_25417_2007.max_sound_pressure_level(pressure, reference_pressure=2e-05, axis=-1)[source]

Maximum time-averaged sound pressure level \(L_{F,max}\) in dB.

Parameters:
  • pressure – Instantaneous sound pressure \(p\).
  • reference_pressure – Reference value \(p_0\).
  • axis – Axis.
\[\mathrm{max}{(L_{p})}\]
acoustics.standards.iso_tr_25417_2007.normal_time_averaged_sound_intensity(time_averaged_sound_intensity, unit_normal_vector)[source]

Normal time-averaged sound intensity \(I_{n,T}\).

Parameters:
  • time_averaged_sound_intensity – Time-averaged sound intensity \(\mathbf{I}_T\).
  • unit_normal_vector – Unit normal vector \(\mathbf{n}\).
\[I_{n,T} = \mathbf{I}_T \cdot \mathbf{n}\]
acoustics.standards.iso_tr_25417_2007.normal_time_averaged_sound_intensity_level(normal_time_averaged_sound_intensity, reference_intensity=1e-12)[source]

Normal time-averaged sound intensity level \(L_{In,T}\) in dB.

Parameters:
  • normal_time_averaged_sound_intensity – Normal time-averaged sound intensity \(I{n,T}\).
  • reference_intensity – Reference sound intensity \(I_0\).
\[I_{n,T} = 10 \log_{10} { \frac{|I_{n,T}|}{I_0}}\]
acoustics.standards.iso_tr_25417_2007.peak_sound_pressure(pressure, axis=-1)[source]

Peak sound pressure \(p_{peak}\) is the greatest absolute sound pressure during a certain time interval.

Parameters:
  • pressure – Instantaneous sound pressure \(p\).
  • axis – Axis.
\[p_{peak} = \mathrm{max}(|p|)\]
acoustics.standards.iso_tr_25417_2007.peak_sound_pressure_level(pressure, reference_pressure=2e-05, axis=-1)[source]

Peak sound pressure level \(L_{p,peak}\) in dB.

Parameters:
  • pressure – Instantaneous sound pressure \(p\).
  • reference_pressure – Reference value \(p_0\).
  • axis – Axis.
\[L_{p,peak} = 10.0 \log \frac{p_{peak}^2.0}{p_0^2}\]
acoustics.standards.iso_tr_25417_2007.sound_energy(power, axis=-1)[source]

Sound energy \(J\)..

Parameters:power – Sound power \(P\).
\[J = \int_{t_1}^{t_2} P(t) \mathrm{d} t\]
acoustics.standards.iso_tr_25417_2007.sound_energy_level(energy, reference_energy=1e-12)[source]

Sound energy level L_{J} in dB.

Parameters:
  • energy – Sound energy \(J\).
  • reference_energy – Reference sound energy \(J_0\).
\[L_{J} = 10 \log_{10}{ \frac{J}{J_0} }\]
acoustics.standards.iso_tr_25417_2007.sound_exposure(pressure, fs, axis=-1)[source]

Sound exposure \(E_{T}\).

Parameters:
  • pressure – Instantaneous sound pressure \(p\).
  • fs – Sample frequency \(f_s\).
  • axis – Axis.
\[E_T = \int_{t_1}^{t_2} p^2 (t) \mathrm{d}t\]
acoustics.standards.iso_tr_25417_2007.sound_exposure_level(pressure, fs, reference_sound_exposure=4e-10, axis=-1)[source]

Sound exposure level \(L_{E,T}\) in dB.

Parameters:
  • pressure – Instantaneous sound pressure \(p\).
  • fs – Sample frequency \(f_s\).
  • sound_exposure – Sound exposure \(E_{T}\).
  • reference_sound_exposure – Reference value \(E_{0}\)
\[L_{E,T} = 10 \log_{10}{ \frac{E_T}{E_0} }\]
acoustics.standards.iso_tr_25417_2007.sound_intensity(pressure, velocity)[source]

Sound intensity \(\mathbf{i}\).

Parameters:
  • pressure – Sound pressure \(p(t)\).
  • velocity – Particle velocity \(\mathbf{u}(t)\).
\[\mathbf{i} = p(t) \cdot \mathbf{u}(t)\]
acoustics.standards.iso_tr_25417_2007.sound_power_level(power, reference_power=1e-12)[source]

Sound power level \(L_{W}\).

Parameters:
  • power – Sound power \(P\).
  • reference_power – Reference sound power \(P_0\).
\[10 \log_{10}{ \frac{P}{P_0} }\]
acoustics.standards.iso_tr_25417_2007.sound_pressure_level(pressure, reference_pressure=2e-05)[source]

Sound pressure level \(L_p\) in dB.

Parameters:
  • pressure – Instantaneous sound pressure \(p\).
  • reference_pressure – Reference value \(p_0\).
\[L_p = 10 \log_{10}{ \left( \frac{p^2}{p_0^2} \right)}\]

See section 2.2.

acoustics.standards.iso_tr_25417_2007.time_averaged_sound_intensity(intensity, axis=-1)[source]

Time-averaged sound intensity \(\mathbf{I}_T\).

Parameters:
  • intensity – Sound intensity \(\mathbf{i}\).
  • axis – Axis.
\[\mathbf{I}_T = \frac{1}{T} \int_{t_1}^{t_2} \mathbf{i}(t)\]
acoustics.standards.iso_tr_25417_2007.time_averaged_sound_intensity_level(time_averaged_sound_intensity, reference_intensity=1e-12, axis=-1)[source]

Time-averaged sound intensity level \(L_{I,T}\).

Parameters:
  • time_averaged_sound_intensity – Time-averaged sound intensity \(\mathbf{I}_T\).
  • reference_intensity – Reference sound intensity \(I_0\).
\[L_{I,T} = 10 \log_{10} { \frac{|\mathbf{I}_T|}{I_0} }\]

ISO 9613-1:1993

ISO 9613-1:1993 specifies an analytical method of calculating the attenuation of sound as a result of atmospheric absorption for a variety of meteorological conditions.

acoustics.standards.iso_9613_1_1993.REFERENCE_PRESSURE = 101.325

International Standard Atmosphere in kilopascal.

acoustics.standards.iso_9613_1_1993.REFERENCE_TEMPERATURE = 293.15

Reference temperature.

acoustics.standards.iso_9613_1_1993.SOUNDSPEED = 343.2

Speed of sound.

acoustics.standards.iso_9613_1_1993.TRIPLE_TEMPERATURE = 273.16

. Triple point isotherm temperature.

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.
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.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.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)\]

ISO 1996-1:2003

ISO 1996-1:2003 defines the basic quantities to be used for the description of noise in community environments and describes basic assessment procedures. It also specifies methods to assess environmental noise and gives guidance on predicting the potential annoyance response of a community to long-term exposure from various types of environmental noises. The sound sources can be separate or in various combinations. Application of the method to predict annoyance response is limited to areas where people reside and to related long-term land uses.

acoustics.standards.iso_1996_1_2003.composite_rating_level(levels, hours, adjustment)[source]

Composite rating level.

Params levels:Level per period.
Params hours:Amount of hours per period.
Params adjustment:
 Adjustment per period.

Composite whole-day rating levels are calculated as

\[L_R = 10 \log{\left[ \sum_i \frac{d_i}{24} 10^{(L_i+K_i)/10} \right]}\]

where \(i\) is a period. See equation 6 and 7 of the standard.

Note

Summation is done over the last axis.

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.

acoustics.standards.iso_1996_2_2007.REGRESSION_RANGE_FACTOR = 0.75

Range of regression is usually +/- 0.75 critical bandwidth.

acoustics.standards.iso_1996_2_2007.TONE_BANDWIDTH_CRITERION_DB = 3.0

Bandwidth of the detected peak.

acoustics.standards.iso_1996_2_2007.TONE_LINES_CRITERION_DB = 6.0

All lines with levels within 6 dB of the maximum level are classified as tones.

acoustics.standards.iso_1996_2_2007.TONE_SEEK_CRITERION = 1.0

Tone seek criterion.

acoustics.standards.iso_1996_2_2007.TONE_WITHIN_PAUSE_CRITERION_DB = 6.0

A tone may exist when the level of any line in the noise pause is 6 dB or more about….

class acoustics.standards.iso_1996_2_2007.Tonality(signal, sample_frequency, window='hanning', reference_pressure=2e-05, tsc=1.0, regression_range_factor=0.75, nbins=None, force_tone_without_pause=False, force_bandwidth_criterion=False)[source]

Perform assessment of audibility of tones in noise.

Objective method for assessing the audibility of tones in noise.

__init__(signal, sample_frequency, window='hanning', reference_pressure=2e-05, tsc=1.0, regression_range_factor=0.75, nbins=None, force_tone_without_pause=False, force_bandwidth_criterion=False)[source]

Initialize self. See help(type(self)) for accurate signature.

analyse()[source]

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.

critical_band_at(frequency)[source]

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.

critical_bands

Critical bands that were determined. A critical band is determined for each tone.

determine_noise_pauses(end=None)[source]

Determine noise pauses. The determined noise pauses are available in noise_pause_ranges.

Noise pauses are search for using noise_pause_seeker().

dominant_tone

Most dominant_tone tone.

The most dominant_tone tone is the tone with the highest tonal audibility \(L_{ta}\).

effective_analysis_bandwidth

Effective analysis bandwidth.

In the case of the Hanning window

\[B_{eff} = 1.5 \Delta f\]

with Delta f the frequency_resolution.

C.2.2: Note 1.

frequency_resolution

Frequency resolution.

nbins = None

Amount of frequency nbins to use. See attribute nperseg of scipy.signal.welch().

noise_pauses

Noise pauses that were determined.

overview()[source]

Print overview of results.

plot_results(noise_pauses=False, tones=True, critical_bands=True)[source]

Plot overview of results.

plot_spectrum()[source]

Plot power spectrum.

reference_pressure = None

Reference sound pressure.

regression_range_factor = None

Regression range factor.

results_as_dataframe()[source]

Return results in dataframe.

sample_frequency = None

Sample frequency.

signal = None

Samples in time-domain.

spectrum

Power spectrum of the input signal.

tones

Tones that were determined.

tsc = None

Tone seeking criterium.

window = None

Window to be used.

class acoustics.standards.iso_1996_2_2007.Tone(center, tone_lines, tone_level, noise_pause, bandwidth_3db, critical_band=None)[source]

Tone.

__init__(center, tone_lines, tone_level, noise_pause, bandwidth_3db, critical_band=None)[source]

Initialize self. See help(type(self)) for accurate signature.

acoustics.standards.iso_1996_2_2007.create_critical_band(levels, line_classifier, frequency, frequency_resolution, effective_analysis_bandwidth, regression_range_factor, window, tone=None)[source]

Create an instance of CriticalBand.

acoustics.standards.iso_1996_2_2007.create_tone(levels, tone_lines, bandwidth_for_tone_criterion, noise_pause)[source]

Create an instance of Tone.

acoustics.standards.iso_1996_2_2007.critical_band(frequency)[source]

Bandwidth of critical band of frequency.

Parameters:frequency – Center frequency of tone.
Returns:(bandwidth, center, lower, upper) of band.
acoustics.standards.iso_1996_2_2007.determine_tone_lines(levels, df, start, end, force_tone_without_pause=False, force_bandwidth_criterion=False)[source]

Determine tone lines in noise pause.

Parameters:
  • levels – Series with levels as function of frequency.
  • df – Frequency resolution.
  • start – Index of noise pause start.
  • end – Index of noise pause end.
Returns:

Array with indices of tone lines in noise pause.

acoustics.standards.iso_1996_2_2007.masking_noise_level(noise_lines, frequency_resolution, effective_analysis_bandwidth)[source]

Masking noise level \(L_{pn}\)

param noise_lines:
 Masking noise lines. See masking_noise_lines().
param frequency_resolution:
 Frequency resolution \(\Delta f\).
param effective_analysis_bandwidth:
 Effective analysis bandwidth \(B\).
\[L_{pn} = 10 \log_{10}{\sum 10^{L_n/10}} + 10 \log_{10}{\]

rac{Delta f}{B}}

See equation C.11 in section C.4.4.
acoustics.standards.iso_1996_2_2007.masking_noise_lines(levels, line_classifier, center, bandwidth, regression_range_factor)[source]

Determine masking noise level lines using regression line. Returns array of \(L_n\).

Parameters:
  • levels (pd.Series.) – Levels as function of frequency.
  • lines_classifier – Categorical indicating what each line is.
  • center – Center frequency.
  • bandwidth – bandwidth of critical band.
  • regression_range_factor – Range factor.
Returns:

(Array with masking noise lines, slope, intercept).

acoustics.standards.iso_1996_2_2007.noise_pause_seeker(levels, tsc)[source]

Given the levels of a spectrum and a tone seeking criterium this top level function seeks possible noise pauses.

Parameters:
  • levels – Spectral levels.
  • df – Frequency resolution.
  • tsc – Tone seeking criterium.

Possible start and end indices of noise pauses are determined using :func:`possible_noise_pauses. Then, only those that correspond to the smallest intervals that do not overlap other intervals are kept.

acoustics.standards.iso_1996_2_2007.tonal_adjustment(tonal_audibility)[source]

Adjustment \(K\).

Parameters:tonal_audibility – Tonal audibility \(L_{ta}\).

See equations C.4, C.5 and C.6 in section C.2.4.

acoustics.standards.iso_1996_2_2007.tonal_audibility(tones_level, masking_noise_level, center)[source]

Tonal audibility.

param tones_level:
 Total sound pressure level of the tones in the critical band :math:`L_{pt}.
param masking_noise_level:
 Total sound pressure level of the masking noise in the critical band :math:`L_{pn}.
param center:Center frequency of the critical band \(f_c\).
returns:Tonal audibility \(\Delta L_{ta}\)
\[\Delta L_{ta} = L_{pt} - L_{pn} + 2 + \log_{10}{1 + \left(\]

rac{f_c}{502} ight)^{2.5}}

See equation C.3. in section C.2.4.
acoustics.standards.iso_1996_2_2007.tones_level(tone_levels)[source]

Total sound pressure level of the tones in a critical band given the level of each of the tones.

See equation C.1 in section C.2.3.1.

acoustics.standards.iso_1996_2_2007.window_correction(window)[source]

Correction to be applied to \(L_{pt}\) due to use of window.

IEC 61672-1:2013

IEC 61672-1:2013 gives electroacoustical performance specifications for three kinds of sound measuring instruments [IEC61672]:

  • 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; and
  • integrating sound level meters that measure frequency-weighted sound exposure levels.
[IEC61672]http://webstore.iec.ch/webstore/webstore.nsf/artnum/048669!opendocument

Weighting functions

acoustics.standards.iec_61672_1_2013.weighting_function_a(frequencies)[source]

A-weighting function in decibel.

Parameters:frequencies – Vector of frequencies at which to evaluate the weighting.
Returns:Vector with scaling factors.

The weighting curve is

\[20 \log_{10}{\frac{(f_4^2 * f^4)}{(f^2 + f_1^2) \sqrt{(f^2 + f_2^2)(f^2 + f_3^2)}(f^2 + f_4^2)}} - A_{1000}\]

with \(A_{1000} = -2\) dB.

See equation E.6 of the standard.

acoustics.standards.iec_61672_1_2013.weighting_function_c(frequencies)[source]

C-weighting function in decibel.

Parameters:frequencies – Vector of frequencies at which to evaluate the weighting.
Returns:Vector with scaling factors.

The weighting curve is

\[20 \log_{10}{\frac{(f_4^2 f^2)}{(f^2+f_1^2)(f^2+f_4^2)}} - C_{1000}\]

with \(C_{1000} = -0.062\) dB

See equation E.1 of the standard.

acoustics.standards.iec_61672_1_2013.weighting_function_z(frequencies)[source]

Z-weighting function in decibel.

Parameters:frequencies – Vector of frequencies at which to evaluate the weighting.
Returns:Vector with scaling factors.

Weighting systems

acoustics.standards.iec_61672_1_2013.weighting_system_a()[source]

A-weighting filter represented as polynomial transfer function.

Returns:Tuple of num and den.

See equation E.6 of the standard.

acoustics.standards.iec_61672_1_2013.weighting_system_c()[source]

C-weighting filter represented as polynomial transfer function.

Returns:Tuple of num and den.

See equation E.1 of the standard.

acoustics.standards.iec_61672_1_2013.weighting_system_z()[source]

Z-weighting filter represented as polynomial transfer function.

Returns:Tuple of num and den.

Z-weighting is 0.0 dB for all frequencies and therefore corresponds to a multiplication of 1.

acoustics.standards.iec_61672_1_2013.EXACT_THIRD_OCTAVE_CENTER_FREQUENCIES = array([ 630.95734448, 645.65422903, 660.69344801, 676.08297539, 691.83097092, 707.94578438, 724.43596007, 741.3102413 , 758.57757503, 776.24711663, 794.32823472, 812.83051616, 831.7637711 , 851.1380382 , 870.96358996, 891.25093813, 912.01083936, 933.2543008 , 954.99258602, 977.23722096, 1000. , 1023.29299228, 1047.12854805, 1071.51930524, 1096.47819614, 1122.0184543 , 1148.1536215 , 1174.89755494, 1202.26443462, 1230.26877081, 1258.92541179, 1288.24955169, 1318.25673856, 1348.96288259])

Exact third-octave center frequencies. See table 3.

acoustics.standards.iec_61672_1_2013.FAST = 0.125

FAST time-constant.

acoustics.standards.iec_61672_1_2013.NOMINAL_OCTAVE_CENTER_FREQUENCIES = array([ 16. , 31.5, 63. , 125. , 250. , 500. , 1000. , 2000. , 4000. , 8000. , 16000. ])

Nominal 1/1-octave frequencies. Based on table 3.

acoustics.standards.iec_61672_1_2013.NOMINAL_THIRD_OCTAVE_CENTER_FREQUENCIES = array([1.00e+01, 1.25e+01, 1.60e+01, 2.00e+01, 2.50e+01, 3.15e+01, 4.00e+01, 5.00e+01, 6.30e+01, 8.00e+01, 1.00e+02, 1.25e+02, 1.60e+02, 2.00e+02, 2.50e+02, 3.15e+02, 4.00e+02, 5.00e+02, 6.30e+02, 8.00e+02, 1.00e+03, 1.25e+03, 1.60e+03, 2.00e+03, 2.50e+03, 3.15e+03, 4.00e+03, 5.00e+03, 6.30e+03, 8.00e+03, 1.00e+04, 1.25e+04, 1.60e+04, 2.00e+04])

Nominal 1/3-octave frequencies. See table 3.

acoustics.standards.iec_61672_1_2013.REFERENCE_FREQUENCY = 1000.0

Reference frequency. See table 3.

acoustics.standards.iec_61672_1_2013.SLOW = 1.0

SLOW time-constant.

acoustics.standards.iec_61672_1_2013.WEIGHTING_A = array([-70.4, -63.4, -56.7, -50.5, -44.7, -39.4, -34.6, -30.2, -26.2, -22.5, -19.1, -16.1, -13.4, -10.9, -8.6, -6.6, -4.8, -3.2, -1.9, -0.8, 0. , 0.6, 1. , 1.2, 1.3, 1.2, 1. , 0.5, -0.1, -1.1, -2.5, -4.3, -6.6, -9.3])

Frequency weighting A. See table 3.

acoustics.standards.iec_61672_1_2013.WEIGHTING_C = array([-14.3, -11.2, -8.5, -6.2, -4.4, -3. , -2. , -1.3, -0.8, -0.5, -0.3, -0.2, -0.1, 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , -0.1, -0.2, -0.3, -0.5, -0.8, -1.3, -2. , -3. , -4.4, -6.2, -8.5, -11.2])

Frequency weighting C. See table 3.

acoustics.standards.iec_61672_1_2013.WEIGHTING_DATA = nominal A C Z n -20 10.0 -70.4 -14.3 0 -19 12.5 -63.4 -11.2 0 -18 16.0 -56.7 -8.5 0 -17 20.0 -50.5 -6.2 0 -16 25.0 -44.7 -4.4 0 -15 31.5 -39.4 -3.0 0 -14 40.0 -34.6 -2.0 0 -13 50.0 -30.2 -1.3 0 -12 63.0 -26.2 -0.8 0 -11 80.0 -22.5 -0.5 0 -10 100.0 -19.1 -0.3 0 -9 125.0 -16.1 -0.2 0 -8 160.0 -13.4 -0.1 0 -7 200.0 -10.9 0.0 0 -6 250.0 -8.6 0.0 0 -5 315.0 -6.6 0.0 0 -4 400.0 -4.8 0.0 0 -3 500.0 -3.2 0.0 0 -2 630.0 -1.9 0.0 0 -1 800.0 -0.8 0.0 0 0 1000.0 0.0 0.0 0 1 1250.0 0.6 0.0 0 2 1600.0 1.0 -0.1 0 3 2000.0 1.2 -0.2 0 4 2500.0 1.3 -0.3 0 5 3150.0 1.2 -0.5 0 6 4000.0 1.0 -0.8 0 7 5000.0 0.5 -1.3 0 8 6300.0 -0.1 -2.0 0 9 8000.0 -1.1 -3.0 0 10 10000.0 -2.5 -4.4 0 11 12500.0 -4.3 -6.2 0 12 16000.0 -6.6 -8.5 0 13 20000.0 -9.3 -11.2 0

DataFrame with indices, nominal frequencies and weighting values.

acoustics.standards.iec_61672_1_2013.WEIGHTING_FUNCTIONS = {'A': <function weighting_function_a>, 'C': <function weighting_function_c>, 'Z': <function weighting_function_z>}

Dictionary with available weighting functions ‘A’, ‘C’ and ‘Z’.

acoustics.standards.iec_61672_1_2013.WEIGHTING_SYSTEMS = {'A': <function weighting_system_a>, 'C': <function weighting_system_c>, 'Z': <function weighting_system_z>}

Weighting systems.

acoustics.standards.iec_61672_1_2013.WEIGHTING_VALUES = {'A': array([-70.4, -63.4, -56.7, -50.5, -44.7, -39.4, -34.6, -30.2, -26.2, -22.5, -19.1, -16.1, -13.4, -10.9, -8.6, -6.6, -4.8, -3.2, -1.9, -0.8, 0. , 0.6, 1. , 1.2, 1.3, 1.2, 1. , 0.5, -0.1, -1.1, -2.5, -4.3, -6.6, -9.3]), 'C': array([-14.3, -11.2, -8.5, -6.2, -4.4, -3. , -2. , -1.3, -0.8, -0.5, -0.3, -0.2, -0.1, 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , 0. , -0.1, -0.2, -0.3, -0.5, -0.8, -1.3, -2. , -3. , -4.4, -6.2, -8.5, -11.2]), 'Z': array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])}

Dictionary with weighting values ‘A’, ‘C’ and ‘Z’ weighting.

acoustics.standards.iec_61672_1_2013.WEIGHTING_Z = array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])

Frequency weighting Z. See table 3.

acoustics.standards.iec_61672_1_2013.average(data, sample_frequency, averaging_time)[source]

Average the sound pressure squared.

Parameters:
  • data – Energetic quantity, e.g. \(p^2\).
  • sample_frequency – Sample frequency.
  • averaging_time – Averaging time.
Returns:

Time weighting is applied by applying a low-pass filter with one real pole at \(-1/\tau\).

Note

Because \(f_s \cdot t_i\) 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).

acoustics.standards.iec_61672_1_2013.fast(data, fs)[source]

Apply fast (F) time-weighting.

Parameters:
  • data – Energetic quantity, e.g. \(p^2\).
  • fs – Sample frequency.

See also

integrate()

acoustics.standards.iec_61672_1_2013.fast_level(data, fs)[source]

Time-weighted (FAST) sound pressure level.

Parameters:
  • data – Dynamic pressure.
  • fs – Sample frequency.
acoustics.standards.iec_61672_1_2013.integrate(data, sample_frequency, integration_time)[source]

Integrate the sound pressure squared using exponential integration.

Parameters:
  • data – Energetic quantity, e.g. \(p^2\).
  • sample_frequency – Sample frequency.
  • integration_time – Integration time.
Returns:

Time weighting is applied by applying a low-pass filter with one real pole at \(-1/\tau\).

Note

Because \(f_s \cdot t_i\) 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).

acoustics.standards.iec_61672_1_2013.slow(data, fs)[source]

Apply slow (S) time-weighting.

Parameters:
  • data – Energetic quantity, e.g. \(p^2\).
  • fs – Sample frequency.

See also

integrate()

acoustics.standards.iec_61672_1_2013.slow_level(data, fs)[source]

Time-weighted (SLOW) sound pressure level.

Parameters:
  • data – Dynamic pressure.
  • fs – Sample frequency.
acoustics.standards.iec_61672_1_2013.time_averaged_sound_level(pressure, sample_frequency, averaging_time, reference_pressure=2e-05)[source]

Time-averaged sound pressure level.

Parameters:
  • pressure – Dynamic pressure.
  • sample_frequency – Sample frequency.
  • averaging_time – Averaging time.
  • reference_pressure – Reference pressure.
acoustics.standards.iec_61672_1_2013.time_weighted_sound_level(pressure, sample_frequency, integration_time, reference_pressure=2e-05)[source]

Time-weighted sound pressure level.

Parameters:
  • pressure – Dynamic pressure.
  • sample_frequency – Sample frequency.
  • integration_time – Integration time.
  • reference_pressure – Reference pressure.
acoustics.standards.iec_61672_1_2013.weighting_function_a(frequencies)[source]

A-weighting function in decibel.

Parameters:frequencies – Vector of frequencies at which to evaluate the weighting.
Returns:Vector with scaling factors.

The weighting curve is

\[20 \log_{10}{\frac{(f_4^2 * f^4)}{(f^2 + f_1^2) \sqrt{(f^2 + f_2^2)(f^2 + f_3^2)}(f^2 + f_4^2)}} - A_{1000}\]

with \(A_{1000} = -2\) dB.

See equation E.6 of the standard.

acoustics.standards.iec_61672_1_2013.weighting_function_c(frequencies)[source]

C-weighting function in decibel.

Parameters:frequencies – Vector of frequencies at which to evaluate the weighting.
Returns:Vector with scaling factors.

The weighting curve is

\[20 \log_{10}{\frac{(f_4^2 f^2)}{(f^2+f_1^2)(f^2+f_4^2)}} - C_{1000}\]

with \(C_{1000} = -0.062\) dB

See equation E.1 of the standard.

acoustics.standards.iec_61672_1_2013.weighting_function_z(frequencies)[source]

Z-weighting function in decibel.

Parameters:frequencies – Vector of frequencies at which to evaluate the weighting.
Returns:Vector with scaling factors.
acoustics.standards.iec_61672_1_2013.weighting_system_a()[source]

A-weighting filter represented as polynomial transfer function.

Returns:Tuple of num and den.

See equation E.6 of the standard.

acoustics.standards.iec_61672_1_2013.weighting_system_c()[source]

C-weighting filter represented as polynomial transfer function.

Returns:Tuple of num and den.

See equation E.1 of the standard.

acoustics.standards.iec_61672_1_2013.weighting_system_z()[source]

Z-weighting filter represented as polynomial transfer function.

Returns:Tuple of num and den.

Z-weighting is 0.0 dB for all frequencies and therefore corresponds to a multiplication of 1.

IEC 61260-1:2014

IEC 61260-1:2014 specifies performance requirements for analogue, sampled-data, and digital implementations of band-pass filters.

Frequency functions

acoustics.standards.iec_61260_1_2014.exact_center_frequency(x, fraction=1, ref=1000.0, G=1.9952623149688795)[source]

Center frequencies \(f_m\) for band indices \(x\). See equation 2 and 3.

Parameters:
  • x – Band index \(x\).
  • ref – Reference center frequency \(f_r\).
  • fraction – Bandwidth designator :math`b`. For example, for 1/3-octave filter b=3.
  • G – Octave frequency ratio \(G\).

The center frequencies are given by

\[f_m = f_r G^{x/b}\]

In case the bandwidth designator \(b\) is an even number, the center frequencies are given by

\[f_m = f_r G^{(2x+1)/2b}\]

See equation 2 and 3 of the standard.

acoustics.standards.iec_61260_1_2014.lower_frequency(center, fraction=1, G=1.9952623149688795)[source]

Lower band-edge frequencies. See equation 4.

Parameters:
  • center – Center frequencies \(f_m\).
  • fraction – Bandwidth designator \(b\).
  • G – Octave frequency ratio \(G\).

The lower band-edge frequencies are given by

\[f_1 = f_m G^{-1/2b}\]

See equation 4 of the standard.

acoustics.standards.iec_61260_1_2014.upper_frequency(center, fraction=1, G=1.9952623149688795)[source]

Upper band-edge frequencies. See equation 5.

Parameters:
  • center – Center frequencies \(f_m\).
  • fraction – Bandwidth designator \(b\).
  • G – Octave frequency ratio \(G\).

The upper band-edge frequencies are given by

\[f_2 = f_m G^{+1/2b}\]

See equation 5 of the standard.

acoustics.standards.iec_61260_1_2014.index_of_frequency(frequency, fraction=1, ref=1000.0, G=1.9952623149688795)[source]

Determine the band index x from a given frequency.

Parameters:
  • frequency – Frequencies \(f\).
  • fraction – Bandwidth designator \(b\).
  • ref – Reference frequency.
  • G – Octave frequency ratio \(G\).

The index of the center frequency is given by

\[x = round{b \frac{\log{f/f_{ref} }}{\log{G} }}\]

Note

This equation is not part of the standard. However, it follows from exact_center_frequency().

Nominal center frequencies

iec_61260_1_2014.NOMINAL_OCTAVE_CENTER_FREQUENCIES = array([ 31.5, 63. , 125. , 250. , 500. , 1000. , 2000. , 4000. , 8000. , 16000. ])
iec_61260_1_2014.NOMINAL_THIRD_OCTAVE_CENTER_FREQUENCIES = array([ 25. , 31.5, 40. , 50. , 63. , 80. , 100. , 125. , 160. , 200. , 250. , 315. , 400. , 500. , 630. , 800. , 1000. , 1250. , 1600. , 2000. , 2500. , 3150. , 4000. , 5000. , 6300. , 8000. , 10000. , 12500. , 16000. , 20000. ])
iec_61260_1_2014.REFERENCE_FREQUENCY = 1000.0
iec_61260_1_2014.OCTAVE_FREQUENCY_RATIO = 1.9952623149688795
acoustics.standards.iec_61260_1_2014.NOMINAL_OCTAVE_CENTER_FREQUENCIES = array([ 31.5, 63. , 125. , 250. , 500. , 1000. , 2000. , 4000. , 8000. , 16000. ])

Nominal octave center frequencies.

acoustics.standards.iec_61260_1_2014.NOMINAL_THIRD_OCTAVE_CENTER_FREQUENCIES = array([ 25. , 31.5, 40. , 50. , 63. , 80. , 100. , 125. , 160. , 200. , 250. , 315. , 400. , 500. , 630. , 800. , 1000. , 1250. , 1600. , 2000. , 2500. , 3150. , 4000. , 5000. , 6300. , 8000. , 10000. , 12500. , 16000. , 20000. ])

Nominal third-octave center frequencies in the audio range.

acoustics.standards.iec_61260_1_2014.OCTAVE_FREQUENCY_RATIO = 1.9952623149688795

Octave frequency ratio \(G\).

See equation 1.

acoustics.standards.iec_61260_1_2014.REFERENCE_FREQUENCY = 1000.0

Reference frequency.

acoustics.standards.iec_61260_1_2014.exact_center_frequency(x, fraction=1, ref=1000.0, G=1.9952623149688795)[source]

Center frequencies \(f_m\) for band indices \(x\). See equation 2 and 3.

Parameters:
  • x – Band index \(x\).
  • ref – Reference center frequency \(f_r\).
  • fraction – Bandwidth designator :math`b`. For example, for 1/3-octave filter b=3.
  • G – Octave frequency ratio \(G\).

The center frequencies are given by

\[f_m = f_r G^{x/b}\]

In case the bandwidth designator \(b\) is an even number, the center frequencies are given by

\[f_m = f_r G^{(2x+1)/2b}\]

See equation 2 and 3 of the standard.

acoustics.standards.iec_61260_1_2014.index_of_frequency(frequency, fraction=1, ref=1000.0, G=1.9952623149688795)[source]

Determine the band index x from a given frequency.

Parameters:
  • frequency – Frequencies \(f\).
  • fraction – Bandwidth designator \(b\).
  • ref – Reference frequency.
  • G – Octave frequency ratio \(G\).

The index of the center frequency is given by

\[x = round{b \frac{\log{f/f_{ref} }}{\log{G} }}\]

Note

This equation is not part of the standard. However, it follows from exact_center_frequency().

acoustics.standards.iec_61260_1_2014.lower_frequency(center, fraction=1, G=1.9952623149688795)[source]

Lower band-edge frequencies. See equation 4.

Parameters:
  • center – Center frequencies \(f_m\).
  • fraction – Bandwidth designator \(b\).
  • G – Octave frequency ratio \(G\).

The lower band-edge frequencies are given by

\[f_1 = f_m G^{-1/2b}\]

See equation 4 of the standard.

acoustics.standards.iec_61260_1_2014.nominal_center_frequency = <numpy.vectorize object>

Nominal center frequency.

Parameters:
  • center – Exact center frequency.
  • fraction – Band designator or fraction.
acoustics.standards.iec_61260_1_2014.upper_frequency(center, fraction=1, G=1.9952623149688795)[source]

Upper band-edge frequencies. See equation 5.

Parameters:
  • center – Center frequencies \(f_m\).
  • fraction – Bandwidth designator \(b\).
  • G – Octave frequency ratio \(G\).

The upper band-edge frequencies are given by

\[f_2 = f_m G^{+1/2b}\]

See equation 5 of the standard.