Skip to content
This documentation describes version 4.0.0, which is not released yet. The current version on PyPI is 3.3.0 and does not carry everything described here.

metrology.reciprocity_calibration

Primary calibration of laboratory standard microphones by reciprocity: the sensitivities that come out of three pair measurements, and the uncertainty budget that goes with them (IEC 61094-2:2009 clause 5.7 and clause 7, IEC 61094-3:2016 clause 5.7 and clause 7).

A reciprocity calibration needs no reference microphone. Two microphones are coupled acoustically, one drives and the other receives, and the electrical transfer impedance that is measured is the product of their two sensitivities times the acoustic transfer impedance of whatever couples them, which is computed:

In a coupler (IEC 61094-2) is the acoustic impedance of the enclosed gas, worked out in reciprocity_coupler; in a free field (IEC 61094-3) it is that of a spherical wave between the two acoustic centres, worked out in reciprocity_free_field. Either way three pairs taken from three microphones give three products, and each sensitivity follows from them alone:

which is Formula (7) of IEC 61094-2 and Formula (8) of IEC 61094-3. With two microphones and an auxiliary sound source, the ratio measured against the source replaces the third pair (Formula (8) of the first part, Formula (9) of the second): .

The sign of a square root. Reciprocity fixes the products, and a product does not change when every sensitivity changes sign together, so no measurement of this kind can tell from . Both parts ask for the phase to be referred to the full four-quadrant range, 0 to (5.7.1 of each: a NOTE in IEC 61094-2, the running text in IEC 61094-3); the library takes the square root on the branch that is continuous in frequency and has a non-negative real part at the lowest frequency, then fixes the other two microphones by the products, so that the three are consistent with every product at every frequency. The modulus does not depend on the choice.

Uncertainty. Both parts list the components of a calibration in their Table 1 (IEC61094_2_TABLE_1, IEC61094_3_TABLE_1) and ask for each as a standard uncertainty as a function of frequency, in linear or logarithmic form (7.5 of the first part, 7.8 of the second). reciprocity_uncertainty_budget combines them in quadrature at each frequency and multiplies by the coverage factor: in IEC 61094-2 7.5, and the factor for a 95 % coverage probability in IEC 61094-3 7.8, which is 2 for a combination dominated by many comparable components. The components the acoustic transfer impedance contributes are found, as both parts describe, by “repeating a calculation while the various components are changed one at a time by their associated uncertainty”: coupler_parameter_uncertainty and free_field_parameter_uncertainty do that.

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

Constant (mapping).

Constant (mapping).

reciprocity_uncertainty_budget(
frequencies_hz: ArrayLike,
standard_uncertainties_db: Mapping[str, ArrayLike],
*,
field: str = 'pressure',
additional_components_db: Mapping[str, ArrayLike] | None = None,
coverage_factor: float = 2.0,
) -> ReciprocityUncertaintyBudget

The uncertainty budget of a reciprocity calibration (IEC 61094-2:2009 7.5, IEC 61094-3:2016 7.8).

Each component is the standard uncertainty of the sensitivity level it causes, in dB, one value or one per frequency, keyed by the names of the field’s Table 1 (IEC61094_2_TABLE_1, IEC61094_3_TABLE_1). Neither table is exhaustive (“Not all of the components may be relevant in a given calibration setup”), so a component may be left out and additional_components_db adds others. The components that come from the acoustic transfer impedance are what coupler_parameter_uncertainty and free_field_parameter_uncertainty return, keyed the same way.

The combination is the root-sum-square at each frequency; the expanded uncertainty is times it, with as IEC 61094-2 7.5 states. IEC 61094-3 7.8 asks for the factor of a 95 % coverage probability, which is 2 for a budget of many comparable components; a caller whose budget is dominated by one component with few degrees of freedom passes its own.

Parameters

NameDescription
frequencies_hzThe frequencies, in Hz, increasing.
standard_uncertainties_dbThe components, keyed by name, each a standard uncertainty in dB, one value or one per frequency.
field"pressure" (default) or "free_field".
additional_components_dbFurther components, by name, in the same form (Default: none).
coverage_factor (Default: 2).

Returns: The ReciprocityUncertaintyBudget.

Raises

ExceptionWhen
ValueErrorfor a key that is not in the field’s Table 1, an additional component with the name of another, no component at all, or a value that is negative or not finite.
ReciprocityCalibration(
frequencies_hz: NDArray[np.float64],
sensitivity_v_per_pa: NDArray[np.complex128],
products_v2_per_pa2: NDArray[np.complex128],
field: str,
method: str,
corrections_db: Mapping[str, NDArray[np.float64]],
expanded_uncertainty_db: NDArray[np.float64] | None = None,
)

