# Swift & Gee codes

> Part of [LISQM](https://zhenxianli.github.io/LISQM/) (List of Implementations of Sound Quality Metrics), a list of open-source implementations of psychoacoustic metrics. Data as of 2026-10-28. Web page: https://zhenxianli.github.io/LISQM/projects/rapid-loudness-sharpness.html

**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-Clause — license.txt: Copyright (c) 2019, Stephen Hales Swift.
- **Package:** MATLAB File Exchange `73808` (https://www.mathworks.com/matlabcentral/fileexchange/73808-codes-for-the-rapid-calculation-of-loudness-and-sharpness)
- **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:** 2026-10-07

## What it implements

| Metric | Edition | Functions | Status | Validation (as stated) | Notes |
|---|---|---|---|---|---|
| [Moore–Glasberg loudness](https://zhenxianli.github.io/LISQM/metrics/loudness-moore-glasberg.html) | [ANSI/ASA S3.4-2007](https://webstore.ansi.org/standards/asa/ANSIASAS32007R2020) | `stationaryLoudness` | available | not stated | — |
| [Time-varying loudness (Moore–Glasberg–Schlittenlacher)](https://zhenxianli.github.io/LISQM/metrics/loudness-moore-glasberg-time-varying.html) | [Glasberg & Moore (2002)](https://aes2.org/publications/elibrary-page/?id=11081) | `Glasberg_loudness` | available | not stated | — |
| [Sharpness](https://zhenxianli.github.io/LISQM/metrics/sharpness.html) | [Swift & Gee (2017)](https://doi.org/10.1121/1.5016193) (from Moore–Glasberg specific loudness, stationary and time-varying) | `stationaryLoudness`, `Glasberg_loudness` | available | not stated | — |

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

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.

## Sources

- https://www.mathworks.com/matlabcentral/fileexchange/73808-codes-for-the-rapid-calculation-of-loudness-and-sharpness
- https://viewer.mathworks.com/addons/73808/latest
- https://doi.org/10.1121/1.5016193
