sofacoustics / SOFAtoolbox

SOFA Toolbox (API for Matlab, Octave)
http://sofaconventions.org
European Union Public License 1.2
116 stars 31 forks source link

Warning: Unsupported SOFA conventions: SimpleFreeFieldHRIR. Skipping all checks. #68

Closed artiko88 closed 1 year ago

artiko88 commented 1 year ago

This is the kind of error i get when i try to convert a sofa file. Code is running on Matlab webversion (basic subscription). Sofa file is one from public database - dtf las_nh4.sofa Get the same error with sofa file generated by mesh2hrtf.

Exact error text:

`>> SofaTest Warning: Convention SimpleFreeFieldHRIR not found.

In [SOFAgetConventions](matlab:matlab.internal.language.introspective.errorDocCallback('SOFAgetConventions', '/MATLAB Drive/SOFAtoolbox/SOFAgetConventions.m', 98)) ([line 98](matlab: opentoline('/MATLAB Drive/SOFAtoolbox/SOFAgetConventions.m',98,0))) In [SOFAload](matlab:matlab.internal.language.introspective.errorDocCallback('SOFAload', '/MATLAB Drive/SOFAtoolbox/SOFAload.m', 152)) ([line 152](matlab: opentoline('/MATLAB Drive/SOFAtoolbox/SOFAload.m',152,0))) In [SofaTest](matlab:matlab.internal.language.introspective.errorDocCallback('SofaTest', '/MATLAB Drive/SofaTest.m', 12)) ([line 12](matlab: opentoline('/MATLAB Drive/SofaTest.m',12,0))) Warning: Unsupported SOFA conventions: SimpleFreeFieldHRIR. Skipping all checks. In [SOFAload](matlab:matlab.internal.language.introspective.errorDocCallback('SOFAload', '/MATLAB Drive/SOFAtoolbox/SOFAload.m', 154)) ([line 154](matlab: opentoline('/MATLAB Drive/SOFAtoolbox/SOFAload.m',154,0))) In [SofaTest](matlab:matlab.internal.language.introspective.errorDocCallback('SofaTest', '/MATLAB Drive/SofaTest.m', 12)) ([line 12](matlab: opentoline('/MATLAB Drive/SofaTest.m',12,0)))

`

Code to replicate:

`addpath('/MATLAB Drive/SOFAtoolbox') addpath('/MATLAB Drive/SOFAtoolbox/converters') addpath('/MATLAB Drive/SOFAtoolbox/coordinates') addpath('/MATLAB Drive/SOFAtoolbox/demos') addpath('/MATLAB Drive/SOFAtoolbox/helpers') addpath('/MATLAB Drive/SOFAtoolbox/licenses') addpath('/MATLAB Drive/SOFAtoolbox/test') addpath('/MATLAB Drive/SOFAtoolbox/netcdf') addpath('/MATLAB Drive/SOFAtoolbox/conventions') savepath('/MATLAB Drive/pathdef.m')

s = SOFAload('dtf las_nh4.sofa');`

petibub commented 1 year ago

Hi! Could you try again but this time start the toolbox by calling SOFAstart before using it? And why adding manually all these paths?

artiko88 commented 1 year ago

Hey!

Thank you for answering. Adding SOFAstart before using it made all functions available.

The toolbox is used withing a converter that has been provided by the developers of Anaglyph application. Apparently, it is based on some old version of the library. Here is the link to the tool - http://anaglyph.dalembert.upmc.fr/page-tutorials.html

I know you are not the developer of that particular tool, but maybe you can point me in the right direction on how to make that tool work. It crashes with the following error: "Unable to perform assignment because the size of the left side is 3361-by-1 and the size of the right side is 1-by-22."

As for adding paths manually - this is the first time i ever launched MatLab since i don't have experience in this particular programming language. Add path function was the first way i found to quickly to it quickly in a messy (to my unexperienced eye) online interface.

petibub commented 1 year ago

Hi! And welcome to the weird world of Matlab :-).

As for the SOFA Toolbox, you only need SOFAstart at the beginning - do not add paths of the toolbox (besides that one to the main toolbox directory), SOFAstart does that for you depending on your platform.

The error you describe means that the code tries to assign a 1-by-22 matrix to a variable that was allocated as 3361-by-1. I unfortunately don't know where the problem comes from, as I never used Anaglyph yet. Maybe the main developers help?

artiko88 commented 1 year ago

Piotr, i know this is a closed issue, but in order to not post any new ones, i decided to ask here.

There is a code in the converter that tries to extract the ITDs:

onsetThresh = 50e-3;
numSampBeforeOnset = 20
s = sofaExtractItd(s, numSampBeforeOnset, onsetThresh);

but returns this warining:

Warning: padding IR beginning with 15 zeros to match nPointsBeforeOnsetHead criteria (current min delay before onset is 6 samp)

I tried printing the struct after running ITD extraction command, but did not find any fields having to do with ITDs. So probably, ITDs are not being extracted due to the warning.

Can you point me to the right direction on how to extract ITDs properly?

petibub commented 1 year ago

I don't know how to help because we don't have sofaExtractItd in our toolbox. Which "converter" do you mean - one of the SOFAconvert* functions?

davircarvalho commented 1 year ago

@artiko88 that's Anaglyph related code it's not from SOFAtoolbox.

in the output object from that function, the itd removed from the HRIRs are probably under Obj.Data.Delay

artiko88 commented 1 year ago

@davircarvalho Exactly! My mistake, sorry. The file was in sofa-utils folder and i confused it with sofatoolbox.