The complex sensitivities of microphones calibrated by reciprocity (IEC 61094-2:2009 5.7 in a coupler, IEC 61094-3:2016 5.7 in a free field).

Built by pressure_reciprocity, pressure_reciprocity_pair, free_field_reciprocity and free_field_reciprocity_pair.

Attributes

NameDescription
frequencies_hzThe frequencies, in Hz.
sensitivity_v_per_paThe complex sensitivity of each microphone, one row per microphone, in V/Pa: the pressure sensitivity in a coupler, the free-field sensitivity in a free field.
products_v2_per_pa2The product of the two sensitivities of each pair, one row per pair (12, 23, 31 in the three-microphone method, 12 alone with an auxiliary source), in V²/Pa².
field"pressure" (IEC 61094-2) or "free_field" (IEC 61094-3).
method"three_microphones" or "auxiliary_source".
corrections_dbCorrections added to every microphone’s sensitivity level, by name, in dB at each frequency: the wave-motion correction of IEC 61094-2 Table C.3 for a large-volume coupler, say.
expanded_uncertainty_dbThe expanded uncertainty of the sensitivity level at each frequency, in dB, or None.

property

, the corrections added to every level, in dB.

property

The number of microphones calibrated: 3, or 2 with a source.

property

The phase of each sensitivity, in degrees from 0 to 360 (5.7.1 of both parts: a NOTE in IEC 61094-2, the running text in IEC 61094-3).

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

Plot the sensitivity level of each microphone against frequency, with the expanded uncertainty as a band when it is known.

Parameters

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

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

ReciprocityCalibration.sensitivity_level_db

Section titled “ReciprocityCalibration.sensitivity_level_db”

property

, one row per microphone, in dB re 1 V/Pa.

ReciprocityCalibration.sensitivity_mv_per_pa

Section titled “ReciprocityCalibration.sensitivity_mv_per_pa”

property

The modulus of each sensitivity with the corrections, in mV/Pa.

property

The designation the calibration follows.

ReciprocityUncertaintyBudget(
frequencies_hz: NDArray[np.float64],
field: str,
names: tuple[str, ...],
components: tuple[str, ...],
standard_uncertainties_db: NDArray[np.float64],
coverage_factor: float = 2.0,
)

The uncertainty budget of a reciprocity calibration as a function of frequency (IEC 61094-2:2009 7.5 and Table 1, IEC 61094-3:2016 7.8 and Table 1).

Every component is a standard uncertainty of the sensitivity level in dB at each frequency; they are combined in quadrature and multiplied by the coverage factor.

Attributes

NameDescription
frequencies_hzThe frequencies, in Hz.
field"pressure" (IEC 61094-2) or "free_field" (IEC 61094-3).
namesThe key of each component, those of the field’s Table 1 in its order, then any additional ones.
componentsThe component as the table prints it, or the name of an additional one.
standard_uncertainties_db, one row per component, in dB.
coverage_factor.

ReciprocityUncertaintyBudget.combined_uncertainty_db

Section titled “ReciprocityUncertaintyBudget.combined_uncertainty_db”

property

, in dB.

ReciprocityUncertaintyBudget.expanded_uncertainty_db

Section titled “ReciprocityUncertaintyBudget.expanded_uncertainty_db”

property

, in dB.

ReciprocityUncertaintyBudget.linear_combined_uncertainty_db

Section titled “ReciprocityUncertaintyBudget.linear_combined_uncertainty_db”

property

combined in linear form, in dB.

Each component converted to a relative uncertainty , combined in quadrature and converted back by : the linear form 7.5 of the first part and 7.8 of the second prefer, while accepting the logarithmic one “as the values are very small”.

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

Plot each standard uncertainty and the expanded uncertainty against frequency.

Parameters

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

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

property

The designation whose Table 1 the budget follows.

ReciprocityUncertaintyRow(
component: str,
group: str,
subclauses: tuple[str, ...] = (),
)

One row of Table 1 of IEC 61094-2:2009 or IEC 61094-3:2016, “Uncertainty components”.

Attributes

NameDescription
componentThe measured quantity as the table prints it.
groupThe heading the table lists it under.
subclausesThe subclauses or annexes the table refers it to; empty where the table prints none.