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í.

hearing.threshold

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.

Age-related hearing threshold (ISO 7029:2017) and audiometric reference zero (ISO 389-7:2005).

Implements the statistical distribution of the hearing threshold of an otologically normal population as a function of age and sex (ISO 7029:2017), and the reference threshold of hearing under free-field and diffuse-field listening (ISO 389-7:2005, Table 1), over the audiometric frequencies from 125 Hz to 8000 Hz.

ISO 7029 gives the median threshold deviation from the value at age 18 as (clause 4.2, Table 1) and the spread around the median as two half-Gaussian standard deviations su (worse than median) and sl (better than median), each a fifth-degree polynomial in age - 18 (clause 4.3, Tables 2-5). A population fractile is obtained by shifting the median by the standard-normal quantile times the appropriate spread (clause 4.4 / Annex A).

The noise-induced permanent threshold shift of ISO 1999 (which combines a noise component with this age component) is not part of this module.

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

age_threshold(
age: float,
sex: Literal['male', 'female'] = 'male',
fractile: float = 0.5,
frequencies: ArrayLike | None = None,
) -> AgeThresholdResult

Age-related hearing threshold distribution (ISO 7029:2017).

Returns, per audiometric frequency, the median threshold deviation from the value at age 18 (clause 4.2), the upper/lower half-Gaussian spreads (clause 4.3) and the threshold at the requested population fractile (clause 4.4): median + z * spread where z is the standard-normal quantile of fractile and the spread is the upper one for z >= 0 (worse than the median) or the lower one otherwise.

Parameters

NameDescription
ageListener age, in years (must be at least 18). The standard’s formulae are established up to 80 years for frequencies at or below 2000 Hz and up to 70 years above; ages beyond that extrapolate.
sex"male" or "female".
fractilePopulation fractile in the open interval (0, 1); 0.5 gives the median.
frequenciesOptional subset of the audiometric frequencies, in hertz; None uses all eleven (125 Hz - 8000 Hz).

Returns: An AgeThresholdResult with the distribution and .plot().

Raises

ExceptionWhen
ValueErrorfor an age below 18, an unknown sex, a fractile outside (0, 1), or an unknown frequency.
AgeThresholdResult(
age: float,
sex: str,
fractile: float,
frequencies: np.ndarray,
median: np.ndarray,
spread_upper: np.ndarray,
spread_lower: np.ndarray,
threshold: np.ndarray,
)

Age-related hearing threshold distribution (ISO 7029:2017).

All arrays are in dB and aligned with AUDIOMETRIC_FREQUENCIES.

Attributes

NameDescription
ageListener age, in years.
sex"male" or "female".
fractilePopulation fractile of threshold (0-1).
frequenciesAudiometric frequencies, in hertz.
medianMedian threshold deviation from age 18 (clause 4.2).
spread_upperUpper half-Gaussian standard deviation su.
spread_lowerLower half-Gaussian standard deviation sl.
thresholdThreshold deviation at fractile (clause 4.4).
AgeThresholdResult.plot(
ax: Axes | None = None,
*,
language: str = 'en',
**kwargs: Any,
) -> Axes

Plot the median threshold with the fractile band over frequency.

Requires matplotlib (pip install phonometry[plot]); returns the Axes.

Constant (numpy.ndarray, shape (11,)).

Constant (mapping).

EARPHONE_COUPLERS = {'DT 48': 'IEC 60303 acoustic coupler', 'TDH 39': 'IEC 60303 acoustic coupler', 'other supra-aural': 'IEC 60318 artificial ear'}
earphone_reference_level(
earphone: str = 'TDH 39',
frequencies: ArrayLike | None = None,
) -> np.ndarray

Reference equivalent threshold sound pressure level (ISO 389-1:1998).

The sound pressure level, in dB re 20 uPa, that an audiometer has to produce in the coupler for a hearing level of 0 dB HL. It is what audiometric zero means for a supra-aural earphone, and it depends on the earphone model and on the coupler it is calibrated on, which is why the standard prints two tables rather than one.

Parameters

NameDescription
earphone"DT 48" or "TDH 39" (Table 1, on the IEC 60303 coupler), or "other supra-aural" (Table 2, on the IEC 60318 artificial ear, for an earphone meeting the requirements of 4.3).
frequenciesOptional subset of RETSPL_FREQUENCIES_HZ, in hertz; None uses all twenty-three.

Returns: The reference level, in dB, aligned with the frequencies.

Raises

ExceptionWhen
ValueErrorFor an unknown earphone or frequency.

Constant (tuple).

EARPHONES = ('DT 48', 'TDH 39', 'other supra-aural')

Constant (tuple).

FIELDS = ('free-field', 'diffuse-field')
hearing_level_to_coupler_spl(
hearing_level: ArrayLike,
earphone: str = 'TDH 39',
frequencies: ArrayLike | None = None,
) -> np.ndarray

An audiogram in dB HL as the level the coupler has to see, in dB SPL.

Hearing level is defined against the audiometric zero, so the two differ by the reference level of the earphone and nothing else: an audiogram of 0 dB HL is the reference level itself, and every decibel of hearing loss is a decibel more in the coupler.

Parameters

NameDescription
hearing_levelThe audiogram, in dB HL, one value per frequency.
earphoneAs in earphone_reference_level.
frequenciesThe frequencies the audiogram was taken at; None uses all twenty-three of RETSPL_FREQUENCIES_HZ.

Returns: The equivalent sound pressure level in the coupler, in dB.

Raises

ExceptionWhen
ValueErrorIf the audiogram does not match the frequencies, or for an unknown earphone or frequency.
reference_threshold(
field: str = 'free-field',
frequencies: ArrayLike | None = None,
) -> np.ndarray

Reference threshold of hearing (ISO 389-7:2005, Table 1).

The sound pressure level, in dB, that corresponds to the audiometric zero (0 dB HL) under the given listening condition, at the audiometric frequencies.

Parameters

NameDescription
field"free-field" (frontal incidence) or "diffuse-field".
frequenciesOptional subset of the audiometric frequencies, in hertz; None uses all eleven (125 Hz - 8000 Hz).

Returns: The reference threshold, in dB, aligned with the frequencies.

Raises

ExceptionWhen
ValueErrorfor an unknown field or frequency.

Constant (numpy.ndarray, shape (23,)).

Constant (tuple).

SEXES = ('male', 'female')