Skip to main content

Computation of auditory models

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

auditory_models-1.0.1.tar.gz (40.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

auditory_models-1.0.1-py3-none-any.whl (49.4 kB view details)

Uploaded Python 3

File details

Details for the file auditory_models-1.0.1.tar.gz.

File metadata

  • Download URL: auditory_models-1.0.1.tar.gz
  • Upload date:
  • Size: 40.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.6

File hashes

Hashes for auditory_models-1.0.1.tar.gz
Algorithm Hash digest
SHA256 35c6ce79d9b0d4faa2ac5887c8f1e8622744f0d3bd7b50b48cb133d7bd904ce2
MD5 9d494208ea066755f1155a180e7281b4
BLAKE2b-256 8aedbb426005e65c0abc6fc42dbd4840fbfd288d7be43d31e6d1f23d614dbba0

See more details on using hashes here.

File details

Details for the file auditory_models-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for auditory_models-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 88d8c2777bdd3d3748e8e37460af4742622186306aa40a0448d585fefeaf0eba
MD5 5e68b8ff86ffbd70f658054f7a3567a4
BLAKE2b-256 1d2566c0cdd3c5c1bbee76f0bbe19648a11a0e274fff95f4cb86d79224f017b2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page