Ir al contenido

electroacoustics.microphone

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.

Rated microphone characteristics (IEC 60268-4).

A microphone measurement/rating report gathers the rated characteristics IEC 60268-4:2014 defines around a measured free-field frequency response: the free-field sensitivity and its level re 1 V/Pa (clauses 11.1/11.2.1), the frequency response with the manufacturer’s tolerance (12.1) and the effective frequency range read against that tolerance (12.2), the directional pattern and the directivity index (13.1/13.2), the equivalent sound pressure level due to inherent noise (17), the overload sound pressure level at a stated total-harmonic-distortion limit (14.2/15.2), the rated impedance and the rated minimum permitted load impedance (10.2/10.3) and the rated power supply (9.1). This module bundles those into a single MicrophoneCharacteristics result whose report method renders the IEC 60268-4 rated-characteristics fiche, with the characteristic graphs laid out to the IEC 60263:1982 scale conventions.

Four of the characteristics are computed from the standard’s own definitions so the report never merely repeats a manufacturer number:

  • Sensitivity level (11.1). The sensitivity M is the ratio of the output voltage to the sound pressure, in volts per pascal; its level is

    the rated sensitivity referring to the standard reference frequency of 1 000 Hz (11.3). This is the first clean-room oracle: 12.5 mV/Pa returns dB re 1 V/Pa exactly.

  • Effective frequency range (12.2). The range of frequencies over which the response does not deviate by more than a specified amount from the ideal (flat) response through the reference-frequency level. The band edges are the interpolated frequencies where the relative response crosses the +/- tolerance limits on either side of the reference frequency, which is the second oracle: a response crossing a limit at chosen frequencies returns exactly those frequencies.

  • Directivity index (13.2.2). where the diffuse-field sensitivity of a rotationally symmetric pattern follows 11.2.2 a):

    For the ideal cardioid the integral is , so dB, the third oracle.

  • Equivalent sound pressure level due to inherent noise (17.2 d/e). The equivalent sound pressure is the ratio of the weighted inherent-noise output voltage to the rated free-field sensitivity, , and its level is with uPa, the fourth oracle. The overload sound pressure level (15.2.2) is read from a measured distortion-against-level curve as the interpolated sound pressure level where the distortion reaches the specified limit.

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

microphone_characteristics(
response_db: NumericArrayLike,
sensitivity_mv_per_pa: float,
*,
frequencies: NumericArrayLike,
reference_frequency_hz: float = 1000.0,
tolerance_db: float = 2.0,
directivity: MicrophoneDirectivity = ...,
noise: MicrophoneNoise = ...,
overload: MicrophoneOverload = ...,
electrical: MicrophoneElectrical = ...,
) -> MicrophoneCharacteristics

Assemble the rated microphone characteristics for an IEC 60268-4 report.

The sensitivity level (11.1), the effective frequency range (12.2), the directivity index (13.2.2, when a rear-reaching pattern is supplied) and the equivalent noise level (17.2, when the noise voltage is supplied) are computed from the standard’s definitions; the optional directional, noise and distortion data feed the corresponding report panels.

The optional rated characteristics are grouped as the standard groups them, one bundle per clause, so each may be omitted whole.

Parameters

Name Description
frequencies Free-field response frequency axis, in Hz (1-D, > 0).
response_db Free-field frequency response, in dB, relative to the output at a stated frequency (12.1.1); it is re-normalized to 0 dB at reference_frequency_hz.
sensitivity_mv_per_pa Rated free-field sensitivity M at the reference frequency, in mV/Pa (11.2.1/11.3).
reference_frequency_hz Stated reference frequency, in Hz; the 11.3 standard reference frequency of 1 000 Hz by default.
tolerance_db Half-width of the response tolerance, in dB (default 2), defining the effective frequency range (12.2).
directivity Directional characteristics of Clause 13 as a MicrophoneDirectivity: the directional pattern, its stated frequency and the directivity index.
noise Inherent noise of Clause 17 as a MicrophoneNoise: the weighted noise voltage or the stated equivalent noise level, its weighting and the noise spectrum.
overload Limiting characteristic of 15.2 with the 14.2 distortion curve it is read from, as a MicrophoneOverload.
electrical Electrical impedance (Clause 10) and rated power supply (Clause 9) as a MicrophoneElectrical.

