Ir al contenido
Esta documentación describe la versión 4.0.0, todavía sin publicar. La versión actual en PyPI es la 3.3.0 y no incluye todo lo que se describe aquí.

metrology.comparison_calibration

La referencia de la API se publica en inglés en los dos idiomas: se genera a partir de los docstrings del código, que son su texto original.

Calibration of a measurement microphone by comparison with a reference microphone (IEC 61094-5:2016, pressure; IEC 61094-8:2012, free field).

A working standard microphone is not calibrated by reciprocity. It is put beside, or in place of, a reference microphone whose sensitivity is already known, both are exposed to the same sound pressure, and the ratio of their open-circuit output voltages carries the reference’s sensitivity over to it. IEC 61094-5 does this in a pressure field, in a coupler or a jig; IEC 61094-8 does it in a free field, in an anechoic room or behind a time window. Annex D of the first part writes the model once for both:

where is the ratio of the output voltages of the test and reference microphones and that of the effective sound pressures acting on them, reduced to unity by the procedure and the corrections. In sensitivity levels, the form every function here computes,

with the corrections the part asks for.

Simultaneous excitation (IEC 61094-5 5.1.2 and Annex C, IEC 61094-8 5.3). Both microphones sit in the field at once, each on its own measuring channel. The level reading difference between the channels, reference on channel 1, is Formula (C.1); after the microphones are interchanged it is Formula (C.2); and their difference cancels the gains of the two channels and the asymmetry of the field, Formula (C.3):

IEC 61094-5 requires the interchange in a coupler or a jig (“shall be used”, 5.1.2); simultaneous_comparison refuses a pressure calibration without it. IEC 61094-8 does not, and without it the channel difference is taken as read.

Sequential excitation (IEC 61094-5 5.1.3 and Annex B, IEC 61094-8 5.2 and Annex A). The microphones take the same place in turn. Either the exchange does not change the sound pressure significantly, or any change is detected and corrected, for example with a monitor microphone near the source: the ratio of each microphone’s output to the monitor’s, and the quotient of the two ratios, is the output ratio corrected for the drift (IEC 61094-8 A.2). sequential_comparison computes it, with the MonitorReadings of the monitor or without.

Corrections. IEC 61094-8 7.6 always corrects the reference’s sensitivity to the environmental conditions of the test. IEC 61094-5 6.6 does so when the two microphones are different models; for two of the same model it allows the result to be referred instead to the conditions at which the reference’s calibration is valid. Both parts allow the result to be referred to the reference conditions of clause 4 (23,0 °C, 101,325 kPa, 50 %) when reliable correction data are available. environmental_sensitivity_correction writes that correction to first order from the coefficients of the microphone, in the units IEC 61094-2 Annex D gives them. jig_diameter_correction returns the corrections of IEC 61094-5 Table A.1 for a type WS3 microphone calibrated against an LS2aP in the jig of Figure A.4, and diameter_sound_field_correction computes them for any test microphone smaller than its reference by the model 6.5 refers to, Barham, Barrera-Figueroa and Avison (2014), from which Table A.1 was calculated. A free-field calibration against a reference calibrated in a pressure field takes the reference’s free-field to pressure sensitivity level difference of IEC/TS 61094-7 (IEC 61094-8 Table 1 and 8.2).

Uncertainty. comparison_uncertainty_budget combines, on combine_uncertainty, the components of IEC 61094-5 Table D.1 or IEC 61094-8 Table 2, each with a sensitivity of 1 in the level model above, and multiplies the combined standard uncertainty by the coverage factor both parts report with (IEC 61094-5 7.9 and D.2, IEC 61094-8 8.8). The expanded uncertainty is then passed to the calibration, which draws it as a band.

The effective free-field region (IEC 61094-8 B.1). free_field_region gives the prolate spheroid inside which a time window of length simulates a free field, with the source and the microphone at its foci and the major diameter

at the speed of sound of IEC 61094-2 Annex F for the conditions of the test (air). Turned round, reflection_free_window_s gives the longest window that keeps a reflection of a known path outside it.

The phase of the sensitivity (IEC 61094-5 5.1.1, IEC 61094-8 5.1). Both parts carry the phase over with the modulus: IEC 61094-5 calculates “the sensitivity (both modulus and phase) of the test microphone”, and IEC 61094-8 “both the modulus and phase of the free-field sensitivity of the microphone under test”. The model of D.2 holds for the complex ratios, so the phase follows the level term by term:

and the interchange of Annex C cancels the phase shifts of the two channels and of the field just as (C.3) cancels their gains, . In a free field the phases have to be referred to the acoustic centres of the microphones (5.1 of the second part), which 7.3 positions “at the measurement points”; in a sequential substitution both centres go to the same point in turn, and the pressures on the two microphones have the same phase there. The phase inputs of a calibration travel together, as a SimultaneousComparisonPhase or a SequentialComparisonPhase.

Different acoustic impedances (IEC 61094-5 7.4 and 7.5). Two microphones of different acoustic impedance do not see the same sound pressure; neither clause prints a model, and both ask for the effect to be assessed and taken into the budget. impedance_pressure_ratio writes it in one form, each microphone’s equivalent volume (IEC 61094-1 6.2.2) against the equivalent volume of what it works into,

for two circuits: a closed coupler, the printed Formula (3) of IEC 61094-2, for a sequential substitution; and, for a simultaneous excitation, each microphone in series with the air between the two, as the “Microphone impedance” row of Table D.1 has it, by the circuit of its reference [2], Jarvis (1996), whose series impedance air_gap_series_impedance_pa_s_m3 gives. ReciprocityMicrophone.complex_equivalent_volume_m3 gives from the lumped parameters of IEC 61094-2 E.4.

Validation (IEC 61094-5 6.7). Calibrations made in a jig or a coupler “shall be validated by comparison with calibrations performed in other jigs and couplers and alternative sound sources”, or, for a laboratory standard microphone, with its reciprocity calibration. verify_jig_or_coupler sets the two calibrations side by side; the clause prints no criterion, and the library reads it as their agreeing within the expanded uncertainty of their difference. Two calibrations that share a component entering both levels alike, the same reference microphone or the same measuring chain, are correlated, and the part they share cancels in the difference: with its standard uncertainty, the GUM law of propagation for correlated inputs (JCGM 100:2008 5.2.2, with the covariance of F.1.2.3 for two sensitivities of 1) gives

which shared_standard_uncertainty_db passes to it.

Time-selective processing (IEC 61094-8 Annex B). A free field can be simulated by keeping only the direct sound of an impulse response: time_selective_response weights the response with a time window (B.1.3), with the “‘tapered’ edges” B.1.2 says it “normally has”, and transforms what is left by Formula (B.2), at any frequency. The impulse response comes from any of the methods of B.2 to B.6: stepped_sine_impulse_response takes a stepped-sine measurement to the time domain by Formula (B.3), and the sweeps, the maximum length sequences and the random noise of B.3 to B.5 are those of phonometry.room and phonometry.electroacoustics. For the direct impulse method of B.6, rectangular_pulse is the pulse of Formula (B.10) and rectangular_pulse_duration_s the duration whose first spectral zero lies an order of magnitude above the frequencies of interest.

Printed values the library does not follow

Section titled “Printed values the library does not follow”

IEC 61094-5 D.3. The root-sum-square of the eight components Table D.1 prints is 0,0437 dB, not the 0,040 dB D.3 states; with it is 0,087 dB rather than 0,08 dB. comparison_uncertainty_budget gives the sum of the printed components, and the defect is in docs/ERRATA.md.

IEC 61094-8 B.10. The spectrum of Formula (B.10) is that of a rectangular pulse of duration , although the text calls the duration. The formula and the first zero it puts at agree, so the library follows them and reads as the half-duration: rectangular_pulse takes the whole duration . The defect is in docs/ERRATA.md.

Barham et al. (2014), Formulas (1), (2) and (4). With the inputs of its Table 1, the model as printed gives -0.986 dB at 20 kHz at 344,8 m/s, where its Table 2 (Table A.1 of IEC 61094-5) prints -1.443 dB. Read with the radial sensitivity of Formula (4) less 1, the deflection of a membrane under a uniform pressure, the annulus of Formula (2) from the test microphone’s overall radius, and in Formula (1) as in (2) and (3), it gives every row of the table; diameter_sound_field_correction follows that reading. The defects are in docs/ERRATA.md.

Jarvis (1996), Appendix B. In the published scan the impedance of the first microphone reads , its mass term without the imaginary unit the second microphone’s carries: blank space stands where the glyphs belong, as it does for others the scan loses on the same folio. Only gives the graphs computed from it, and air_gap_series_impedance_pa_s_m3 is checked against that. The defect is in docs/ERRATA.md.

The IEC 61183 diffuse-field comparison of clause 5 (diffuse_field_sensitivity) is the same sequential comparison without a monitor, and computes its level difference and its sensitivity level through this module.

Auto-generated from the source docstrings by scripts/generate_api_docs.py (make api-docs). Do not edit by hand.

air_gap_series_impedance_pa_s_m3(
frequencies_hz: ArrayLike,
*,
gap_length_m: float,
gap_radius_m: float,
temperature_c: float = 23.0,
static_pressure_kpa: float = 101.325,
relative_humidity_percent: float = 50.0,
gas: Fluid | None = None,
) -> NDArray[np.complex128]

The acoustic impedance of the air between two microphones that each acts in series with, in a symmetric coupler driven at its middle (IEC 61094-5:2016 Table D.1 and 7.4, by the circuit of Jarvis 1996, reference [2] of the part).

“The acoustical impedance of the microphone acts in series with that of the air in the space between the two microphones. Microphones with different acoustic impedance therefore see slightly different pressures when simultaneously exposed to the same pressure field (see 7.4 and [2])” (Table D.1, “Microphone impedance”). Reference [2], NPL Report CIRA(EXT) 010, models the coupler in its Appendix B as a ladder: the source at the reference plane in the middle, and on each side a mass , the compliance of that side’s half of the volume to ground, a second and the microphone,

for a tube of length and radius . It prints the ratio of the two pressures, with and . Seen from each microphone, the pressure of the middle behind the ladder is a source of pressure , common to both, behind the impedance this function returns,

so each diaphragm takes that pressure times , and the printed ratio is the divider of impedance_pressure_ratio given coupling_impedance_pa_s_m3 = , exactly.

