sofacoustics / SOFAtoolbox

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

SOFA file dosn't work in Decoder #34

Closed fewege closed 2 years ago

fewege commented 3 years ago

I have created a sofa-file using the SOFAconvertMIT2SOFA function. Now I want to use the rendered sofa-file with the IEM AdpativeBinauralDecoder (BETA) but the plugin gives me the following error: " Weights generation failed. Error: Generic error. Failed to load HRTF."

Since other sofa-files work the problem probably is my generated file.

I'll paste my code bellow. I would be greatful, if someone could help me on this.

>> SOFAconvertMIT2SOFA('C:\Users\felix\Desktop\SOFA API for Matlab and Octave 1.1.3\HRTFs\MIT KEMAR','normal')

ans = 

  struct with fields:

               GLOBAL_Conventions: 'SOFA'
                   GLOBAL_Version: '1.0'
           GLOBAL_SOFAConventions: 'SimpleFreeFieldHRIR'
    GLOBAL_SOFAConventionsVersion: '1.0'
                   GLOBAL_APIName: 'ARI SOFA API for Matlab/Octave'
                GLOBAL_APIVersion: '1.1.3'
           GLOBAL_ApplicationName: ''
        GLOBAL_ApplicationVersion: ''
             GLOBAL_AuthorContact: ''
                   GLOBAL_Comment: ''
                  GLOBAL_DataType: 'FIR'
                   GLOBAL_History: 'Converted from the MIT format'
                   GLOBAL_License: 'No license provided, ask the author for permission'
              GLOBAL_Organization: ''
                GLOBAL_References: ''
                  GLOBAL_RoomType: 'free field'
                    GLOBAL_Origin: ''
               GLOBAL_DateCreated: '1999-11-16 20:01:52'
              GLOBAL_DateModified: ''
                     GLOBAL_Title: ''
                 ListenerPosition: [0 0 0]
                              API: [1×1 struct]
            ListenerPosition_Type: 'cartesian'
           ListenerPosition_Units: 'metre'
                 ReceiverPosition: [2×3 double]
            ReceiverPosition_Type: 'cartesian'
           ReceiverPosition_Units: 'metre'
                   SourcePosition: [710×3 double]
              SourcePosition_Type: 'spherical'
             SourcePosition_Units: 'degree, degree, metre'
                  EmitterPosition: [0 0 0]
             EmitterPosition_Type: 'cartesian'
            EmitterPosition_Units: 'metre'
              GLOBAL_DatabaseName: ''
         GLOBAL_ListenerShortName: 'KEMAR, normal pinna'
                       ListenerUp: [0 0 1]
                     ListenerView: [1 0 0]
                ListenerView_Type: 'cartesian'
               ListenerView_Units: 'metre'
                             Data: [1×1 struct]

>> OBJ=ans

OBJ = 

  struct with fields:

               GLOBAL_Conventions: 'SOFA'
                   GLOBAL_Version: '1.0'
           GLOBAL_SOFAConventions: 'SimpleFreeFieldHRIR'
    GLOBAL_SOFAConventionsVersion: '1.0'
                   GLOBAL_APIName: 'ARI SOFA API for Matlab/Octave'
                GLOBAL_APIVersion: '1.1.3'
           GLOBAL_ApplicationName: ''
        GLOBAL_ApplicationVersion: ''
             GLOBAL_AuthorContact: ''
                   GLOBAL_Comment: ''
                  GLOBAL_DataType: 'FIR'
                   GLOBAL_History: 'Converted from the MIT format'
                   GLOBAL_License: 'No license provided, ask the author for permission'
              GLOBAL_Organization: ''
                GLOBAL_References: ''
                  GLOBAL_RoomType: 'free field'
                    GLOBAL_Origin: ''
               GLOBAL_DateCreated: '1999-11-16 20:01:52'
              GLOBAL_DateModified: ''
                     GLOBAL_Title: ''
                 ListenerPosition: [0 0 0]
                              API: [1×1 struct]
            ListenerPosition_Type: 'cartesian'
           ListenerPosition_Units: 'metre'
                 ReceiverPosition: [2×3 double]
            ReceiverPosition_Type: 'cartesian'
           ReceiverPosition_Units: 'metre'
                   SourcePosition: [710×3 double]
              SourcePosition_Type: 'spherical'
             SourcePosition_Units: 'degree, degree, metre'
                  EmitterPosition: [0 0 0]
             EmitterPosition_Type: 'cartesian'
            EmitterPosition_Units: 'metre'
              GLOBAL_DatabaseName: ''
         GLOBAL_ListenerShortName: 'KEMAR, normal pinna'
                       ListenerUp: [0 0 1]
                     ListenerView: [1 0 0]
                ListenerView_Type: 'cartesian'
               ListenerView_Units: 'metre'
                             Data: [1×1 struct]

