Skip to main content

A Python library for complete HRTF workflows, from SOFA file inspection and acoustic processing to visualization, comparison, and reproducible dataset pipelines construction.

Project description

hrtfpykit

Python 3.13+ PyPI package Docs Sphinx Furo CI/CD workflow SOFA HRTF HRIR License GPL 3.0 only

What is hrtfpykit?

hrtfpykit is a Python library for complete Head Related Transfer Function (HRTF) workflows, from SOFA file inspection and acoustic processing to visualization, comparison, and reproducible dataset pipelines construction. It brings time/frequency domain handling, transformations, metrics, plots, and dataset pipelines into one workflow for research, HRTF individualization, and deep learning experiments.

Why hrtfpykit?

HRTF research often requires more than reading one SOFA file. If you have worked with HRTFs, you have probably met the usual ritual: searching for public datasets, discovering that every measurement setup has its own personality, adapting HRIR arrays to different dataset layouts, and moving between scripts, platforms, and tools with different assumptions. Datasets such as ARI, HUTUBS, and SONICOM made this work much more accessible, especially compared with the pre SOFA days of CSV files, spreadsheets, and heroic column name interpretation. Even today, the workflow can still become fragmented very quickly.

hrtfpykit was created to make those steps part of a clearer workflow. It gives researchers a way to work with HRTFs without losing the connection between the file, the acoustic representation, and the experiment.

What does hrtfpykit enable?

hrtfpykit can enable complete HRTF workflows, from file inspection to dataset construction. It is designed for users who need to understand, process, visualize, compare, and reuse HRTF data across research and deep learning tasks.

  • Open, inspect, validate, edit, clone, and save SOFA files.
  • Load HRTFs as acoustic objects with time domain and frequency domain views.
  • Select source positions, ears, samples, and frequency bins.
  • Modify HRTFs through transformations, domain conversions, and acoustic processing steps.
  • Generate plots to inspect spectral cues, magnitude, amplitude, ITD, LSD, and differences between HRTFs with comparison plots, which is especially useful for HRTF individualization.
  • Combine HRTFs with subject data such as anthropometry, metadata, meshes, and images.
  • Create map-style dataset pipelines for training multimodal deep learning models.
  • Build deep learning experiments for HRTF individualization and related tasks.

Architecture

hrtfpykit is organized around four public API entry points. The SOFA layer handles file structure, the HRTF layer builds the acoustic object, the plots layer visualizes HRTF data, and the datasets layer turns public HRTF resources into training and analysis samples.

  • hrtfpykit.sofa: open, inspect, validate, edit, clone, and save SOFA files as structured Python objects.
  • hrtfpykit.hrtf: load SOFA files as HRTF objects with IR data, TF data, source positions, transforms, metrics, and spherical harmonics.
  • hrtfpykit.plots: visualize HRTF objects through spectral cues, source grids, binaural cues, spherical harmonic reconstructions, and comparison plots.
  • hrtfpykit.datasets: build map-style public HRTF dataset pipelines with explicit inputs, targets, variants, splits, subject resources, custom resources, and batching utilities.

Guides

  • Quick Start: first working examples for SOFA files, HRTF objects, plots, and datasets.
  • Tutorials: guided notebook workflows for learning hrtfpykit step by step.

Installation

pip install hrtfpykit

For local installation from source:

git clone https://github.com/ArielAlvarez-Martinez/hrtfpykit.git
cd hrtfpykit
pip install .

For local development from source:

git clone https://github.com/ArielAlvarez-Martinez/hrtfpykit.git
cd hrtfpykit
pip install -e ".[test,docs]"

hrtfpykit requires Python 3.13 or newer.

License

hrtfpykit is distributed under the GPL 3.0 only license. See LICENSE for details.

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

hrtfpykit-0.1.1.tar.gz (879.6 kB view details)

Uploaded Source

Built Distribution

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

hrtfpykit-0.1.1-py3-none-any.whl (889.4 kB view details)

Uploaded Python 3

File details

Details for the file hrtfpykit-0.1.1.tar.gz.

File metadata

  • Download URL: hrtfpykit-0.1.1.tar.gz
  • Upload date:
  • Size: 879.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for hrtfpykit-0.1.1.tar.gz
Algorithm Hash digest
SHA256 dc911de2708610cd3b9ad2100b9be30ab3763c9b53ae223f4670b31e975a8914
MD5 c9ade4c554143da8092e030f569a0e73
BLAKE2b-256 bb94b3e2e3e62a416142ed8822d5dfd0cd8e400535550a40d890bba9d1e61dec

See more details on using hashes here.

Provenance

The following attestation bundles were made for hrtfpykit-0.1.1.tar.gz:

Publisher: cd.yml on ArielAlvarez-Martinez/hrtfpykit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file hrtfpykit-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: hrtfpykit-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 889.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for hrtfpykit-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 212391461bb0597dcc979d57c85f90da9426564f6923a26fd8f76b79cb2ee9a4
MD5 34916b0a2f37ecbc5f5b60406e6aaeb2
BLAKE2b-256 b4d6d2345f18d0c61c0e864723140e768d300477ecaf01167b657239d6a79935

See more details on using hashes here.

Provenance

The following attestation bundles were made for hrtfpykit-0.1.1-py3-none-any.whl:

Publisher: cd.yml on ArielAlvarez-Martinez/hrtfpykit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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