Parameters

NameDescription
frequencies_hzThe frequencies, in Hz, increasing.
gap_length_m, the length of the space between the two diaphragms, in m (Appendix B’s example: 2 mm).
gap_radius_m, its radius, in m (Appendix B’s example: half of 12,7 mm).
temperature_cThe air temperature, in °C (Default: 23,0, the reference conditions of clause 4).
static_pressure_kpaThe static pressure , in kPa (Default: 101,325).
relative_humidity_percentThe relative humidity, in % (Default: 50).
gasA Fluid whose density and ratio of specific heats are used instead of those of the IEC 61094-2 Annex F air at the three conditions, at the same static pressure (Default: None). Appendix B takes 1,21 kg/m³, 1,4 and 101 325 Pa.

Returns: at each frequency, complex, in Pa·s/m³, read-only.

Raises

ExceptionWhen
ValueErrorfor frequencies that are not positive and increasing, a length or radius that is not positive, conditions Annex F refuses, or a gas at another pressure.
comparison_uncertainty_budget(
standard_uncertainties_db: Mapping[str, float | Quantity],
*,
frequency_hz: float,
field: str = 'pressure',
additional_components: Sequence[Quantity] = (),
coverage_factor: float = 2.0,
) -> ComparisonUncertaintyBudget

The uncertainty budget of a comparison calibration at one frequency (IEC 61094-5:2016 Annex D; IEC 61094-8:2012 8.8 and Table 2).

Each component is given as a standard uncertainty in dB, the column Table D.1 prints, or as a Quantity whose standard uncertainty it takes: metrology.rectangular(0, 0.03) for a semi-range of 0,03 dB, say. They are keyed by the names of IEC61094_5_TABLE_D1 for a pressure calibration and of IEC61094_8_TABLE_2 for a free-field one; neither table is exhaustive (D.1, 8.1), so a component may be left out and additional_components adds the ones a set-up needs, such as the diameter correction of a WS3 microphone in the jig (Table D.1, special cases). The combination is combine_uncertainty on the level model, every component with a sensitivity of 1, which is the root-sum-square of D.3; the expanded uncertainty is times it, the coverage factor 7.9 and D.2 of the first part and 8.8 of the second report with.

With the eight components of Table D.1 at 2 kHz the combined standard uncertainty is 0,0437 dB and the expanded one 0,087 dB. D.3 prints 0,040 dB and 0,08 dB, which are not the root-sum-square of its own components (an erratum; see docs/ERRATA.md).

Parameters

NameDescription
standard_uncertainties_dbThe components, keyed by name, each a standard uncertainty in dB or a Quantity.
frequency_hzThe frequency the budget is for, in Hz.
field"pressure" (Table D.1, default) or "free_field" (Table 2).
additional_componentsFurther components, as named Quantity objects (Default: none).
coverage_factor (Default: 2).

Returns: The ComparisonUncertaintyBudget.

Raises

ExceptionWhen
ValueErrorfor a key that is not a component of the field’s table, an additional component without a name or with the name of another component, no component at all, or a value that is negative or not finite.
ComparisonCalibration(
frequencies_hz: NDArray[np.float64],
reference_sensitivity_level_db: NDArray[np.float64],
output_level_differences_db: NDArray[np.float64],
pressure_level_difference_db: NDArray[np.float64],
corrections_db: Mapping[str, NDArray[np.float64]],
field: str,
excitation: str,
expanded_uncertainty_db: NDArray[np.float64] | None = None,
*,
reference_sensitivity_phase_deg: NDArray[np.float64] | None = None,
output_phase_differences_deg: NDArray[np.float64] | None = None,
pressure_phase_difference_deg: NDArray[np.float64] | None = None,
)

The sensitivity level of a microphone calibrated by comparison (IEC 61094-5:2016 D.2 for a pressure field, IEC 61094-8:2012 for a free field).

Attributes

NameDescription
frequencies_hzThe frequencies, in Hz.
reference_sensitivity_level_db, the reference microphone’s sensitivity level as calibrated, in dB re 1 V/Pa.
output_level_differences_db of each determination, one row per determination, in dB: the output of the test microphone re that of the reference.
pressure_level_difference_db, the effective sound pressure on the test microphone re that on the reference, in dB.
corrections_dbThe corrections added to the level, by name, each in dB at every frequency.
field"pressure" (IEC 61094-5) or "free_field" (IEC 61094-8).
excitation"simultaneous" or "sequential".
expanded_uncertainty_dbThe expanded uncertainty () of the sensitivity level at each frequency, in dB, or None.
reference_sensitivity_phase_deg, the phase of the reference microphone’s sensitivity, in degrees, or None for a calibration of the level alone.
output_phase_differences_deg of each determination, one row per determination, in degrees, or None.
pressure_phase_difference_deg, in degrees, or None.

property

, in dB (0 without corrections).

property

The number of determinations averaged.

ComparisonCalibration.output_level_difference_db

Section titled “ComparisonCalibration.output_level_difference_db”

property

, the mean over the determinations, in dB.

ComparisonCalibration.output_phase_difference_deg

Section titled “ComparisonCalibration.output_phase_difference_deg”

property

, the mean over the determinations, in degrees, or None for a calibration of the level alone.

ComparisonCalibration.plot(
ax: Axes | None = None,
*,
quantity: str = 'level',
language: str = 'en',
**kwargs: Any,
) -> Axes

Plot and the reference’s level against frequency, with the expanded uncertainty as a band when it is known, or the two phases.

The reference’s level is , or, in a free field against a pressure-calibrated reference, plus its free-field difference: the level the test microphone was compared with.

Parameters

NameDescription
axExisting axes to draw on, or None to create a figure.
quantity"level" (default), or "phase" for and of a calibration that carries them.
languageLabel language, "en" (default) or "es".
kwargsForwarded to the curve of the microphone under test.

Returns: The axes. Requires matplotlib (pip install phonometry[plot]).

Raises

ExceptionWhen
ValueErrorfor an unknown quantity, or the phase of a calibration of the level alone.

ComparisonCalibration.sensitivity_level_db

Section titled “ComparisonCalibration.sensitivity_level_db”

property

, in dB re 1 V/Pa.

ComparisonCalibration.sensitivity_mv_per_pa

Section titled “ComparisonCalibration.sensitivity_mv_per_pa”

property

V/Pa, in mV/Pa.

ComparisonCalibration.sensitivity_phase_deg

Section titled “ComparisonCalibration.sensitivity_phase_deg”

property

, in degrees from -180° (excluded) to 180°, or None for a calibration of the level alone (IEC 61094-5 5.1.1, IEC 61094-8 5.1).

property

The designation the calibration follows.

ComparisonUncertaintyBudget(
frequency_hz: float,
field: str,
names: tuple[str, ...],
components: tuple[str, ...],
standard_uncertainties_db: NDArray[np.float64],
uncertainty: UncertaintyResult,
coverage_factor: float = 2.0,
)

The uncertainty budget of a comparison calibration at one frequency (IEC 61094-5:2016 Annex D, IEC 61094-8:2012 8.8).

Every component is a standard uncertainty in dB and enters the level model with a sensitivity of 1, so the combined standard uncertainty is their root-sum-square (D.3), and the expanded uncertainty is times it (7.9 of the first part, 8.8 of the second).

Attributes

NameDescription
frequency_hzThe frequency, in Hz.
field"pressure" (Table D.1) or "free_field" (Table 2).
namesThe key of each component, then the names of any additional ones.
componentsThe component as the table prints it, or the name of an additional one.
standard_uncertainties_db, in dB.
uncertaintyThe UncertaintyResult of the combination, which has to be the combination of standard_uncertainties_db.
coverage_factor, 2 by both parts.

ComparisonUncertaintyBudget.combined_uncertainty_db

Section titled “ComparisonUncertaintyBudget.combined_uncertainty_db”

property

, the combined standard uncertainty, in dB.

ComparisonUncertaintyBudget.expanded_uncertainty_db

Section titled “ComparisonUncertaintyBudget.expanded_uncertainty_db”

property

, in dB.

ComparisonUncertaintyBudget.linear_combined_uncertainty_db

Section titled “ComparisonUncertaintyBudget.linear_combined_uncertainty_db”

property

combined in linear form, in dB.

Each component converted to a relative uncertainty, , combined in quadrature and converted back, : the “strict calculation” D.3 mentions and 8.8 prefers. For components of a few hundredths of a decibel it differs from combined_uncertainty_db in the fourth decimal at most, which is why both parts accept the logarithmic form.

ComparisonUncertaintyBudget.plot(
ax: Axes | None = None,
*,
language: str = 'en',
**kwargs: Any,
) -> Axes

Plot the standard uncertainty of each component, with , and .

Parameters

NameDescription
axExisting axes to draw on, or None to create a figure.
languageLabel language, "en" (default) or "es".
kwargsForwarded to barh.

Returns: The axes. Requires matplotlib (pip install phonometry[plot]).

property

The designation whose table the budget follows.

ComparisonUncertaintyRow(
component: str,
subclauses: tuple[str, ...] = (),
stated_db: float | None = None,
divisor: float | None = None,
standard_uncertainty_db: float | None = None,
)

One row of the uncertainty table of IEC 61094-5 (Table D.1) or IEC 61094-8 (Table 2).

Table D.1 is a worked example at 2 kHz: seven of its eight rows state a value, the distribution it is read with and the standard uncertainty that follows; the repeatability row prints its standard uncertainty alone. Table 2 lists the typical components with the subclause that discusses each and prints no value.

Attributes

NameDescription
componentThe component as the table prints it.
subclausesThe subclauses the table refers the component to (Table 2); empty for Table D.1, which prints none.
stated_dbThe value the row’s text states, in dB: a semi-range or an expanded uncertainty with , as divisor says; None for the repeatability of Table D.1, whose text states none, and for Table 2.
divisorWhat turns stated_db into a standard uncertainty: for the semi-range of a rectangular distribution, 2 for an expanded uncertainty with ; None where stated_db is.
standard_uncertainty_dbThe standard uncertainty the table prints, in dB; None for Table 2.
diameter_sound_field_correction(
frequencies_hz: ArrayLike,
*,
reference_radius_m: float,
test_diaphragm_radius_m: float,
test_outer_radius_m: float,
separation_m: float,
reference_resonance_frequency_hz: float,
test_resonance_frequency_hz: float,
temperature_c: float = 23.0,
static_pressure_kpa: float = 101.325,
relative_humidity_percent: float = 50.0,
gas: Fluid | None = None,
) -> DiameterSoundFieldCorrection