Returns: A MicrophoneCharacteristics.

Raises

Exception When
ValueError If the inputs are invalid.
TypeError if reference_frequency_hz, sensitivity_mv_per_pa or tolerance_db is not a single number.
MicrophoneCharacteristics(
frequencies: NDArray[np.float64],
response_db: NDArray[np.float64],
reference_frequency_hz: float,
sensitivity_mv_per_pa: float,
sensitivity_level: float,
tolerance_db: float,
effective_range: tuple[float, float],
rated_impedance_ohm: float | None,
min_load_impedance_ohm: float | None,
equivalent_noise_level: float | None,
noise_weighting: Literal['A', '468'],
max_spl: float | None,
max_spl_thd_percent: float,
distortion_spl: NDArray[np.float64] | None,
distortion_thd_percent: NDArray[np.float64] | None,
noise_frequencies: NDArray[np.float64] | None,
noise_band_levels: NDArray[np.float64] | None,
polar_angles_deg: NDArray[np.float64] | None,
polar_response_db: NDArray[np.float64] | None,
polar_frequency: float | None,
directivity_index: float | None,
powering: str | None,
supply_current_ma: float | None,
)

Rated microphone characteristics for an IEC 60268-4 report.

The free-field frequency response and the rated free-field sensitivity are the required inputs; the directional pattern, the inherent-noise spectrum and the distortion-against-level curve are optional panels rendered when supplied. The sensitivity level, the effective frequency range, the directivity index and the equivalent noise level are computed from the standard’s definitions (see the module docstring).

Attributes

Name Description
frequencies Free-field response frequency axis, in Hz.
response_db Free-field frequency response relative to the level at reference_frequency_hz (0 dB there), in dB (12.1.1).
reference_frequency_hz Stated reference frequency of the rated sensitivity and the response normalization, in Hz (11.3).
sensitivity_mv_per_pa Rated free-field sensitivity M at the reference frequency, in mV/Pa (11.2.1/11.3).
sensitivity_level Sensitivity level , in dB re 1 V/Pa (11.1).
tolerance_db Half-width of the response tolerance, in dB (12.1.1).
effective_range Computed effective frequency range (lo, hi) against the tolerance limits, in Hz (12.2).
rated_impedance_ohm Rated (internal) impedance, in ohm (10.2), or None.
min_load_impedance_ohm Rated minimum permitted load impedance, in ohm (10.3), or None.
equivalent_noise_level Equivalent sound pressure level due to inherent noise, in dB SPL with noise_weighting weighting (17), or None.
noise_weighting Weighting of the inherent-noise measurement (IEC 60268-1), "A" by default or "468".
max_spl Overload sound pressure level at max_spl_thd_percent total harmonic distortion, in dB SPL (15.2), or None.
max_spl_thd_percent Distortion limit defining max_spl, in % (15.2.1).
distortion_spl Distortion-curve sound-pressure-level axis, in dB SPL (14.2), or None.
distortion_thd_percent Total harmonic distortion against level, in % (14.2), or None.
noise_frequencies Inherent-noise spectrum frequency axis, in Hz (17.2 b), or None.
noise_band_levels Inherent-noise equivalent band levels, in dB SPL (17.2 b), or None.
polar_angles_deg Directional-pattern angles, in degrees (13.1), or None.
polar_response_db Directional pattern relative to the reference-axis response, in dB (13.1.2), or None.
polar_frequency Stated frequency of the directional pattern, in Hz, or None.
directivity_index Directivity index at polar_frequency, in dB (13.2), or None.
powering Rated power supply description, e.g. the IEC 61938 phantom-powering designation and voltage (9.1), or None.
supply_current_ma Current drawn from the power supply, in mA (9.1), or None.

