clarity.evaluator.haspi.haspi module

HASPI intelligibility Index

clarity.evaluator.haspi.haspi.haspi_v2(reference: ndarray, reference_sample_rate: float, processed: ndarray, processed_sample_rate: float, audiogram: Audiogram, level1: float = 65.0, f_lp: float = 320.0, itype: int = 0) tuple[float, ndarray][source]

Compute the HASPI intelligibility index using the auditory model followed by computing the envelope cepstral correlation and BM vibration high-level covariance. The reference signal presentation level for NH listeners is assumed to be 65 dB SPL. The same model is used for both normal and impaired hearing. This version of HASPI uses a modulation filterbank followed by an ensemble of neural networks to compute the estimated intelligibility.

NB - The original HASPI model derivation included a bug which meant that although the ‘shift’ parameter used in band centre frequency calculations was set to ‘0.02’ it was never actually applied. To replicate this behaviour ear_model is called with ‘shift’ set to None. For discussion please refer to the discussion in Issue #105 <https://github.com/claritychallenge/clarity/issues/105> for further details.

Parameters:
  • reference (np.ndarray) – Clear input reference speech signal with no noise or distortion. If a hearing loss is specified, no amplification should be provided.

  • reference_sample_rate (int) – Sampling rate in Hz for signal x

  • processed (np.ndarray) – Output signal with noise, distortion, HA gain, and/or processing.

  • processed_sample_rate (int) – Sampling rate in Hz for signal y.

  • hearing_loss (np.ndarray) – (1,6) vector of hearing loss at the 6 audiometric frequencies [250, 500, 1000, 2000, 4000, 6000] Hz.

  • level1 (int) – Optional input specifying level in dB SPL that corresponds to a signal RMS = 1. Default is 65 dB SPL if argument not provided.

  • f_lp (int)

  • itype (int) – Intelligibility model

Returns:

float, raw: nd-array) Intel: Intelligibility estimated by passing the cepstral coefficients

through a modulation filterbank followed by an ensemble of neural networks.

raw: vector of 10 cep corr modulation filterbank outputs, averaged

over basis functions 2-6.

Return type:

tuple(Intel

Updates:

James M. Kates, 5 August 2013. Translated from MATLAB to Python by Zuzanna Podwinska, March 2022.

clarity.evaluator.haspi.haspi.haspi_v2_be(reference_left: ndarray, reference_right: ndarray, processed_left: ndarray, processed_right: ndarray, sample_rate: float, listener: Listener, level: float = 100.0) float[source]

Better ear HASPI.

Calculates HASPI for left and right ear and selects the better result.

Parameters:
  • ref_left (np.ndarray) – left channel of reference signal

  • ref_right (np.ndarray) – right channel of reference signal

  • proc_left (np.ndarray) – left channel of processed signal

  • proc_right (np.ndarray) – right channel of processed signal

  • sample_rate (int) – sampling rate for both signal

  • () (audiogram_right) – left ear audiogram

  • () – right ear audiogram

  • level – level in dB SPL corresponding to RMS=1

Returns:

beHASPI score

Return type:

float

Updates:

Zuzanna Podwinska, March 2022