# PsychoacousticMetrics.jl

> 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/psychoacousticmetrics-jl.html

**Newly released project.** First registered in July 2026. Not yet seen to be widely used in the community. Check its validation before relying on it.

Julia package for the Zwicker family of sound-quality metrics on top of ZwickerLoudness.jl: DIN 45692:2009 sharpness (with Aures, von Bismarck and Fastl weightings), Daniel & Weber roughness, Osses et al. (2016) fluctuation strength and Widmann (1992) psychoacoustic annoyance.

- **Repository:** https://github.com/slink/PsychoacousticMetrics.jl
- **Language:** Julia
- **Kind:** Library/Toolbox (Functions to call from your own code: a Python package, a MATLAB toolbox, or a C, C++, C#, Rust or Julia library.)
- **Group:** newly released (First released less than about a year ago, and not yet seen to be widely used in the community.)
- **Licence:** MIT — Test data, the roughness implementation and several weighting tables are derived from MoSQITo (Apache-2.0); fluctuation-strength tables and annoyance constants reference SQAT (CC BY-NC 4.0) as factual data, without reusing its code (README, test/data/NOTICE).
- **Package:** Julia General `PsychoacousticMetrics` (https://juliahub.com/ui/Packages/General/PsychoacousticMetrics)
- **Install:** `using Pkg; Pkg.add("PsychoacousticMetrics")`
- **Latest release:** v0.5.0 (2026-09)
- **Last commit:** 2026-09-03 (active)
- **GitHub stars:** 1
- **Maintainers:** slink
- **AI assistance:** not stated
- **How to cite:** The README links a [Zenodo DOI](https://zenodo.org/badge/latestdoi/1292553110) for the latest version. Name the version or commit you used.
- **Entry checked:** 2026-10-08

## What it implements

| Metric | Edition | Functions | Status | Validation (as stated) | Notes |
|---|---|---|---|---|---|
| [Sharpness](https://zhenxianli.github.io/LISQM/metrics/sharpness.html) | [DIN 45692:2009](https://www.dinmedia.de/en/standard/din-45692/117635111) (weightings: DIN 45692 (default), Aures, von Bismarck, Fastl; from a ZwickerLoudness.jl result; since 0.2.0) | `sharpness` | available | standard or paper data; also compared with MoSQITo | — |
| [Roughness (Daniel & Weber)](https://zhenxianli.github.io/LISQM/metrics/roughness-daniel-weber.html) | [Daniel & Weber (1997)](https://zhenxianli.github.io/LISQM/standards.html#ref-daniel-weber-1997) (since 0.2.0) | `roughness_dw` | available | standard or paper data; also compared with MoSQITo (its source) | — |
| [Fluctuation strength (Osses et al.)](https://zhenxianli.github.io/LISQM/metrics/fluctuation-strength-osses.html) | [Osses et al. (2016)](https://doi.org/10.1121/2.0000410) (since 0.3.0) | `fluctuation_strength_osses` | available | reference code: SQAT | — |
| [Psychoacoustic annoyance](https://zhenxianli.github.io/LISQM/metrics/psychoacoustic-annoyance.html) | [Widmann (1992)](https://zhenxianli.github.io/LISQM/standards.html#ref-widmann-1992) (percentile convention (N5, S5, R5, FS5) and a stationary approximation; since 0.4.0) | `psychoacoustic_annoyance_widmann` | available | compared with SQAT | — |

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

- [Sharpness](https://zhenxianli.github.io/LISQM/metrics/sharpness.html), DIN 45692:2009: standard or paper data; also compared with **[MoSQITo](https://zhenxianli.github.io/LISQM/projects/mosqito.html)**
  - Tested against all 41 reference signals of DIN 45692:2009 chapter 6 (21 narrowband, 20 broadband) within the standard's tolerance of ±max(5 %, 0.05 acum).
  - Cross-checked against MoSQITo for all four weightings.
  - Total loudness N is computed as the Riemann sum over the 240-bin specific loudness (`0.1 * sum`), not taken from `ZwickerResult.loudness` (see the `sharpness` docstring).
- [Roughness (Daniel & Weber)](https://zhenxianli.github.io/LISQM/metrics/roughness-daniel-weber.html), Daniel & Weber (1997): standard or paper data; also compared with **[MoSQITo](https://zhenxianli.github.io/LISQM/projects/mosqito.html)** (its source)
  - Ported or adapted from **[MoSQITo](https://zhenxianli.github.io/LISQM/projects/mosqito.html)**. It was compared with the code it was ported from, which checks the port only.
  - Tested against the Zwicker & Fastl reference curves on MoSQITo's validation grid (7 carrier × 11 modulation frequencies) within ±0.1 asper, and cross-checked against MoSQITo's `roughness_dw` on identical signals.
  - Five points at a 2 kHz carrier miss the ±0.1 asper gate. MoSQITo misses them by the same amount (and overshoots Daniel & Weber's own curve there by 15–31 %), so these five are checked for agreement with MoSQITo to 5e-3 asper instead.
  - Against the Daniel & Weber curves themselves, 63 of the 77 grid points are within 30 % of the reference (reported, not gated).
- [Fluctuation strength (Osses et al.)](https://zhenxianli.github.io/LISQM/metrics/fluctuation-strength-osses.html), Osses et al. (2016): reference code: **[SQAT](https://zhenxianli.github.io/LISQM/projects/sqat.html)**
  - Cross-checked against SQAT's `FluctuationStrength_Osses2016`, run under Octave, on identical signals: 26 cases, including all 18 points of Fastl & Zwicker's AM/FM reference grid (Osses 2018 thesis, Table B.1), each reproduced to a relative tolerance of 1e-6 (measured 3e-9).
  - The grid stimuli are synthesised following the Osses et al. (2016) validation files that SQAT's own validation reads; the tests also check that each synthetic stimulus gives the value SQAT gives on the real file (tones to 5e-3, noise to 25 % across random draws).
  - Against the published curves, 11 of the 18 points are within 30 %, and exactly those 11 are gated. The other seven are misses of the reference model itself (FM tones with a modulation frequency above 4 Hz overestimated three- to fourfold, thesis §B.4.1; the shoulder and tail points of AM tones and noise), which SQAT's own validation figures also show.
- [Psychoacoustic annoyance](https://zhenxianli.github.io/LISQM/metrics/psychoacoustic-annoyance.html), Widmann (1992): compared with **[SQAT](https://zhenxianli.github.io/LISQM/projects/sqat.html)**
  - Cross-checked against SQAT's `PsychoacousticAnnoyance_Widmann1992`: an 840-case formula grid, reproduced bit-exactly, and six signal-level cases with SQAT's own N5, S5, R5 and FS5 vendored, so that every deviation is attributed to a component.
  - Checked at the published 1 au anchor (a 1 kHz tone at 40 dB SPL): on the 4 s cross-check case, the percentile convention lands 0.1 % from it and the stationary approximation 0.8 %; on the README's 5 s examples, 0.3 % and 1.4 %.

## Before you compare numbers

Implementations of the same metric can give different numbers without either being wrong. Check these choices first.

- [Fluctuation strength (Osses et al.)](https://zhenxianli.github.io/LISQM/metrics/fluctuation-strength-osses.html) (Osses et al. (2016)): Needs audio at 44.1 or 48 kHz (an error otherwise); SQAT resamples other rates itself.
- [Psychoacoustic annoyance](https://zhenxianli.github.io/LISQM/metrics/psychoacoustic-annoyance.html) (Widmann (1992)): The percentile form needs 48 kHz input. Percentiles are Hyndman–Fan type 7 quantiles (linear interpolation); SQAT takes the nearest rank, which the README says differs by a full order-statistic step on the coarse fluctuation-strength track.

## Notes

- Roughness follows MoSQITo's `roughness_dw` ("as implemented by MoSQITo"), not Daniel and Weber's original code.
- Annoyance comes in two forms: the canonical percentile convention (N5, S5, R5 and FS5 from time-varying tracks, since 0.5.0) and a documented stationary approximation from whole-signal values (since 0.4.0).

## Sources

- https://github.com/slink/PsychoacousticMetrics.jl
- https://github.com/slink/PsychoacousticMetrics.jl/blob/main/README.md#conformance
- https://github.com/slink/PsychoacousticMetrics.jl/blob/main/test/data/NOTICE
- https://github.com/slink/PsychoacousticMetrics.jl/blob/main/Project.toml
- https://github.com/JuliaRegistries/General/tree/master/P/PsychoacousticMetrics
