-
Notifications
You must be signed in to change notification settings - Fork 16
Legacy_Output2HRTF
This part of the package includes several Matlab scripts to generate .mat and .sofa files of the BEM calculation. With Output2HRTF you can convert the output of NumCalc in a .mat and a .sofa file. After this procedure you have your HRTF in a suitable format. It includes three Matlab scripts that easly convert the previously calculated data.
Here we explain everything you need to know to use Output2HRTF for generating .sofa files:
Installation 1 add the Matlab toolbox SOFA Matlab API (or get the source code from Github to have the latest version) to your Matlab path, including its subfolders (extract the files before) 2 add the directory Output2HRTF in the source files to your Matlab path, including its subfolders
Using Output2HRTF
-
after finishing all NumCalc calculations start the script Output2HRTF.m in your working directory
-
after these calculations you can use the SOFA Matlab API toolbox to plot your HRTF using these: a) your_variable = SOFAload('EvaluationGrid.sofa') b) SOFAplotHRTF(your_variable, 'mode'); you can choose from the following modes to display the HRTF:
- 'EtcHorizontal' energy-time curve in the horizontal plane (+/- 5 deg) - 'EtcMedian' energy-time curve in the median plane (+/- 2 deg) - 'MagHorizontal' magnitude spectra in the horizontal plane (+/- 5 deg) - 'MagMedian' magnitude spectra in the median plane (+/- 2 deg) - 'magspectrum' single magnitude spectrum for direction DIR in COLOR
Results
- file: ObjectMesh.mat (comlex sound pressure on the triangules of the object)
- file: EvaluationGrid.sofa (complex sound pressure on the nodes of the evaluation grid)
- file: computationTime.mat (information on the calculation time)
Troubleshooting If Output2HRTF.m throws an error, make sure you have started the SOFA API with SOFAstart('restart');