Closed germknoedlspeck closed 1 year ago
I ran the demo script 'demo_SOFAHRTF2DTF.m' and could not reproduce the error.
Can you tell me which data to test in order to reproduce the error?
I tried creating a SimpleFreeFieldHRIR object by
SOFAstart;
Obj = SOFAgetConventions('SimpleFreeFieldHRIR');
and this will leave out the GLOBAL_Comment (and some other) variables that are part of a measured or calculated HRIR. Can you reproduce this?
This issue does not happen when executing output2hrtf within Mesh2HRTF, but it happens with merge_sofa_files from the same project, and I do not understand where the difference comes from (function call is the same).
I have neither an error nor a warning with the following code:
clear all; % optional
SOFAstart;
Obj = SOFAgetConventions('SimpleFreeFieldHRIR');
Obj.Data.IR = rand(1000,2,256);
[dtf,ctf] = SOFAhrtf2dtf(Obj);
(tested with SOFA Toolbox for Matlab/Octave 2.1.2, SOFA version 2.1, SimpleFreeFieldHRIR conventions version 1.0)
What happens if you run the code above?
This is the output on the console:
SOFA Toolbox for Matlab/Octave 2.1.2. Copyright: Acoustics Research Institute.
This API implements SOFA version 2.1.
Available SOFA Conventions: FreeFieldDirectivityTF, FreeFieldHRIR, FreeFieldHRTF, General, GeneralFIR, GeneralFIR-E, GeneralFIRE, GeneralSOS, GeneralString, GeneralTF, GeneralTF-E, SimpleFreeFieldHRIR, SimpleFreeFieldHRSOS, SimpleFreeFieldHRTF, SimpleFreeFieldSOS, SimpleHeadphoneIR, SingleRoomMIMOSRIR, SingleRoomSRIR
SOFAdbPath (local HRTF database): C:\Users\kpollack\Documents\MATLAB\SOFAtoolbox\data\SOFA
SOFAdbURL (internet repository): http://www.sofacoustics.org/data
and I have three structs in the workspace: ctf, dtf, and Obj None of them have the field GLOBAL_Comment - I don't understand 😬
This means, that SOFAhrtf2dtf works as expected on your machine.
Now, could you provide information to reproduce your problem?
GLOBAL_Comment is not a mandatory field (anymore) in SimpleFreeFieldHRIR.
I could solve the problem by using a fresh Matlab session! Thank you for your help :)
You're welcome :-)
My workaround is to create the field and assigning it an empty string, i.e.,
HRTF_Obj.GLOBAL_Comment = ' ';