Swift & Gee codes
Legacy project. Not maintained. Its last commit was in January 2020, more than three years ago. Kept here for reference. Its code may follow an older edition and may not run with current software.
MATLAB code by S. Hales Swift (Brigham Young University) on MATLAB File Exchange for fast Moore–Glasberg loudness: ANSI S3.4-2007 stationary loudness and Glasberg & Moore (2002) time-varying loudness, each with the sharpness of Swift & Gee (2017), which is computed from Moore–Glasberg specific loudness.
| Full name | Codes for the rapid calculation of loudness and sharpness |
|---|---|
| Repository | https://www.mathworks.com/matlabcentral/fileexchange/73808-codes-for-the-rapid-calculation-of-loudness-and-sharpness |
| Language | MATLAB |
| Kind | Research code Code published with a study, a thesis or a student project, to run or adapt; not packaged as a library. |
| Group | legacy Archived, or no commit for three years or more. Kept for reference. The code may follow an older edition and may not run with current software. |
| Licence | BSD-3-Clauselicense.txt: Copyright (c) 2019, Stephen Hales Swift. |
| Package | MATLAB File Exchange 73808 |
| Latest release | 1.0.0 (2020-01) |
| Last commit | 2020-01-24 inactive since 2020-01 |
| Maintainers | Stephen Hales Swift |
| AI assistance | not stated |
| Paper | Swift, S. H., & Gee, K. L. (2019). Techniques for the rapid calculation of the excitation pattern in the time varying extensions to ANSI S3.4-2007. Proceedings of Meetings on Acoustics, 36, 040002. |
| How to cite | The File Exchange page asks for the paper above for the loudness code and for Swift & Gee (2017) for the sharpness code. Name the version or commit you used. |
| Entry checked | 7 October 2026 |
What it implements
| Metric | Edition | Functions | Validation (as stated) | Notes |
|---|---|---|---|---|
| Moore–Glasberg loudness | ANSI/ASA S3.4-2007 | stationaryLoudness | not stated | legacy |
| Time-varying loudness (Moore–Glasberg–Schlittenlacher) | Glasberg & Moore (2002) | Glasberg_loudness | not stated | legacy |
| Sharpness | Swift & Gee (2017) from Moore–Glasberg specific loudness, stationary and time-varying | stationaryLoudness, Glasberg_loudness | not stated | legacy |
How it was validated
As reported by the project; LISQM has not run the code. Two implementations that agree can still share the same error. Kinds of evidence.
The project does not say how any of these were validated.
Before you compare numbers
Implementations of the same metric can give different numbers without either being wrong. Check these choices first.
- The code works at 32 kHz; other rates are resampled with the Signal Processing Toolbox's
resample.
Notes
- Version 1.0.0 (2020-01-24) is the only update after the first upload (2019-12-31). There is no public commit history; the files can be read online on File Exchange without logging in.
- The sharpness code is by the authors of the sharpness model.
Before you rely on it
- No validation is described.
- Without the Signal Processing Toolbox, the File Exchange page says a file from the Cambridge Hearing Group's website is needed; that page now needs a University of Cambridge login.