The correction for a test microphone smaller than the reference it faces in a jig (IEC 61094-5:2016 6.5 and A.2), by the model of Barham, Barrera-Figueroa and Avison (2014), the reference [1] of the part.

“The effect of a non-uniform pressure distribution over the surface of the diaphragm will be significantly greater if the test and reference microphones are of different diameters. A theoretical model which can be used to apply corrections and assess the uncertainties in this case is given in the literature (for example [1])” (6.5). The model is the origin of Table A.1: the space between the diaphragms is a cylinder of the reference’s front-cavity radius and length , closed by the reference at and driven, in a radially symmetrical field, through the annulus around the smaller microphone at . The pressure is a Fourier-Bessel series of the radial modes of the cavity, Formulas (1) to (3),

and each microphone reads it averaged over its diaphragm with its radial sensitivity, Formula (5), the reference at over and the test microphone at over . The correction is the ratio of the two averages, .

As printed, the formulas with the inputs of the paper’s Table 1 do not give its Table 2, which is Table A.1 (an erratum in docs/ERRATA.md). They give it, every row to its printed rounding, read as follows, which is what this function computes: the radial sensitivity of Formula (4) is the deflection of a membrane under a uniform pressure, (printed without the ), with the frequency over the diaphragm’s resonance frequency; the annulus that drives the gap starts at the test microphone’s overall radius, which Table 1 lists and no formula uses, while the average of Formula (5) runs over its diaphragm radius ; and the argument of Formula (1) is , as in (2) and (3). The paper prints no speed of sound: at the reference air of clause 4 the result is within 0,01 dB of every row of Table A.1, and at 344,8 m/s it is every row.

The circular symmetry it assumes is the reason a calibration it corrects is made with a coaxial source in a free field or in a diffuse field averaged long enough (6.5, A.2). The radial sensitivity of Formula (4) divides by , which vanishes at the resonance, so the frequencies are held below the resonance frequency of each microphone, as the paper’s are (20 kHz against 22 kHz and 100 kHz). Near the half-wave resonances of the gap, and its multiples, and near the cut-offs of its radial modes, the pressures of the lossless model grow without bound while , their ratio, stays finite and is returned; the plane mode alone gives at .

Parameters

NameDescription
frequencies_hzThe frequencies, in Hz, increasing, each below both resonance frequencies.
reference_radius_m, the radius of the reference microphone’s front cavity, which the model also takes for its diaphragm, in m (an LS2: 4,650 mm, Table 1 of the paper).
test_diaphragm_radius_m, the radius of the test microphone’s diaphragm, in m (a WS3: 2,065 mm).
test_outer_radius_mThe overall radius of the test microphone, in m, at least and less than (a WS3: 2,975 mm).
separation_m, the distance between the diaphragms, in m (Figure A.4: 0,5 mm, “the only one for which the corrections specified in Table A.1 are valid”).
reference_resonance_frequency_hzThe resonance frequency of the reference microphone’s diaphragm, in Hz (an LS2: 22 kHz).
test_resonance_frequency_hzThat of the test microphone, in Hz (a WS3: 100 kHz).
temperature_cThe air temperature, in °C (Default: 23,0, the reference conditions of clause 4).
static_pressure_kpaThe static pressure, in kPa (Default: 101,325).
relative_humidity_percentThe relative humidity, in % (Default: 50).
gasA Fluid whose speed of sound is used instead of that of the IEC 61094-2 Annex F air at the three conditions, at the same static pressure (Default: None).

Returns: The DiameterSoundFieldCorrection.

Raises

ExceptionWhen
ValueErrorfor frequencies that are not positive and increasing or not below both resonances, a dimension that is not positive, an outer radius smaller than the diaphragm’s or not smaller than , conditions Annex F refuses, a gas at another pressure, or a frequency at which a mode of the gap is exactly at its cut-off.
DiameterSoundFieldCorrection(
frequencies_hz: NDArray[np.float64],
ratio: NDArray[np.complex128],
doubled_separation_ratio: NDArray[np.complex128],
reference_radius_m: float,
test_diaphragm_radius_m: float,
test_outer_radius_m: float,
separation_m: float,
speed_of_sound: float,
)

The sound-field correction of a test microphone smaller than its reference, facing it across a narrow gap (IEC 61094-5:2016 6.5, by the model of Barham, Barrera-Figueroa and Avison 2014, reference [1] of the part).

is the ratio of the effective sound pressures on the test and the reference microphone of D.2, each the pressure of the cavity between them averaged over its diaphragm with its radial sensitivity, and the correction to add to the test microphone’s sensitivity level is , the form Table A.1 prints. The same correction at twice the separation, which A.2 names as what the 10 % uncertainty of Table A.1 approximately is, comes with it.

Attributes

NameDescription
frequencies_hzThe frequencies, in Hz.
ratio at each frequency, complex: the test microphone’s effective pressure re the reference’s.
doubled_separation_ratio with the diaphragms twice as far apart, complex.
reference_radius_m, the radius of the reference microphone’s front cavity and diaphragm, in m.
test_diaphragm_radius_m, the radius of the test microphone’s diaphragm, in m.
test_outer_radius_mThe overall radius of the test microphone, in m: the sound reaches the gap through the annulus between it and .
separation_m, the distance between the diaphragms, in m.
speed_of_soundThe speed of sound of the air in the gap, in m/s.

DiameterSoundFieldCorrection.correction_db

Section titled “DiameterSoundFieldCorrection.correction_db”

property

, in dB: to be added to the sensitivity level of the test microphone, as Table A.1 is.

DiameterSoundFieldCorrection.doubled_separation_correction_db

Section titled “DiameterSoundFieldCorrection.doubled_separation_correction_db”

property

The correction with the diaphragms twice as far apart, in dB.

DiameterSoundFieldCorrection.phase_difference_deg

Section titled “DiameterSoundFieldCorrection.phase_difference_deg”

property

, in degrees.

DiameterSoundFieldCorrection.plot(
ax: Axes | None = None,
*,
language: str = 'en',
**kwargs: Any,
) -> Axes

Plot the correction and the correction at twice the separation against frequency.

Parameters

NameDescription
axExisting axes to draw on, or None to create a figure.
languageLabel language, "en" (default) or "es".
kwargsForwarded to the correction curve.

Returns: The axes. Requires matplotlib (pip install phonometry[plot]).

DiameterSoundFieldCorrection.separation_change_db

Section titled “DiameterSoundFieldCorrection.separation_change_db”

property

How much the correction changes when the separation is doubled, in dB, as a magnitude.

A.2 estimates the expanded uncertainty of the corrections of Table A.1 as 10 % of their value, “which is approximately the change observed by doubling the distance between the microphones”. This is that change, by the model, for any geometry. 6.5 offers the model “to apply corrections and assess the uncertainties” for microphones of different diameters and prints no rule for that assessment; A.2’s doubling is the one estimate the part gives, for Table A.1. Whether to take this change as the expanded uncertainty is the caller’s estimate to make.

environmental_sensitivity_correction(
frequencies_hz: ArrayLike,
*,
static_pressure_kpa: float,
temperature_c: float,
relative_humidity_percent: float,
static_pressure_coefficient_db_per_kpa: ArrayLike,
temperature_coefficient_db_per_k: ArrayLike,
humidity_coefficient_db_per_percent: ArrayLike = 0.0,
reference_static_pressure_kpa: float = 101.325,
reference_temperature_c: float = 23.0,
reference_relative_humidity_percent: float = 50.0,
) -> EnvironmentalSensitivityCorrection

The correction of a sensitivity level from one set of environmental conditions to another (IEC 61094-5 6.6, IEC 61094-8 7.6).

IEC 61094-8 7.6 asks for the reference microphone’s sensitivity to be corrected to the conditions of the test in every case. IEC 61094-5 6.6 asks for it when the two microphones are different models, and for two of the same model allows the result to be referred instead to the conditions at which the reference’s calibration is valid. Both allow the result to be referred to the reference conditions of clause 4 when reliable correction data are available; neither prints a formula. This is the first-order one, a coefficient times a deviation for each of the three conditions,

with the coefficients in the units IEC 61094-2:2009 Annex D gives them: dB/kPa for the static pressure, dB/K for the temperature. Annex D of that part puts the low-frequency static pressure coefficient of LS1P microphones between -0,01 dB/kPa and -0,02 dB/kPa and of LS2P between -0,003 dB/kPa and -0,008 dB/kPa, the temperature coefficient within ±0,005 dB/K, and all three vary with frequency and from one microphone to another, so they are the microphone’s own and are required here. 6.5.3 of the same part observes no influence of humidity on a laboratory standard microphone, hence the default of 0 for its coefficient.

The reference conditions default to clause 4 of IEC 61094-5 and IEC 61094-8, 101,325 kPa, 23,0 °C and 50 %. The correction adds to a level known at the reference conditions to give it at the conditions of the test; simultaneous_comparison and sequential_comparison add it to the reference microphone’s level (reference_environment=) or subtract it from the result (test_environment=).

Parameters

NameDescription
frequencies_hzThe frequencies, in Hz, increasing.
static_pressure_kpa, the static pressure the level is wanted at, in kPa.
temperature_c, in °C.
relative_humidity_percent, in %.
static_pressure_coefficient_db_per_kpa, in dB/kPa, one value or one per frequency.
temperature_coefficient_db_per_k, in dB/K.
humidity_coefficient_db_per_percent, in dB per percentage point (Default: 0).
reference_static_pressure_kpa, where the level is known, in kPa (Default: 101,325).
reference_temperature_c, in °C (Default: 23,0).
reference_relative_humidity_percent, in % (Default: 50).

Returns: The EnvironmentalSensitivityCorrection.

Raises

