sofacoustics / SOFAtoolbox

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

SOFAupdateDimensions yields error if EmitterDescription is defined #12

Closed fietew closed 8 years ago

fietew commented 8 years ago

According to http://www.sofaconventions.org/mediawiki/index.php/MultiSpeakerBRIR, version 0.3 of MultiSpeakerBRIR uses SOFA 1.0 which reflects the standard AES69-2015. According to the AES Standard, "EmitterDescription", "ListenerDescription", ... are optional fields. However,

sofa = SOFAgetConventions('MultiSpeakerBRIR');
sofa.EmitterDescription = 'test';
SOFAupdateDimensions( sofa );

yields

Error using SOFAupdateDimensions (line 85)
EmitterDescription seems to be a user-defined variable without a dimension.
petibub commented 8 years ago

Dear Fiete,

could you try:

sofa.GLOBAL_EmitterDescription = 'test'; SOFAupdateDimensions( sofa );

In our API, all global attributes (and EmitterDescription is a global attribute) need a GLOBAL_ prefix. Without the prefix, the API thinks that EmitterDescription is a variable and expects a dimension.

Regards, Piotr

Fiete Winter wrote:

According to http://www.sofaconventions.org/mediawiki/index.php/MultiSpeakerBRIR, version 0.3 of MultiSpeakerBRIR /uses SOFA 1.0 which reflects the standard AES69-2015/. According to the AES Standard, "EmitterDescription", "ListenerDescription", ... are optional fields. However,

sofa = SOFAgetConventions('MultiSpeakerBRIR'); sofa.EmitterDescription ='test'; SOFAupdateDimensions( sofa );

yields

|Error using SOFAupdateDimensions (line 85) EmitterDescription seems to be a user-defined variable without a dimension. |

— Reply to this email directly or view it on GitHub https://github.com/sofacoustics/API_MO/issues/12.

Piotr Majdak Psychoakustik und Experimentelle Audiologie Institut für Schallforschung http://www.kfs.oeaw.ac.at Österreichische Akademie der Wissenschaften http://www.oeaw.ac.at/ Wohllebengasse 12-14, 1040 Wien Tel.: +43 1 51581-2511 Fax: +43 1 51581-2530

fietew commented 8 years ago

In the AES standard ( http://www.aes.org/publications/standards/search.cfm?docID=99 ), 'EmitterDescription' or 'ListenerDescription' do not appear in the table for global attributes ( p. 16, Table 2 ), but are rather listed in in Table 3 and 4 (p. 17), respectively. How is this related to the current implementation of the API?

petibub commented 8 years ago

Dear Fiete,

that's a little bit tricky:

EmitterDescription is not in the Table with the general attributes (Tab. 2) because it belongs to the object Listener. EmitterDescription is thus described in Tab. 3, which addresses the metadata related to the Listener. It is, however, still a global attribute.

In the Matlab/Octave API, EmitterDescription must be encoded as X.GLOBALEmitterDescription (with X as the variable containing the SOFA structure). In the API, all global attributes must be prefixed by GLOBAL.

Hope that help, Piotr

Fiete Winter wrote:

In the AES standard ( http://www.aes.org/publications/standards/search.cfm?docID=99 ), 'EmitterDescription' or 'ListenerDescription' do not appear in the table for global attributes ( p. 16, Table 2 ), but are rather listed in in Table 3 and 4 (p. 17), respectively. How is this related to the current implementation of the API?

— Reply to this email directly or view it on GitHub https://github.com/sofacoustics/API_MO/issues/12#issuecomment-145826549.

Piotr Majdak Psychoakustik und Experimentelle Audiologie Institut für Schallforschung http://www.kfs.oeaw.ac.at Österreichische Akademie der Wissenschaften http://www.oeaw.ac.at/ Wohllebengasse 12-14, 1040 Wien Tel.: +43 1 51581-2511 Fax: +43 1 51581-2530

fietew commented 8 years ago

All right, I got it now. Thank you very much for your help.