This repository contains the implementation of "Head-Related Transfer Function Interpolation from Spatially Sparse Measurements Using Autoencoder with Source Position Conditioning" presented in IWAENC2022. Please cite [1] in your work when using this code in your experiments.
We checked the code with the following computational environment.
- Ubuntu 20.04.2 LTS
- GeForce RTX 3090 (24GB VRAM)
- Python 3.8.10
matplotlib==3.4.2 numpy==1.21.0 python-sofa==0.2.0 scipy==1.7.0 tensorboard==2.6.0 torch==1.9.0+cu111 torchaudio==0.9.0
You can test our pretrained model with a short tutorial notebook we have prepared.
- Clone this repository.
- Ensure that your computational environment meets the above or similar requirements.
You can use
conda
andhrtfinterpae.yml
to quickly build an environment.conda env create -n hrtfinterpae -f hrtfinterpae.yml conda activate hrtfinterpae
- Download the HUTUBS HRTF database [2,3] and extract
HRIRs.zip
. - Locate the directories as shown below.
***/ ├ HRTFInterpAE_public/ └ HUTUBS/ └HRIRs/
To test our pretrainded model,
- Move to
HRTFInterpAE_public
.
cd ***/***/HRTFInterpAE_public
- Make a directory which contains output files.
mkdir -p outputs/model_0_test
- Test the model.
nohup python3 -u main.py -c 0 -a outputs/model_0_test -test -lf 'outputs/model_0/hrtf_interp_ae.best.net' > 'outputs/model_0_test/log_test.txt' &
To train our model with the HUTUBS database,
- Move to
HRTFInterpAE_public
.
cd ***/***/HRTFInterpAE_public
- Make a directory which contains output files.
mkdir -p outputs/model_0_train
- Train a model.
nohup python3 -u main.py -c 0 -a outputs/model_0_train > 'outputs/model_0_train/log.txt' &
- The log is written in
outputs/model_0_train/log.txt
. - You can see loss graphs in tensorboard by
tensorboard --logdir outputs/model_0_train/logs/***
- The test will start automatically after the training.
To train a model with a new configuration,
- Create a new dict
config_*
inconfigs.py
.
*
must be an integer. - With the option
-c *
, runmain.py
in the same way as above.
- For other command-line arguments, see
arg_parse()
inmain.py
.
Files in t_des
are 3D Cartesian coordinates of the points contained in spherical t-design [4] and are obtained from [5].
@inproceedings{Ito:IWAENC2022,
author = {Yuki Ito and Tomohiko Nakamura and Shoichi Koyama and Hiroshi Saruwatari},
title = {Head-Related Transfer Function Interpolation from Spatially Sparse Measurements Using Autoencoder with Source Position Conditioning},
booktitle = {in Proceedings of International Workshop on Acoustic Signal Enhancement},
month = {Sep.},
year = {2022},
note = {(accepted)}
}
[1] Yuki Ito, Tomohiko Nakamura, Shoichi Koyama, and Hiroshi Saruwatari, “Head-Related Transfer Function Interpolation from Spatially Sparse Measurements Using Autoencoder with Source Position Conditioning,” in Proc. International Workshop on Acoustic Signal Enhancement (IWAENC), Sep., 2022. (to appear) [PDF] [Slides]
[2] Fabian Brinkmann, Manoj Dinakaran, Robert Pelzer, Peter Grosche, Daniel Voss, and Stefan Weinzierl, “A cross-evaluated database of measured and simulated HRTFs including 3D head meshes, anthropometric features, and headphone impulse responses”, J. Audio Eng. Soc., vol. 67, no. 9, pp. 705–718, 2019.
[3] Fabian Brinkmann, Manoj Dinakaran, Robert Pelzer, Jan Joschka Wohlgemuth, Fabian Seipel, Daniel Voss, Peter Grosche, Stefan Weinzierl, “The HUTUBS head-related transfer function (HRTF) database,” 2019, url: http://dx.doi.org/10.14279/depositonce-8487 (accessed May 6, 2022).
[4] X. Chen and R. S. Womersley, “Existence of solutions to systems of underdetermined equations and spherical designs,” SIAM J. Numer. Anal., vol. 44, no. 6, pp. 2326–2341, 2006.
[5] https://www.polyu.edu.hk/ama/staff/xjchen/sphdesigns.html (accessed Sep. 18, 2022)