ExceptionWhen
ValueErrorfor frequencies that are not positive and increasing, a pressure that is not positive, a temperature that is not finite or not above absolute zero, a relative humidity outside 0 % to 100 %, a coefficient that is not finite, or a coefficient column that is not one value per frequency.
EnvironmentalSensitivityCorrection(
frequencies_hz: NDArray[np.float64],
static_pressure_kpa: float,
temperature_c: float,
relative_humidity_percent: float,
reference_static_pressure_kpa: float,
reference_temperature_c: float,
reference_relative_humidity_percent: float,
static_pressure_coefficient_db_per_kpa: NDArray[np.float64],
temperature_coefficient_db_per_k: NDArray[np.float64],
humidity_coefficient_db_per_percent: NDArray[np.float64],
)

The change of a microphone’s sensitivity level between two sets of environmental conditions, to first order in each.

with the static pressure coefficient in dB/kPa, the temperature coefficient in dB/K and the humidity coefficient in dB per percentage point, each one value or one per frequency. Added to a sensitivity level valid at , it gives the level at .

Attributes

NameDescription
frequencies_hzThe frequencies, in Hz.
static_pressure_kpa, where the level is wanted, in kPa.
temperature_c, in °C.
relative_humidity_percent, in %.
reference_static_pressure_kpa, where the level is known, in kPa.
reference_temperature_c, in °C.
reference_relative_humidity_percent, in %.
static_pressure_coefficient_db_per_kpa at each frequency, in dB/kPa.
temperature_coefficient_db_per_k, in dB/K.
humidity_coefficient_db_per_percent, in dB/%.

EnvironmentalSensitivityCorrection.correction_db

Section titled “EnvironmentalSensitivityCorrection.correction_db”

property

, the sum of the three terms, in dB.

EnvironmentalSensitivityCorrection.humidity_term_db

Section titled “EnvironmentalSensitivityCorrection.humidity_term_db”

property

, in dB.

EnvironmentalSensitivityCorrection.plot(
ax: Axes | None = None,
*,
language: str = 'en',
**kwargs: Any,
) -> Axes

Plot and its three terms against frequency.

Parameters

NameDescription
axExisting axes to draw on, or None to create a figure.
languageLabel language, "en" (default) or "es".
kwargsForwarded to the curve.

Returns: The axes. Requires matplotlib (pip install phonometry[plot]).

EnvironmentalSensitivityCorrection.static_pressure_term_db

Section titled “EnvironmentalSensitivityCorrection.static_pressure_term_db”

property

, in dB.

EnvironmentalSensitivityCorrection.temperature_term_db

Section titled “EnvironmentalSensitivityCorrection.temperature_term_db”

property

, in dB.

free_field_region(
source_distance_m: float,
window_time_s: float,
*,
temperature_c: float = 23.0,
static_pressure_kpa: float = 101.325,
relative_humidity_percent: float = 50.0,
) -> FreeFieldRegion

The effective free-field region of a time window (IEC 61094-8:2012 B.1).

Formula (B.1), , with “the speed of sound at the prevailing environmental conditions”, which is taken from the IEC 61094-2:2009 Annex F air of air. The conditions default to the reference conditions of clause 4, 23,0 °C, 101,325 kPa and 50 %.

Parameters

NameDescription
source_distance_m, the separation of the acoustic centres of the source and the microphone, in m.
window_time_s, from the arrival of the sound at the microphone to the end of the time window, in s.
temperature_cThe air temperature, in °C (Default: 23,0).
static_pressure_kpaThe static pressure, in kPa (Default: 101,325).
relative_humidity_percentThe relative humidity, in % (Default: 50).

Returns: The FreeFieldRegion.

Raises

ExceptionWhen
ValueErrorfor a separation or window that is not positive, or conditions Annex F refuses.
FreeFieldRegion(
source_distance_m: float,
window_time_s: float,
speed_of_sound: float,
)

The effective free-field region of a time-selective calibration (IEC 61094-8:2012 B.1, Formula (B.1) and Figure B.1).

A prolate spheroid generated by an ellipse with the acoustic centres of the source and of the microphone at its foci, apart, and the major diameter . A reflection from any point on its surface arrives after the direct sound, at the end of the window; the device measured is inside, and any reflecting surface or obstacle has to be outside.

Attributes

NameDescription
source_distance_m, the source to receiver separation, in m.
window_time_s, from the arrival of the sound at the microphone to the end of the window, in s.
speed_of_sound at the conditions of the test, in m/s.

property

, Formula (B.1), in m.

FreeFieldRegion.plot(
ax: Axes | None = None,
*,
language: str = 'en',
**kwargs: Any,
) -> Axes

Plot the region in a plane through the axis, as Figure B.1 draws it.

Parameters

NameDescription
axExisting axes to draw on, or None to create a figure.
languageLabel language, "en" (default) or "es".
kwargsForwarded to the boundary of the region.

Returns: The axes. Requires matplotlib (pip install phonometry[plot]).

property

, how far the region reaches behind the microphone along the axis, in m: the mounting rod “should be sufficiently long so that the end opposite to the microphone is completely outside” it (B.1).

property

, the radius of the region at mid-way between the source and the microphone, in m: the clearance a surface parallel to the axis needs to be outside it.

Constant (mapping).

IEC61094_5_TABLE_A1 = {1000.0: -0.004, 1250.0: -0.006, 1600.0: -0.009, 2000.0: -0.015, 2500.0: -0.023, 3150.0: -0.036, 4000.0: -0.059, 5000.0: -0.092, 6300.0: -0.146, 8000.0: -0.235, 10000.0: -0.367, 12500.0: -0.572, 16000.0: -0.933, 20000.0: -1.443}

Constant (mapping).

IEC61094_5_TABLE_D1 = {'reference': ComparisonUncertaintyRow(component='Sensitivity of reference microphone', subclauses=(), stated_db=0.05, divisor=2.0, standard_uncertainty_db=0.025), 'capacitance': ComparisonUncertaintyRow(component='Microphone capacitance', subclauses=(), stated_db=0.01, divisor=1.7320508075688772, standard_uncertainty_db=0.006), 'non_linearity': ComparisonUncertaintyRow(component='Non-linearity', subclauses=(), stated_db=0.03, divisor=1.7320508075688772, standard_uncertainty_db=0.017), 'impedance': ComparisonUncertaintyRow(component='Microphone impedance', subclauses=(), stated_db=0.005, divisor=1.7320508075688772, standard_uncertainty_db=0.003), 'polarizing_voltage': ComparisonUncertaintyRow(component='Polarising voltage', subclauses=(), stated_db=0.008681549586371858, divisor=1.7320508075688772, standard_uncertainty_db=0.005), 'repeatability': ComparisonUncertaintyRow(component='Repeatability', subclauses=(), stated_db=None, divisor=None, standard_uncertainty_db=0.025), 'drift': ComparisonUncertaintyRow(component='Drift in reference microphone sensitivity since last calibration', subclauses=(), stated_db=0.03, divisor=1.7320508075688772, standard_uncertainty_db=0.017), 'rounding': ComparisonUncertaintyRow(component='Rounding of reported results', subclauses=(), stated_db=0.005, divisor=1.7320508075688772, standard_uncertainty_db=0.003)}

Constant (mapping).

IEC61094_8_TABLE_1 = {'primary_free_field': ReferenceCalibrationRow(microphone_types='LS', method='Primary free-field calibration', references=('IEC 61094-3',), expanded_uncertainty_1khz_db=0.25, expanded_uncertainty_10khz_db=0.1), 'primary_pressure': ReferenceCalibrationRow(microphone_types='LS', method='Primary pressure calibration with the addition of a free-field to pressure sensitivity level difference', references=('IEC 61094-2', 'IEC/TS 61094-7'), expanded_uncertainty_1khz_db=0.12, expanded_uncertainty_10khz_db=0.4), 'secondary_pressure': ReferenceCalibrationRow(microphone_types='LS', method='Secondary pressure calibration with the addition of a free-field to pressure sensitivity level difference', references=('IEC 61094-5', 'IEC/TS 61094-7'), expanded_uncertainty_1khz_db=0.15, expanded_uncertainty_10khz_db=0.5), 'secondary_free_field': ReferenceCalibrationRow(microphone_types='LS and WS', method='Secondary free-field calibration', references=('IEC 61094-8',), expanded_uncertainty_1khz_db=0.2, expanded_uncertainty_10khz_db=0.5), 'electrostatic_actuator': ReferenceCalibrationRow(microphone_types='LS and WS', method='Electrostatic actuator calibration with the addition of a free-field to actuator response level difference', references=('IEC 61094-6',), expanded_uncertainty_1khz_db=0.3, expanded_uncertainty_10khz_db=0.6)}

Constant (mapping).

impedance_pressure_ratio(
frequencies_hz: ArrayLike,
*,
reference_equivalent_volume_m3: ArrayLike,
test_equivalent_volume_m3: ArrayLike,
coupling_equivalent_volume_m3: ArrayLike | None = None,
coupling_impedance_pa_s_m3: ArrayLike | None = None,
) -> ImpedancePressureRatio

The ratio of the sound pressures that the different acoustic impedances of two microphones cause (IEC 61094-5:2016 7.4 and 7.5).

“Differences in the acoustic impedance between the test and reference microphones can cause the sound pressure at the test and reference microphones to differ” (7.4), most where a pressure and a free-field response microphone meet above 10 kHz (7.5). Neither clause prints a model; both refer the effect to the uncertainty, and 7.4 to the literature for a model. This function writes two circuits: the closed coupler that IEC 61094-2 prints as Formula (3), and the series divider of the simultaneous excitation of Table D.1, the circuit of its reference [2], Jarvis (1996). Each microphone enters by its equivalent volume (IEC 61094-1 6.2.2, with and = 101,325 kPa):

  • A closed coupler, sequential substitution. In a coupler small against the wavelength, the source drives the sum of the admittances of the gas and of every microphone in it, IEC 61094-2:2009 Formula (3), , so putting the test microphone in the place of the reference changes the pressure by , with the rest of the load: the gas volume referred to the reference conditions, , and the equivalent volumes of the source and of any monitor. A monitor that “accurately sense[s] changes in the sound pressure at the test/reference microphone position” (5.1.3) corrects for this ratio; without one it is the correction. Pass coupling_equivalent_volume_m3.
  • The air between the microphones in series, simultaneous excitation. “The acoustical impedance of the microphone acts in series with that of the air in the space between the two microphones. Microphones with different acoustic impedance therefore see slightly different pressures when simultaneously exposed to the same pressure field” (Table D.1, “Microphone impedance”). The row refers to [2], Jarvis (1996), whose Appendix B draws the coupler as a ladder from a source at its middle; seen from each microphone, that is a common pressure behind one series impedance , so each diaphragm takes and the ratio of the two is the one Appendix B prints, exactly. Written with volumes this is the same ratio, being the equivalent volume of , . Pass coupling_impedance_pa_s_m3, which air_gap_series_impedance_pa_s_m3 gives for a coupler of known length and radius; Table D.1 still asks for the effect to be “established experimentally” when the impedances differ significantly.

