Skip to main content

auditory_models

Description

This repository provides multiple packages to compute auditory models, including

  • Short Term Objective Intelligibility (STOI)
  • Generalized Power Spectrum Model for audio quality (GPSMq)
  • Binaural Auditory-Model-based Quality prediction (BAM-Q)

The repository is currently located here.

Prerequisites

Install Python >=3.9

Installation

pip install auditory_models

Usage

from auditory_models import GPSMq
import soundfile as sf

reference, fs_ref = sf.read("reference.wav")
degraded, fs_dgr = sf.read("degraded.wav")
if fs_ref != fs_dgr:
    raise ValueError("Sample rates must be equal!")

gpsmq = GPSMq()

gpsmq.process(reference, degraded, fs_ref)

This usage example can be applied to any other auditory model. Each model class is designed to only take keyword arguments so that they can be called in a default version without any arguments. The process() method is also standardized across all models to take reference, degraded, and sample_rate. Please refer to the models' individual documentation to learn more about their inputs and outputs.

Currently available models:

  • BAMQ
  • GPSMq
  • STOI
  • Base class for type hints: AuditoryModel

For each model-class there exists a frontend() and a backend() method. The process() method calls them both in succession, so frontend() and process() have the same input values and backend() and process() have the same output values. Since there is no universal definition of a front and a back end, we stick to the following idea here:

  • frontend() is everything that extracts features from the audio data
  • backend() is the statistical analysis of the features that results in the final value

Additional Info

  • STOI differs from its original implementation in that the center-frequencies of the third-octave bands are fixed to the frequencies defined by IEC 61260-1:2014.
  • There are some helpful implementations in ./auditory_models/helpers/ like a Gammatone filterbank, a Matlab-like resample class, etc.

Support

Regarding issues please feel free to contact me via zimmermannmax16@gmail.com

Contributing

Any contribution is welcome.

Authors and acknowledgment

Author: Max Zimmermann
Reviewer: Thomas Biberger
Credits to:

  • The developers of the original Matlab implementations
    • STOI: Cees Taal
    • GPSMq and BAM-Q: Thomas Biberger and Jan-Hendrik Fleßner
  • Manuel Pariente for the original Python implementation of STOI

License

This project is licensed under the GNU General Public License v3 (GPLv3). For further info see file COPYING.

Metadata

Release files for auditory-models 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for auditory-models 1.0.1
File Size Uploaded
auditory_models-1.0.1.tar.gz 40.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for auditory-models 1.0.1
File Interpreter ABI Platform
auditory_models-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 90.2 kB

Release files / auditory_models-1.0.1.tar.gz

Download URL auditory_models-1.0.1.tar.gz
Size 40.8 kB
Tags Source
SHA-256 checksum
How to use checksums
35c6ce79d9b0d4faa2ac5887c8f1e8622744f0d3bd7b50b48cb133d7bd904ce2
BLAKE2b-256 checksum
How to use checksums
8aedbb426005e65c0abc6fc42dbd4840fbfd288d7be43d31e6d1f23d614dbba0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.6

Release files / auditory_models-1.0.1-py3-none-any.whl

Download URL auditory_models-1.0.1-py3-none-any.whl
Size 49.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
88d8c2777bdd3d3748e8e37460af4742622186306aa40a0448d585fefeaf0eba
BLAKE2b-256 checksum
How to use checksums
1d2566c0cdd3c5c1bbee76f0bbe19648a11a0e274fff95f4cb86d79224f017b2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.6

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0.0

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page