MicrophoneCharacteristics.diffuse_field_sensitivity_level

Section titled “MicrophoneCharacteristics.diffuse_field_sensitivity_level”

property

Diffuse-field sensitivity level, in dB re 1 V/Pa, or None.

Per 11.2.2.1 the diffuse-field sensitivity level equals the free-field plane-wave sensitivity level minus the directivity index (13.2).

MicrophoneCharacteristics.plot(
ax: PolarAxes | None = None,
*,
quantity: Literal['directivity'],
language: Literal['en', 'es'] = 'en',
**kwargs: Any,
) -> PolarAxes
MicrophoneCharacteristics.plot(
ax: Axes | None = None,
*,
quantity: Literal['response', 'noise', 'distortion'] = 'response',
language: Literal['en', 'es'] = 'en',
**kwargs: Any,
) -> Axes

Plot one IEC 60268-4 microphone rated characteristic on one axes.

One concept per figure, drawn by the same shared renderer the .report() fiche composes: "response" (the free-field response with its tolerance band, reference-frequency and effective-range markers, the default), "directivity" (the polar directional pattern on the 25 dB reference circle), "noise" (the inherent-noise band-level spectrum) and "distortion" (total harmonic distortion against sound pressure level).

Parameters

Name Description
ax Existing axes to draw on, or None for a fresh figure (a polar axes is created for "directivity").
quantity Which characteristic to plot (see above). One of "response", "directivity", "noise" or "distortion".
language Label language, "en" (default) or "es".

Returns: The axes the characteristic was drawn on, polar for "directivity".

Raises

Exception When
ValueError If quantity or language is unknown, the result carries no data for quantity, or ax is not a polar axes for "directivity".
ImportError If matplotlib is not installed (the [plot] extra).
TypeError if quantity is not a text.
MicrophoneCharacteristics.report(
path: str | os.PathLike[str],
*,
metadata: ReportMetadata | None = None,
engine: Literal['reportlab'] = 'reportlab',
verbose: bool = False,
language: Literal['en', 'es'] = 'en',
) -> str

Render the IEC 60268-4 microphone-characteristics fiche to a PDF.

Writes a one-page rated-characteristics data sheet: the standard-basis line (IEC 60268-4:2014, graphs to IEC 60263:1982), an optional metadata header, the rated-characteristics table beside the free-field response with its tolerance band and effective-range markers, the directional, inherent-noise and distortion panels for the data supplied, a boxed sensitivity/range result, an optional equivalent-noise verdict when a requirement is given, and the footer.

Parameters

Name Description
path Destination path of the PDF file.
metadata Optional ReportMetadata supplying the header identity and, through requirement, a maximum permitted equivalent noise level (dB SPL) the verdict row compares against.
engine Rendering back end; only "reportlab" is supported.
verbose Accepted for a uniform .report() signature; the fiche has one layout, so it has no effect.
language Fiche language: "en" (default) or "es".

Returns: The written path as a str.

Raises

Exception When
ValueError If engine is not "reportlab" or language is unknown.
ImportError If reportlab is not installed (the [report] extra), or matplotlib is missing for the embedded figure (the [plot] extra).

MicrophoneCharacteristics.sensitivity_v_per_pa

Section titled “MicrophoneCharacteristics.sensitivity_v_per_pa”

property

Rated free-field sensitivity M, in V/Pa (11.1).

MicrophoneCharacteristics.signal_to_noise_ratio_db

Section titled “MicrophoneCharacteristics.signal_to_noise_ratio_db”

property

Signal-to-noise ratio re 1 Pa (94 dB SPL), in dB, or None.

The datasheet companion of the equivalent noise level: the level of 1 Pa ( dB SPL) minus the equivalent sound pressure level due to inherent noise (17), carrying the same weighting.

MicrophoneDirectivity(
*,
polar: Sequence[NumericArrayLike] | NDArray[np.bool_ | np.integer[Any] | np.floating[Any] | np.object_] | None = None,
frequency: float | None = None,
index: float | None = None,
)