Parameters

NameDescription
frequencies_hzThe frequencies, in Hz, increasing.
reference_equivalent_volume_m3, complex, in m³, one value or one per frequency, such as ReciprocityMicrophone.complex_equivalent_volume_m3 gives it from the lumped parameters of IEC 61094-2 E.4. Its ratio to holds no , so the volume keeps the definition was given in, the of IEC 61094-1 for the values of its Table 3; a series impedance is turned into with that same 1,40.
test_equivalent_volume_m3, in m³.
coupling_equivalent_volume_m3 of a closed coupler, in m³ at the reference conditions (Default: None).
coupling_impedance_pa_s_m3, the acoustic impedance in series with each microphone, in Pa·s/m³ (Default: None; give exactly one of the two).

Returns: The ImpedancePressureRatio.

Raises

ExceptionWhen
ValueErrorfor frequencies that are not positive and increasing, not exactly one of the two couplings, a series impedance of zero, a column that is not one finite value per frequency, or a coupling and a test microphone whose equivalent volumes cancel.
ImpedancePressureRatio(
frequencies_hz: NDArray[np.float64],
ratio: NDArray[np.complex128],
coupling: str,
coupling_equivalent_volume_m3: NDArray[np.complex128],
)

The ratio of the sound pressures on the test and the reference microphone that their different acoustic impedances cause (IEC 61094-5:2016 7.4 and 7.5).

with the equivalent volume of each microphone and that of what it works into. Its level, level_difference_db, is the pressure_level_difference_db of a comparison, and its phase the pressure_phase_difference_deg.

Attributes

NameDescription
frequencies_hzThe frequencies, in Hz.
ratio at each frequency, complex.
coupling"coupler", a closed coupler small against the wavelength (IEC 61094-2 Formula (3)), or "series", the air between the microphones in series with each (IEC 61094-5 Table D.1, by the circuit of Jarvis 1996).
coupling_equivalent_volume_m3 at each frequency, complex, in m³.

ImpedancePressureRatio.level_difference_db

Section titled “ImpedancePressureRatio.level_difference_db”

property

, in dB: what the test microphone hears more than the reference.

ImpedancePressureRatio.phase_difference_deg

Section titled “ImpedancePressureRatio.phase_difference_deg”

property

, in degrees.

ImpedancePressureRatio.plot(
ax: Axes | None = None,
*,
quantity: str = 'level',
language: str = 'en',
**kwargs: Any,
) -> Axes

Plot and its standard uncertainty, or , against frequency.

Parameters

NameDescription
axExisting axes to draw on, or None to create a figure.
quantity"level" (default) or "phase".
languageLabel language, "en" (default) or "es".
kwargsForwarded to the curve of .

Returns: The axes. Requires matplotlib (pip install phonometry[plot]).

Raises

ExceptionWhen
ValueErrorfor an unknown quantity.

ImpedancePressureRatio.standard_uncertainty_db

Section titled “ImpedancePressureRatio.standard_uncertainty_db”

property

The level difference taken as the semi-range of a rectangular distribution, , in dB.

This is how Table D.1 of IEC 61094-5 carries the effect, a semi-range of 0,005 dB at 2 kHz giving 0,003 dB, and how 7.5 asks for it when no reference of similar impedance is available: “the size of the error caused should be estimated and added to the uncertainty budget”. It is the "impedance" component of comparison_uncertainty_budget; a calibration that corrects for instead takes only what is left of it. The same row of Table D.1 warns that “when microphones have significantly differing impedances (for example WS2F microphone compared against LS2P at frequencies above 10 kHz), the measurement uncertainty can be considerably larger and should be established experimentally”: there this value is an estimate of the model’s, not a substitute for that experiment.

jig_diameter_correction(
frequencies_hz: ArrayLike | None = None,
) -> JigDiameterCorrection

The corrections of IEC 61094-5:2016 Table A.1 for a type WS3 microphone against a type LS2aP reference in the jig of Figure A.4.

The table gives them at the preferred one-third-octave frequencies from 1 kHz, -0,004 dB, to 20 kHz, -1,443 dB, calculated for a radially symmetrical field and the 0,5 mm diaphragm separation of Figure A.4, “the only one for which the corrections specified in Table A.1 are valid”. A frequency within 2 % of a row, such as an exact base-ten one-third-octave frequency, reads as that row. Pass .correction_db to the comparison as one of its corrections_db and .standard_uncertainty_db to the budget as an additional component.

Parameters

NameDescription
frequencies_hzFrequencies of the table, in Hz, increasing (Default: None, the 14 rows).

Returns: The JigDiameterCorrection.

Raises

ExceptionWhen
ValueErrorfor a frequency the table does not print.
JigCouplerVerification(
frequencies_hz: NDArray[np.float64],
calibration_level_db: NDArray[np.float64],
calibration_uncertainty_db: NDArray[np.float64],
validation_level_db: NDArray[np.float64],
validation_uncertainty_db: NDArray[np.float64],
validation: str,
unvalidated_frequencies_hz: NDArray[np.float64],
*,
shared_standard_uncertainty_db: NDArray[np.float64] = ...,
)

A calibration made in a jig or a coupler set against another calibration of the same microphone (IEC 61094-5:2016 6.7).

The difference of the two sensitivity levels at each frequency both calibrated, , is judged against the expanded uncertainty of that difference: the jig or coupler agrees at a frequency where . 6.7 asks for the validation and prints no criterion; this is the library’s reading of it.

Two independent calibrations give . Two that share a component, the same reference microphone or the same measuring chain, are correlated: each depends on the shared quantity with a sensitivity of 1, so the covariance of the two levels is its variance (JCGM 100:2008 F.1.2.3, Formula (F.2)), and the law of propagation for the difference (5.2.2, Formula (13)) is

the shared part cancelling in the difference. With the coverage factor both expanded uncertainties are reported with (IEC 61094-5 7.9 for a comparison, IEC 61094-2:2009 7.5 for a reciprocity calibration), , the root-sum-square of the parts of the two expanded uncertainties that are each calibration’s own. Only a component that enters both levels with the same sign and size can be shared this way; one that enters them with opposite signs makes the covariance negative and widens the band beyond the root-sum-square, which this verification does not represent.

Attributes

NameDescription
frequencies_hzThe frequencies the two calibrations share, in Hz.
calibration_level_db, the sensitivity level from the jig or coupler being validated, in dB re 1 V/Pa.
calibration_uncertainty_db, its expanded uncertainty (), in dB.
validation_level_db, the sensitivity level it is validated against, in dB re 1 V/Pa.
validation_uncertainty_db, its expanded uncertainty (), in dB.
validation"comparison", a calibration in another jig or coupler or with another source, or "reciprocity".
unvalidated_frequencies_hzThe frequencies of the calibration the validation does not cover, in Hz: 6.7 allows “more than one jig and/or coupler to cover a full frequency range”, each validated where it is used.
shared_standard_uncertainty_db, the standard uncertainty of what the two calibrations share, in dB at each frequency: the calibration of a common reference microphone (the first row of IEC 61094-5 Table D.1), its drift, a common measuring chain, each entering both levels with the same sign and size. One value is spread over every frequency (Default: 0 dB, two independent calibrations).

property

Whether at each frequency, both sides settled to a nanodecibel before they meet.

JigCouplerVerification.correlation_coefficient

Section titled “JigCouplerVerification.correlation_coefficient”

property

, the correlation coefficient of the two levels (JCGM 100:2008 5.2.2, Formula (14)), at each frequency: 0 for two independent calibrations, and towards 1 as the shared part outweighs what each calibration adds to it (F.1.2.3, Example 2). 0 where a calibration carries no uncertainty, and so shares none.

property

, in dB.

JigCouplerVerification.expanded_uncertainty_db

Section titled “JigCouplerVerification.expanded_uncertainty_db”

property

, the expanded uncertainty () of the difference, in dB: the root-sum-square of the two expanded uncertainties when the calibrations share nothing.

JigCouplerVerification.failing_frequencies_hz

Section titled “JigCouplerVerification.failing_frequencies_hz”

property

The frequencies where the two calibrations disagree, in Hz.

JigCouplerVerification.normalised_difference

Section titled “JigCouplerVerification.normalised_difference”

property

, the difference in units of its expanded uncertainty: within where the two agree.

property

The verdict: the two calibrations agree within the expanded uncertainty of their difference at every frequency they share.

True says the jig or coupler is validated for this type of microphone over these frequencies, and no wider: 6.7 asks for “a separate validation […] for each different type of microphone”, and the frequencies in unvalidated_frequencies_hz are not covered.

JigCouplerVerification.plot(
ax: Axes | None = None,
*,
language: str = 'en',
**kwargs: Any,
) -> Axes

Plot the difference of the two calibrations against the expanded uncertainty of the difference, marking where they disagree, with the frequencies the validation does not cover as dashed vertical lines.

Parameters

NameDescription
axExisting axes to draw on, or None to create a figure.
languageLabel language, "en" (default) or "es".
kwargsForwarded to the difference curve.

Returns: The axes. Requires matplotlib (pip install phonometry[plot]).

JigDiameterCorrection(
frequencies_hz: NDArray[np.float64],
correction_db: NDArray[np.float64],
)

The corrections of IEC 61094-5 Table A.1 at the frequencies asked for.

Added to the sensitivity level of a type WS3 microphone calibrated against a type LS2aP reference in the jig of Figure A.4, they account for the radial sensitivity of the two diaphragms and for the smaller one of the test microphone. Their expanded uncertainty is 10 % of their value (A.2 and the NOTE to Table A.1), a component of the budget of Table D.1. None of the three places that give the 10 % states its coverage factor; the library reads it as , the factor 7.9 and D.2 report every expanded uncertainty with.

Attributes

NameDescription
frequencies_hzThe frequencies of the table asked for, in Hz.
correction_dbThe correction at each, in dB.

