The SII package for R provides:
bramslow2004
implementation in the Auditory Modeling Toolbox (AMT 1.6.0).Open-NL and the prescription functions are research tools for modeling and simulation. They have not been clinically validated and are not intended for fitting hearing aids to patients.
From CRAN:
install.packages("SII")
Development version from GitHub (needs a C++ compiler: Rtools on Windows, Xcode Command Line Tools on macOS):
# install.packages("remotes")
remotes::install_github("r-gregmisc/SII")
library(SII)
res <- sii(
speech = c(50, 40, 40, 30, 20, 0),
noise = c(70, 65, 45, 25, 1, -15),
threshold = c(0, 0, 0, 0, 0, 0),
method = "octave"
)
res$sii # 0.504, the value given in the standard
summary(res) # band-by-band detail
plot(res)
desensitization is either "none" (the ANSI SII, the default) or
"johnson2011_desensitized" (the Johnson & Dillon, 2011, correction for
reduced benefit from audibility at greater degrees of sensorineural loss).
sii(
speech = "raised",
threshold = c(25, 25, 30, 35, 45, 45, 55, 60),
freq = c(250, 500, 1000, 2000, 3000, 4000, 6000, 8000),
method = "critical",
interpolate = TRUE,
desensitization = "johnson2011_desensitized"
)
target <- open_nl(
speech = 65, # input level, dB SPL
threshold = c(0, 0, 10, 40, 70, 80), # dB HL
freq = c(250, 500, 1000, 2000, 4000, 8000)
)
target # insertion gain and maximum power output by frequency
target$gain
The optimization runs several Nelder-Mead searches and can take up to a minute
per call. Useful arguments include objective_sii (which SII to maximize),
cap_rule ("normal", the normal-hearing loudness of unaided speech, or the
earlier "legacy" rule), cap_override, vent_floor, and switches for
individual prescription rules (enable_severe_booster, disable_sdlfp,
abg_fraction). See ?open_nl.
Pass the target to sii() through prescription, with the speech spectrum,
thresholds and frequencies stored in the target:
aided <- sii(
speech = target$speech,
threshold = target$threshold,
freq = target$freq,
prescription = target,
interpolate = TRUE,
desensitization = "johnson2011_desensitized"
)
aided$sii # aided SII
aided$unaided_sii # unaided SII, same settings
calculate_loudness(target)$total # loudness of the aided speech, sones
calculate_loudness_audmod() gives direct access to the AUDMOD model; see
?calculate_loudness_audmod.
Each rule in Open-NL can be switched on or off to measure its effect, for example:
target_booster <- open_nl(
speech = 65,
threshold = c(0, 0, 10, 40, 70, 80),
freq = c(250, 500, 1000, 2000, 4000, 8000),
enable_severe_booster = TRUE, # extra gain for severe losses
booster_onset = 60, # dB HL at which the booster starts
disable_sdlfp = TRUE # turn off the slope-dependent low-frequency penalty
)
target_booster$gain - target$gain
Scripts that reproduce the results of studies using this package, and the
checks of the loudness model against AMT, are in
reproducibility_scripts/.
Its README
maps each table and figure to the script that produces it and says which
package version each script runs on. These scripts are kept in the GitHub
repository only; they are not part of the CRAN package.
See NEWS.md. Version 1.3.0 replaced the loudness model with the verified AUDMOD port, made the normal-hearing loudness cap the Open-NL default, and simplified desensitization to two options.
Gregory R. Warnes (original author of the ANSI S3.5 implementation) and Mark Shaver (maintainer; loudness model and Open-NL). Development of the original package was funded by the Center for Bioscience Education and Technology (CBET) of the Rochester Institute of Technology.
GPL-3.