sii_ansi_level#
- sii_ansi_level(noise_level, method, speech_level, threshold=None)[source]#
Calculate speech intelligibility index
This function computes SII values for an overall noise level in dB according to ANSI S3.5 standard. This value is used to create a uniform noise spectrum, with the same deduced level on each frequency band.
- Parameters:
noise_level (float) – Overall noise level in [dB ref. 2e-5 Pa].
method ({"critical", "equally_critical", "third_octave", "octave"}) – Type of frequency band to be used for the calculation. See § 3.4 of the standard.
speech_level ({'normal', 'raised', 'loud', 'shout'}) – Speech level to assess, the corresponding speech spectrum defined in the standard is used for calculation.
threshold (array_like or 'zwicker') – Threshold of hearing [dB ref. 2e-5 Pa] with same size as the chosen method frequency axis, or ‘zwicker’ to use the standard threshold. Default to None sets the threshold to zeros on each frequency band.
- Returns:
sii (numpy.ndarray) – Overall SII value.
specific_sii (numpy.ndarray) – Specific SII values along the frequency axis.
freq_axis (numpy.ndarray) – Frequency axis corresponding to the chosen method.
See also
sii_ansiSpeech intelligibility with a time signal as background noise
sii_ansi_freqSpeech intelligibility with a frequency spectrum as background noise
Notes
The input dB level corresponds to the overall sound pressure level. It is used to create a full uniform spectrum with the following sound level on each of the N bands:
\[L_{band}=10\log_{10}\left( \frac{10^{\frac{L_{overall}}{10}}}{N} \right)\]The Speech Intelligibility Index \(SII\) of the signal is computed as the sum of the speech-to-noise ratio \(A\) weighted by an importance function \(I\), over the \(n\) frequency bands.
\[SII=\sum_{i=1}^{n}A_{i}I_{i}\]- The number of frequency bands considered depends on the chosen method:
“critical”: 21 critical bands corresponding to the Bark scale
“equally_critical”: 17 equally contributing critical bands
“third-octave”: 18 third-octave bands
“octave”: 6 octave bands
References
[1]ANSI.S3.5:2017. Methods for calculation of the Speech Intelligibility Index. American National Standards Institute, 2017. URL: https://webstore.ansi.org/standards/asa/ansiasas31997r2017.
Examples
>>> import matplotlib.pyplot as plt >>> import numpy as np >>> from mosqito.sq_metrics.speech_intelligibility import sii_ansi_level >>> fs=48000 >>> d=0.2 >>> dB=90 >>> time = np.arange(0, d, 1/fs) >>> f = 50 >>> stimulus = np.sin(2 * np.pi * f * time) * np.sin(np.pi * f * time) + np.sin(10 * np.pi * f * time) + np.sin(100 * np.pi * f * time) >>> rms = np.sqrt(np.mean(np.power(stimulus, 2))) >>> ampl = 0.00002 * np.power(10, dB / 20) / rms >>> stimulus = stimulus * ampl >>> speech_level = 'raised' >>> SII, SII_spec, freq_axis = sii_ansi_level(60, method='critical', speech_level=speech_level, threshold='zwicker') >>> plt.plot(freq_axis, SII_spec) >>> plt.xlabel("Frequency [Hz]") >>> plt.ylabel("Specific value ") >>> plt.title("Speech Intelligibility Index = " + f"{SII:.2f}")
(
Source code,png,hires.png,pdf)