JigDiameterCorrection.expanded_uncertainty_db

Section titled “JigDiameterCorrection.expanded_uncertainty_db”

property

The expanded uncertainty of each correction, one tenth of its magnitude, in dB (read as , 7.9 and D.2).

JigDiameterCorrection.plot(
ax: Axes | None = None,
*,
language: str = 'en',
**kwargs: Any,
) -> Axes

Plot the corrections with their expanded uncertainty.

Parameters

NameDescription
axExisting axes to draw on, or None to create a figure.
languageLabel language, "en" (default) or "es".
kwargsForwarded to the correction curve.

Returns: The axes. Requires matplotlib (pip install phonometry[plot]).

JigDiameterCorrection.standard_uncertainty_db

Section titled “JigDiameterCorrection.standard_uncertainty_db”

property

The standard uncertainty of each correction, the expanded one over (a reading of 7.9 and D.2, since the 10 % comes without a coverage factor), in dB: the special-case component of Table D.1.

MonitorReadings(
*,
reference_level_db: ArrayLike,
test_level_db: ArrayLike,
reference_phase_deg: ArrayLike | None = None,
test_phase_deg: ArrayLike | None = None,
)

The readings of the monitor microphone that watches the source of a sequential calibration (IEC 61094-5:2016 5.1.3, IEC 61094-8:2012 A.2).

They travel together because they are one instrument’s: the monitor is read in the measurement of each microphone, and each microphone’s output is taken re the monitor reading taken with it, so a source that drifts between the two measurements cancels in the quotient of the two ratios. Its phases are read with its levels when the calibration carries the phase. Pass one to sequential_comparison as monitor.

Parameters

NameDescription
reference_level_db, the monitor’s output level in the measurement of the reference, in dB, one row per determination.
test_level_db, the monitor’s output level in the measurement of the test microphone, in dB.
reference_phase_deg, the monitor’s phase in the measurement of the reference, in degrees (Default: None).
test_phase_deg, the monitor’s phase in the measurement of the test microphone, in degrees (Default: None; given with the other or not at all).

Raises

ExceptionWhen
ValueErrorfor one phase without the other.
rectangular_pulse(
duration_s: float,
*,
amplitude_v: float = 1.0,
) -> RectangularPulse

The rectangular pulse of the direct impulse method (IEC 61094-8:2012 B.6.1).

“A signal that approximates an idealized unit impulse (delta function) can be directly applied to the sound source”, and “in order to have a flat spectrum in the frequency range of interest […] the duration of the input signal needs to be sufficiently short”: its spectrum is Formula (B.10). Give the whole duration ; Formula (B.10) writes it as (docs/ERRATA.md). rectangular_pulse_duration_s gives the duration for an upper limit of frequency.

Parameters

NameDescription
duration_s, in s.
amplitude_v, in V (Default: 1).

Returns: The RectangularPulse.

Raises

ExceptionWhen
ValueErrorfor a duration or an amplitude that is not positive.
rectangular_pulse_duration_s(
upper_frequency_hz: float,
*,
zero_ratio: float = 10.0,
) -> float

The duration of a rectangular pulse whose first spectral zero lies a given factor above the frequencies of interest (IEC 61094-8:2012 B.6.1).

The first zero, , “must be approximately an order of magnitude higher than the upper limit of the frequency range of interest, leading to a requirement for the duration, of just a few microseconds”:

with the factor, 10 by default. For 20 kHz that is 5 µs, a half-duration of 2,5 µs, at which the spectrum has fallen by 0,14 dB.

Parameters

NameDescription
upper_frequency_hz, in Hz.
zero_ratio, the first zero over (Default: 10, an order of magnitude).

Returns: , in s.

Raises

ExceptionWhen
ValueErrorfor a frequency that is not positive or a ratio that is not above 1.
RectangularPulse(duration_s: float, amplitude_v: float = 1.0)

The rectangular pulse of the direct impulse method (IEC 61094-8:2012 B.6.1, Formula (B.10)).

A pulse of amplitude lasting has the spectrum

Formula (B.10), whose first zero is at . The standard calls the duration; the formula and its first zero are those of a pulse lasting (docs/ERRATA.md), and the library follows them.

Attributes

NameDescription
duration_s, how long the pulse lasts, in s.
amplitude_v, the voltage applied to the source, in V.

property

, the area of the pulse, in V·s.

property

, the first zero of the spectrum, in Hz (B.6.1).

property

of Formula (B.10), half the duration, in s.

RectangularPulse.level_db_at(
frequencies_hz: ArrayLike,
) -> NDArray[np.float64]

, how far the spectrum has fallen from its value at 0 Hz, in dB (minus infinity at a zero).

Parameters

NameDescription
frequencies_hzAny frequencies, in Hz.

Returns: The level at each, in dB.

RectangularPulse.plot(
ax: Axes | None = None,
*,
upper_frequency_hz: float | None = None,
language: str = 'en',
**kwargs: Any,
) -> Axes

Plot in dB up to past its second zero, with the first zero and, when given, the upper limit of the frequencies of interest.

Parameters

NameDescription
axExisting axes to draw on, or None to create a figure.
upper_frequency_hzThe upper limit of the frequencies of interest, in Hz, marked with the level the pulse has fallen by there (Default: None).
languageLabel language, "en" (default) or "es".
kwargsForwarded to the spectrum.

Returns: The axes. Requires matplotlib (pip install phonometry[plot]).

RectangularPulse.spectrum_at(
frequencies_hz: ArrayLike,
) -> NDArray[np.float64]

of Formula (B.10), in V·s, the transform of the pulse centred on the time origin, where it is real.

Parameters

NameDescription
frequencies_hzAny frequencies, in Hz.

Returns: at each.

Raises

ExceptionWhen
ValueErrorfor a frequency that is not finite.
ReferenceCalibrationRow(
microphone_types: str,
method: str,
references: tuple[str, ...],
expanded_uncertainty_1khz_db: float,
expanded_uncertainty_10khz_db: float,
)

One row of IEC 61094-8:2012 Table 1: a way the reference microphone’s free-field sensitivity can be known, and the expanded uncertainty () it typically carries.

Attributes

NameDescription
microphone_typesThe reference microphone types the row is for, "LS" or "LS and WS".
methodThe calibration method as the table prints it.
referencesThe documents that define it.
expanded_uncertainty_1khz_dbThe typical expanded uncertainty at 1 kHz, in dB.
expanded_uncertainty_10khz_dbThe same at 10 kHz, in dB.
reflection_free_window_s(
source_distance_m: float,
reflected_path_m: float,
*,
temperature_c: float = 23.0,
static_pressure_kpa: float = 101.325,
relative_humidity_percent: float = 50.0,
) -> float

The longest time window that keeps a reflection outside the effective free-field region (IEC 61094-8:2012 B.1 and B.1.3 a)).

A point on the boundary of the region of Formula (B.1) reflects along a path of the major diameter , from the source to it and on to the microphone, so a reflection whose path is stays outside the region, and out of the window, while

with measured from the arrival of the direct sound. B.1.3 places the window by “the relative distance between source and microphone […] and from the source to the walls or other reflecting objects”; for a plane reflector the path is that of the image of the source in it. The tapered edge the window “normally has” (B.1.2) has to fall within this time too.

Parameters

NameDescription
source_distance_m, the separation of the acoustic centres of the source and the microphone, in m.
reflected_path_m, the length of the shortest reflected path, from the source by the reflector to the microphone, in m.
temperature_cThe air temperature, in °C (Default: 23,0).
static_pressure_kpaThe static pressure, in kPa (Default: 101,325).
relative_humidity_percentThe relative humidity, in % (Default: 50).

Returns: , in s.

Raises

ExceptionWhen
ValueErrorfor a separation that is not positive, a reflected path that is not longer than the direct one, or conditions Annex F refuses.
sequential_comparison(
frequencies_hz: ArrayLike,
reference_sensitivity_level_db: ArrayLike,
reference_output_level_db: ArrayLike,
test_output_level_db: ArrayLike,
*,
monitor: MonitorReadings | None = None,
field: str = 'pressure',
pressure_level_difference_db: ArrayLike = 0.0,
corrections_db: Mapping[str, ArrayLike] | None = None,
reference_environment: EnvironmentalSensitivityCorrection | None = None,
test_environment: EnvironmentalSensitivityCorrection | None = None,
reference_free_field_difference_db: ArrayLike | None = None,
expanded_uncertainty_db: ArrayLike | None = None,
phase: SequentialComparisonPhase | None = None,
) -> ComparisonCalibration

Calibration by comparison with the microphones put in the field in turn (IEC 61094-5:2016 5.1.3 and Annex B; IEC 61094-8:2012 5.2 and Annex A).

The reference and the test microphone take the same place one after the other. Either the exchange does not change the sound pressure significantly, or any change is detected and corrected (IEC 61094-5 5.1.3, IEC 61094-8 5.2), for example with a monitor microphone near the source: the ratio of each microphone’s output to the monitor’s output, and the quotient of the two ratios, “gives the ratio of the microphone under test output voltage to the reference microphone output voltage, corrected for any variation in the sound pressure generated by the source” (IEC 61094-8 A.2). With and the outputs of the reference and the monitor in the first measurement, and and those of the second,

and without a monitor , the plain difference of the two output levels. The sensitivity level of the test microphone then follows by D.2.

Each reading may be one value per frequency or a matrix of one row per determination; the calibration averages the determinations.

Phase (IEC 61094-5 5.1.1, IEC 61094-8 5.1). With the phase of the reference’s sensitivity and the phases of the two outputs, given together as a SequentialComparisonPhase and read against the monitor’s output (its phases in the MonitorReadings) or against the signal driving the source, the calibration carries the phase of the test microphone too, the quotient of the ratios written for their phases:

In a free field the phases are those at the acoustic centres of the microphones (IEC 61094-8 5.1); with each centre placed in turn at the same measurement point (7.3), is 0.

Parameters