Directional characteristics of the microphone (IEC 60268-4 Clause 13).

The clause’s two characteristics travel together: the directional pattern (13.1), a curve of the free-field sensitivity level against the angle of incidence for a stated frequency, and the directivity index read from it (13.2).

Attributes

Name Description
polar Directional pattern as (angles_deg, relative_db), the pattern relative to the reference-axis response, in degrees and dB (13.1.1/13.1.2).
frequency Stated frequency of the directional pattern, in Hz (13.1.1 requires the frequency or frequency band to be stated).
index Stated directivity index, in dB (13.2.1); when omitted it is computed from polar through the 11.2.2 a) diffuse-field integral if the pattern reaches the rear.
MicrophoneElectrical(
*,
rated_impedance_ohm: float | None = None,
min_load_impedance_ohm: float | None = None,
powering: str | None = None,
supply_current_ma: float | None = None,
)

Electrical impedance and rated power supply (IEC 60268-4 Clauses 10/9).

The electrical side of the rated characteristics: the rated (internal) impedance and the rated minimum permitted load impedance of Clause 10, and the rated power supply of Clause 9.

Attributes

Name Description
rated_impedance_ohm Rated (internal) impedance, in ohm (10.2).
min_load_impedance_ohm Rated minimum permitted load impedance, in ohm (10.3).
powering Rated power supply description (9.1), e.g. the IEC 61938 phantom-powering designation and voltage.
supply_current_ma Current drawn from the power supply, in mA (9.1).
MicrophoneNoise(
*,
voltage_v: float | None = None,
equivalent_level: float | None = None,
weighting: Literal['A', '468'] = 'A',
spectrum: Sequence[NumericArrayLike] | NDArray[np.bool_ | np.integer[Any] | np.floating[Any] | np.object_] | None = None,
)

Inherent noise of the microphone (IEC 60268-4 Clause 17).

The clause specifies the equivalent sound pressure level due to inherent noise, either stated directly or computed from the weighted inherent-noise output voltage, and the band spectrum that voltage was measured over.

Attributes

Name Description
voltage_v Weighted r.m.s. output voltage due to inherent noise, in V (17.2 b); the equivalent noise level is computed from it.
equivalent_level Stated equivalent sound pressure level due to inherent noise, in dB SPL (17.1), when not computed from voltage_v.
weighting Weighting of the inherent-noise measurement: "A" (default, the IEC 60268-1 6.2.1 A-weighted r.m.s. recommendation) or "468" (the 6.2.2 psophometric quasi-peak measurement to ITU-R BS.468-4, which IEC 60268-1 still cites by its earlier name, CCIR Recommendation 468, and which older datasheets quote as dB(CCIR)). These are the two weighted wide-band noise measurements IEC 60268-1 defines; the unweighted band spectrum of 6.2.3 travels in spectrum instead. "468" is the spelling weighting_filter and weighted_thd use for the same curve.
spectrum Inherent-noise spectrum as (frequencies, band_levels) in (Hz, dB SPL) (17.2 b).
MicrophoneOverload(
*,
distortion: Sequence[NumericArrayLike] | NDArray[np.bool_ | np.integer[Any] | np.floating[Any] | np.object_] | None = None,
thd_percent: float = 1.0,
spl: float | None = None,
)

Overload sound pressure and the distortion it is read from (14.2/15.2).

The limiting characteristic of IEC 60268-4 15.2 is the maximum sound pressure at which the amplitude non-linearity does not exceed a specified limit, and 15.2.2 measures it by raising the sound pressure until the distortion at the output reaches that limit. The total-harmonic-distortion curve of 14.2, the limit and the resulting level are therefore one group.

Attributes

Name Description
distortion Total harmonic distortion against level as (spl, thd_percent) in (dB SPL, %) (14.2).
thd_percent Distortion limit defining the overload sound pressure level, in % (default 1, a common 15.2.1 note value).
spl Stated overload sound pressure level, in dB SPL (15.2); when omitted it is read from distortion at thd_percent.