Skip to content

Mesh2HRTF_API

Fabian Brinkmann edited this page Mar 20, 2026 · 5 revisions

Functions for processing input for Mesh2HRTF and output from Mesh2HRTF are contained in the Mesh2HRTF API available for Python and Matlab/Octave. The functions have identical names in both cases.

The Mesh2HRTF Python API currently contains more functionality and a better modularization and is documented on https://mesh2hrtf.readthedocs.io/. The Matlab functions are documented through their headers. Here is a brief overview of the API

Function Purpose Python Matlab Comment
compute_dtfs Compute directional transfer functions (DTFs) from HRIRs ✅ For Matlab use SOFAhrtf2dtf from the SOFAtoolbox
compute_hrirs Compute HRIRs from HRTFs ✅ part of output2hrtf in Matlab API
export_vtk Export pressure on 3D mesh for visualization in ParaView ✅ ✅
inspect_sofa_files Plot final HRTFs/HRIRs ✅ For Matlab use SOFAplotHRTF from the SOFAtoolbox
manage_numcalc Automatic close to optimal parallelization of NumCalc calculations ✅
manage_numcalc_script Script version of manage_numcalc that can be run from the command line ✅
merge_sofa_files Merge SOFA files from multiple projects ✅ ✅
ncdata2vtk Export pressure on the evaluation grid for visualization in ParaView ✅ Partly doubles functionality of export_vtk
output2hrtf compute HRTFs/HRIRs from NumCalc output ✅ ✅
process_multiple_outputs2hrtf as output2hrtf, but can handle multiple projects ✅ ✅
read_evaluation_grid Read evaluation grid ✅ ✅
read_ram_estimates Read estimated RAM consumption from Memory.txt ✅
reference_hrtfs Reference HRTF to sound pressure at center of head ✅ part of output2hrtf in Matlab API
remove_outputs Delete NumCalc output (can be large) ✅ Part of process_multiple_outputs2hrtf in the Matlab API
resample_sofa_file Resample HRIRs to a different sampling rate ✅ For Matlab use SOFAresample from the SOFAtoolbox
write_evaluation_grid Write evaluation grid ✅ ✅
write_material Write acoustic boundary condition to material file ✅ ✅
write_output_report Check and report computation time and errors in the NumCalc output ✅ ✅

Clone this wiki locally