NameDescription
frequencies_hzThe frequencies, in Hz, increasing.
reference_sensitivity_level_db, the reference microphone’s sensitivity level, in dB re 1 V/Pa.
reference_output_level_db, the reference microphone’s output level, in dB re any voltage the test microphone is read against too.
test_output_level_db, the test microphone’s output level, in dB re the same voltage.
monitorThe MonitorReadings of a monitor microphone, and in the measurements of the reference and of the test microphone, with their phases when the calibration carries the phase (Default: None, no monitor).
field"pressure" (IEC 61094-5, default) or "free_field" (IEC 61094-8).
pressure_level_difference_db, in dB (Default: 0).
corrections_dbFurther corrections added to the level, by name, in dB (Default: none).
reference_environmentThe EnvironmentalSensitivityCorrection of the reference, added (Default: None).
test_environmentThe EnvironmentalSensitivityCorrection of the test microphone, subtracted (Default: None).
reference_free_field_difference_dbThe reference’s free-field to pressure sensitivity level difference (IEC/TS 61094-7), free field only, in dB; carried in corrections_db as "reference free-field difference" (Default: None).
expanded_uncertainty_dbThe expanded uncertainty () of the result at each frequency, in dB (Default: None).
phaseThe SequentialComparisonPhase of the calibration: the reference’s phase, the output phases and (Default: None, a calibration of the level alone).

Returns: The ComparisonCalibration.

Raises

ExceptionWhen
ValueErrorfor an unknown field, a free-field correction on a pressure calibration, an environmental correction made at other frequencies, readings whose numbers of determinations disagree, any column that is not one finite value per frequency, or monitor phases without the output phases.
SequentialComparisonPhase(
*,
reference_sensitivity_phase_deg: ArrayLike,
reference_output_phase_deg: ArrayLike,
test_output_phase_deg: ArrayLike,
pressure_phase_difference_deg: ArrayLike | None = None,
)

The phase inputs of a calibration by sequential excitation (IEC 61094-5:2016 5.1.1, IEC 61094-8:2012 5.1).

They travel together because the phase of the test microphone needs all of them at once: the phase of the reference’s sensitivity it is carried over from, and the phases of the two outputs, read against the monitor’s output or against the signal driving the source; completes them where the pressures on the two microphones differ in phase. The monitor’s own phases are read with its levels, in MonitorReadings. Pass one to sequential_comparison as phase.

Parameters

NameDescription
reference_sensitivity_phase_deg, the phase of the reference’s sensitivity, in degrees, one value or one per frequency.
reference_output_phase_degThe phase of the reference microphone’s output, in degrees, one row per determination.
test_output_phase_degThe phase of the test microphone’s output, in degrees, one row per determination.
pressure_phase_difference_deg, in degrees (Default: None, 0).
simultaneous_comparison(
frequencies_hz: ArrayLike,
reference_sensitivity_level_db: ArrayLike,
channel_difference_db: ArrayLike,
interchanged_channel_difference_db: ArrayLike | None = None,
*,
field: str = 'pressure',
pressure_level_difference_db: ArrayLike = 0.0,
corrections_db: Mapping[str, ArrayLike] | None = None,
reference_environment: EnvironmentalSensitivityCorrection | None = None,
test_environment: EnvironmentalSensitivityCorrection | None = None,
reference_free_field_difference_db: ArrayLike | None = None,
expanded_uncertainty_db: ArrayLike | None = None,
phase: SimultaneousComparisonPhase | None = None,
) -> ComparisonCalibration

Calibration by comparison with both microphones in the field at once (IEC 61094-5:2016 5.1.2 and Annex C; IEC 61094-8:2012 5.3).

Each microphone is read on its own measuring channel. With the reference on channel 1, the level reading difference between the channels is Formula (C.1),

and after the microphones are interchanged, in the coupler ports and on the preamplifiers, it is Formula (C.2). Their difference leaves the two sensitivity levels alone, whatever the gains of the channels and the asymmetry of the field, Formula (C.3):

so , and the sensitivity level of the test microphone follows by D.2. A pressure calibration requires the interchange (“the microphones shall be interchanged, and the measurement repeated”, 5.1.2). A free-field one does not (5.3 relies on a symmetrical field instead); without it, the channel difference is taken as , which assumes channels of equal gain.

Each reading may be one value per frequency or a matrix of one row per determination (the three repeats of D.2, say); the calibration averages the determinations.

Phase (IEC 61094-5 5.1.1, IEC 61094-8 5.1). With the phase of the reference’s sensitivity and the phase readings of the two channels, given together as a SimultaneousComparisonPhase, the calibration carries the phase of the test microphone too. The phase of each channel’s reading re the other’s adds up as its level does in (C.1) and (C.2), so their difference cancels the phase shifts of the channels and of the field:

with the difference of the two readings taken into one turn before it is halved, so the result is unique while the two microphones differ by less than 90°. Without the interchange, is taken as . Neither part prints this form; it is (C.3) written for the complex ratio the sensitivity “both modulus and phase” is.

Parameters

NameDescription
frequencies_hzThe frequencies, in Hz, increasing.
reference_sensitivity_level_db, the reference microphone’s sensitivity level, in dB re 1 V/Pa, one value or one per frequency. For a free-field calibration it is the reference’s free-field level, or its pressure level with reference_free_field_difference_db.
channel_difference_db, the reading of channel 1 less that of channel 2 with the reference on channel 1, in dB.
interchanged_channel_difference_db, the same difference after the interchange, the test microphone on channel 1, in dB (Default: None; required for field="pressure").
field"pressure" (IEC 61094-5, default) or "free_field" (IEC 61094-8).
pressure_level_difference_db, the effective sound pressure on the test microphone re that on the reference, in dB (Default: 0, the ratio reduced to unity).
corrections_dbFurther corrections added to the level, by name, in dB, such as jig_diameter_correction(f).correction_db (Default: none).
reference_environmentThe EnvironmentalSensitivityCorrection that takes the reference’s level from the conditions of its calibration to those of the test, added (Default: None).
test_environmentThe EnvironmentalSensitivityCorrection of the test microphone from the reference conditions to those of the test, subtracted to refer the result to the reference conditions (Default: None, the result is at the conditions of the test).
reference_free_field_difference_dbThe reference’s free-field to pressure sensitivity level difference (IEC/TS 61094-7), added to a pressure-calibrated reference in a free-field calibration only, in dB; the result carries it in corrections_db as "reference free-field difference" (Default: None).
expanded_uncertainty_dbThe expanded uncertainty () of the result at each frequency, in dB, as comparison_uncertainty_budget gives it (Default: None).
phaseThe SimultaneousComparisonPhase of the calibration: the reference’s phase, the phase readings and (Default: None, a calibration of the level alone).

Returns: The ComparisonCalibration.

Raises

ExceptionWhen
ValueErrorfor an unknown field, a pressure calibration without the interchange, a free-field correction on a pressure calibration, an environmental correction made at other frequencies, readings whose numbers of determinations disagree, any column that is not one finite value per frequency, or phase readings that do not follow the level readings.
SimultaneousComparisonPhase(
*,
reference_sensitivity_phase_deg: ArrayLike,
channel_phase_difference_deg: ArrayLike,
interchanged_channel_phase_difference_deg: ArrayLike | None = None,
pressure_phase_difference_deg: ArrayLike | None = None,
)

The phase inputs of a calibration by simultaneous excitation (IEC 61094-5:2016 5.1.1, IEC 61094-8:2012 5.1).

They travel together because the phase of the test microphone needs all of them at once: the phase of the reference’s sensitivity it is carried over from, and the phase readings of the two channels that carry it, given as the level readings are; completes them where the pressures on the two microphones differ in phase. Pass one to simultaneous_comparison as phase.

Parameters

NameDescription
reference_sensitivity_phase_deg, the phase of the reference’s sensitivity, in degrees, one value or one per frequency.
channel_phase_difference_deg, the phase of channel 1’s reading re channel 2’s with the reference on channel 1, in degrees, one row per determination.
interchanged_channel_phase_difference_deg, the same after the interchange, in degrees (Default: None; given exactly when the interchanged level reading is).
pressure_phase_difference_deg, the phase of the effective sound pressure on the test microphone re that on the reference, in degrees (Default: None, 0).
stepped_sine_impulse_response(
frequencies_hz: ArrayLike,
response: ArrayLike,
) -> SteppedSineImpulseResponse

The impulse response of a frequency response measured at linearly spaced frequencies (IEC 61094-8:2012 B.2, Formula (B.3)).

“When the full range frequency response can be measured, an inverse Fourier transform, Equation B.3, can be applied to transform this response to the time domain, where time selective processes can be applied” (B.2.1),

computed by the inverse FFT, which needs “the frequency response to be measured at discrete frequencies and linearly spaced frequency increments” and a range extended to 0 Hz: “the low frequency response can be estimated from a knowledge of the pressure sensitivities of the microphones”, and the measurement should reach “about three times the resonance frequency of the microphones”. The axis therefore starts at 0 Hz, holds frequencies , and the response is taken as that of a real : the negative frequencies are the complex conjugates of the positive ones, and the imaginary part of the value at 0 Hz, which a real response does not have, is dropped. The result has samples at and lasts , which has to be long enough “to include” the reflections that matter (B.2.2): 120 Hz in a small anechoic room whose primary reflections all arrive before 8 ms, about 30 Hz in a large one.

Parameters

NameDescription
frequencies_hz, from 0 Hz, in Hz, equally spaced.
response, complex, one value per frequency.

Returns: The SteppedSineImpulseResponse; pass its impulse_response and sample_rate_hz to time_selective_response.

Raises

ExceptionWhen
ValueErrorfor fewer than two frequencies, an axis that does not start at 0 Hz or is not equally spaced, or a response that is not one finite value per frequency.
SteppedSineImpulseResponse(
frequency_step_hz: float,
impulse_response: NDArray[np.float64],
)

The impulse response of a stepped-sine measurement (IEC 61094-8:2012 B.2, Formula (B.3)).

Attributes

NameDescription
frequency_step_hz, the step of the measured frequencies, in Hz.
impulse_response at , in the unit of the response per second.

property

, how long the impulse response lasts, in s: “the length of the impulse response will be the inverse of the size of the frequency step” (B.2.2).

SteppedSineImpulseResponse.plot(
ax: Axes | None = None,
*,
language: str = 'en',
**kwargs: Any,
) -> Axes

Plot the impulse response against time.

Parameters

NameDescription
axExisting axes to draw on, or None to create a figure.
languageLabel language, "en" (default) or "es".
kwargsForwarded to the curve.

Returns: The axes. Requires matplotlib (pip install phonometry[plot]).