>> SOFAsave('C:\Users\felix\Desktop\SOFA API for Matlab and Octave 1.1.3\HRTFs\MIT KEMAR\heureka.sofa',OBJ)

ans = 

  struct with fields:

               GLOBAL_Conventions: 'SOFA'
                   GLOBAL_Version: '1.0'
           GLOBAL_SOFAConventions: 'SimpleFreeFieldHRIR'
    GLOBAL_SOFAConventionsVersion: '1.0'
                   GLOBAL_APIName: 'ARI SOFA API for Matlab/Octave'
                GLOBAL_APIVersion: '1.1.3'
           GLOBAL_ApplicationName: ''
        GLOBAL_ApplicationVersion: ''
             GLOBAL_AuthorContact: ''
                   GLOBAL_Comment: ''
                  GLOBAL_DataType: 'FIR'
                   GLOBAL_History: 'Converted from the MIT format'
                   GLOBAL_License: 'No license provided, ask the author for permission'
              GLOBAL_Organization: ''
                GLOBAL_References: ''
                  GLOBAL_RoomType: 'free field'
                    GLOBAL_Origin: ''
               GLOBAL_DateCreated: '1999-11-16 20:01:52'
              GLOBAL_DateModified: '2021-09-02 11:36:24'
                     GLOBAL_Title: ''
                 ListenerPosition: [0 0 0]
                              API: [1×1 struct]
            ListenerPosition_Type: 'cartesian'
           ListenerPosition_Units: 'metre'
                 ReceiverPosition: [2×3 double]
            ReceiverPosition_Type: 'cartesian'
           ReceiverPosition_Units: 'metre'
                   SourcePosition: [710×3 double]
              SourcePosition_Type: 'spherical'
             SourcePosition_Units: 'degree, degree, metre'
                  EmitterPosition: [0 0 0]
             EmitterPosition_Type: 'cartesian'
            EmitterPosition_Units: 'metre'
              GLOBAL_DatabaseName: ''
         GLOBAL_ListenerShortName: 'KEMAR, normal pinna'
                       ListenerUp: [0 0 1]
                     ListenerView: [1 0 0]
                ListenerView_Type: 'cartesian'
               ListenerView_Units: 'metre'
                             Data: [1×1 struct]

>>  
HaHeho commented 3 years ago

Maybe also check if all components in the Data sub-struct exist and have the appropriate sizes and ranges.

The error from the Plugin is not very informative of course. But maybe it is related to the quadrature weights of the sampling grid? ... never mind, I don't think SOFA provides a standardized property to store the weights anyways, right? So I don't know what the plugin would do in that regard (they probably don't use the weights and do the transformation into spherical harmonics via the pseudo-inverse).

isfmiho commented 2 years ago

Hi, is this issue still open or can I close the topic?

isfmiho commented 2 years ago

Hi, if the issue still occurs I would like to reproduce it.

Can you maybe share an example project (eg. Reaper), including all necessary files, and with one working and one non-working SOFA file, so I can try to detect the specific difference that causes the error.

isfmiho commented 2 years ago

Issue cannot be reproduced. The problem might depend on the combination of your SOFA file, and/or on the plugin.