property

, in Hz.

property

The time of each sample, in s.

time_selective_response(
impulse_response: ArrayLike,
sample_rate_hz: float,
*,
window_start_s: float,
window_end_s: float,
window_shape: str = 'tukey',
taper_fraction: float = 0.25,
excitation: RectangularPulse | None = None,
) -> TimeSelectiveResponse

The frequency response of the direct sound alone, through a time window (IEC 61094-8:2012 Annex B).

“An impulse response (IR) can be obtained from the measured output of the reference microphone or device under test, which separates the direct and reflected energy components […] enabling the two to be separated by applying a time window” (B.1.1); “a time-domain to frequency-domain transformation can then be used to obtain the desired frequency response”. The window is a weighting function that is zero outside the chosen interval (B.1.3); a rectangular one “is not recommended because it usually leads to spectral leakage”, so the default is a Tukey window, flat in the middle with cosine-tapered edges. Its placement and duration are the user’s, by the three criteria of B.1.3: the distances from the source to the microphone and to the reflectors (see reflection_free_window_s), the supporting structure beyond the rod, and a look at the impulse response.

The impulse response may come from any method of Annex B: a stepped sine by stepped_sine_impulse_response, a sweep or a maximum length sequence by phonometry.room.impulse_response and phonometry.room.mls_impulse_response, or a direct impulse (B.6), in which case excitation divides the spectrum of the pulse out. The reference and the test microphone are windowed alike, and the levels of their responses at the calibration frequencies go to sequential_comparison as the two output levels.

Parameters

NameDescription
impulse_responseThe impulse response, one value per sample, from the start of the record.
sample_rate_hzIts sample rate, in Hz.
window_start_sWhere the window begins, in s from the start of the record: before the direct sound arrives.
window_end_sWhere it ends, in s: before the first reflection.
window_shape"tukey" (default), "hann", "hamming" or "rectangular".
taper_fractionThe fraction of a Tukey window that is taper, half at each edge (Default: 0,25).
excitationThe RectangularPulse of a direct impulse measurement, divided out of the response (Default: None).

Returns: The TimeSelectiveResponse.

Raises

ExceptionWhen
ValueErrorfor what TimeSelectiveResponse refuses.
TimeSelectiveResponse(
impulse_response: NDArray[np.float64],
sample_rate_hz: float,
window_start_s: float,
window_end_s: float,
window_shape: str = 'tukey',
taper_fraction: float = 0.25,
excitation: RectangularPulse | None = None,
)

The frequency response of the direct sound alone, an impulse response weighted with a time window and transformed (IEC 61094-8:2012 B.1.3 and B.2).

The window keeps the samples from window_start_s to window_end_s, counted from the start of the record, with tapered edges, and response_at transforms them by Formula (B.2), , at any frequency. With an excitation, the transform is divided by the pulse’s, as a pulse that begins at the start of the record.

Attributes

NameDescription
impulse_responseThe impulse response, sampled.
sample_rate_hzIts sample rate, in Hz.
window_start_sWhere the window begins, in s.
window_end_sWhere it ends, in s.
window_shape"tukey", "hann", "hamming" or "rectangular".
taper_fractionThe fraction of a Tukey window that is taper, half at each edge.
excitationThe RectangularPulse the response was taken with, divided out, or None.
TimeSelectiveResponse.free_field_region(
source_distance_m: float,
arrival_time_s: float,
*,
temperature_c: float = 23.0,
static_pressure_kpa: float = 101.325,
relative_humidity_percent: float = 50.0,
) -> FreeFieldRegion

The effective free-field region of this window (B.1, Formula (B.1)), with “the time from the arrival of the sound at the microphone under test, to the end of the time window”.

Parameters

NameDescription
source_distance_m, in m.
arrival_time_sWhen the direct sound reaches the microphone, in s from the start of the record.
temperature_cThe air temperature, in °C (Default: 23,0).
static_pressure_kpaThe static pressure, in kPa (Default: 101,325).
relative_humidity_percentThe relative humidity, in % (Default: 50).

Returns: The FreeFieldRegion.

Raises

ExceptionWhen
ValueErrorfor an arrival at or after the end of the window, or what free_field_region refuses.

TimeSelectiveResponse.frequency_resolution_hz

Section titled “TimeSelectiveResponse.frequency_resolution_hz”

property

The inverse of the window length, in Hz: the spacing of the frequencies the window can tell apart, as B.2.2 relates the length of an impulse response to its frequency step.

TimeSelectiveResponse.level_db_at(
frequencies_hz: ArrayLike,
) -> NDArray[np.float64]

, in dB re 1 of the response’s unit times a second.

Parameters

NameDescription
frequencies_hzThe frequencies, in Hz, increasing.

Returns: The level at each, in dB.

TimeSelectiveResponse.phase_deg_at(
frequencies_hz: ArrayLike,
) -> NDArray[np.float64]

, in degrees, with the time origin at the start of the record.

Parameters

NameDescription
frequencies_hzThe frequencies, in Hz, increasing.

Returns: The phase at each, in degrees.

TimeSelectiveResponse.plot(
ax: Axes | None = None,
*,
quantity: str = 'impulse',
frequencies_hz: ArrayLike | None = None,
language: str = 'en',
**kwargs: Any,
) -> Axes

Plot the impulse response with the window over it, or the level of with and without the window.

Parameters

NameDescription
axExisting axes to draw on, or None to create a figure.
quantity"impulse" (default) or "response".
frequencies_hzThe frequencies of the response, in Hz (Default: None, 200 from the frequency resolution to a quarter of the sample rate, or, with an excitation, to a tenth of the first zero of its spectrum if that is lower, B.6.1).
languageLabel language, "en" (default) or "es".
kwargsForwarded to the windowed curve.

Returns: The axes. Requires matplotlib (pip install phonometry[plot]).

Raises

ExceptionWhen
ValueErrorfor an unknown quantity.

TimeSelectiveResponse.record_response_at()

Section titled “TimeSelectiveResponse.record_response_at()”
TimeSelectiveResponse.record_response_at(
frequencies_hz: ArrayLike,
) -> NDArray[np.complex128]

of the whole record with no window, the reflections included: what the window takes away, for comparison.

Parameters

NameDescription
frequencies_hzThe frequencies, in Hz, increasing.

Returns: at each.

Raises

ExceptionWhen
ValueErrorfor frequencies that are not positive and increasing.
TimeSelectiveResponse.response_at(
frequencies_hz: ArrayLike,
) -> NDArray[np.complex128]

, Formula (B.2) applied to the windowed response, at each frequency, complex, in the unit of the response times seconds (divided by the pulse’s spectrum, in V·s, when there is one).

Parameters

NameDescription
frequencies_hzThe frequencies, in Hz, increasing.

Returns: at each.

Raises

ExceptionWhen
ValueErrorfor frequencies that are not positive and increasing, or, with an excitation, a frequency at or above the first zero of its spectrum.

property

The time of each sample from the start of the record, in s.

property

The window at each sample of the record, 0 outside it.

property

How long the window lasts, in s.

TimeSelectiveResponse.windowed_impulse_response

Section titled “TimeSelectiveResponse.windowed_impulse_response”

property

The impulse response times the window.

verify_jig_or_coupler(
calibration: ComparisonCalibration,
validation: ComparisonCalibration | ReciprocityCalibration,
*,
microphone: int | None = None,
shared_standard_uncertainty_db: ArrayLike = 0.0,
) -> JigCouplerVerification

Does a jig or coupler give the same calibration as another way of calibrating the same microphone (IEC 61094-5:2016 6.7)?

“Calibrations performed in any particular jig or coupler shall be validated by comparison with calibrations performed in other jigs and couplers and alternative sound sources. A separate validation is necessary for each different type of microphone. If the test microphone is a laboratory standard microphone, then the jig or coupler can be validated by comparing a comparison calibration with a reciprocity calibration” (6.7). Pass the calibration from the jig or coupler under validation, and either a calibration of the same microphone by comparison elsewhere (another jig or coupler, another source) or its reciprocity calibration with microphone, the index of the microphone among those the reciprocity calibration holds. The two are compared at the frequencies they share.

The clause prints no criterion. The library reads “validated” as the two agreeing within the expanded uncertainty of their difference, each calibration’s expanded uncertainty reported with (7.9 for a comparison, IEC 61094-2:2009 7.5 for a reciprocity calibration): . Two independent calibrations give the root-sum-square, . Two that share a component entering both levels with the same sign and size, the same reference microphone (the first row of Table D.1) or the same measuring chain, are correlated, and the root-sum-square counts twice what cancels in their difference: give that component’s standard uncertainty as shared_standard_uncertainty_db, and the GUM law of propagation for correlated inputs (JCGM 100:2008 5.2.2 with the covariance of F.1.2.3, Formula (F.2)) gives , that is . A shared part cannot be larger than either calibration’s standard uncertainty, .

A reciprocity calibration made in the same set of three microphones as the reference’s is not such a case. In IEC 61094-2:2009 Formula (7) the electrical transfer impedances of the two pairs that go through the third microphone are in the numerator of one microphone’s sensitivity and in the denominator of the other’s, so those pair measurements enter the two levels with opposite signs: their covariance is negative, and the uncertainty of the difference exceeds the root-sum-square, which shared_standard_uncertainty_db cannot express. Only the factors common to both levels, with the same sign, may be given here.

Parameters

NameDescription
calibrationThe pressure calibration by comparison made in the jig or coupler, with its expanded uncertainty.
validationThe calibration it is validated against: a ComparisonCalibration or a ReciprocityCalibration, in a pressure field, with its expanded uncertainty.
microphoneFor a reciprocity calibration, the index of the microphone that was compared (Default: None).
shared_standard_uncertainty_db, the standard uncertainty of what the two calibrations share, in dB: one value, or one per frequency of calibration (Default: 0 dB, two independent calibrations).

Returns: The JigCouplerVerification.

Raises

ExceptionWhen
ValueErrorfor a calibration or validation that is not a pressure calibration or carries no expanded uncertainty, a reciprocity calibration without microphone (or a comparison with one), a microphone it does not hold, no frequency in common, or a shared standard uncertainty that is negative, not one value per frequency of calibration, larger than the standard uncertainty of either calibration, or all of both.
TypeErrorfor a validation that is neither calibration.