sofacoustics / SOFAtoolbox

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

[bug] SOFAconvertCIPIC2SOFA inverted channels #28

Closed davircarvalho closed 3 years ago

davircarvalho commented 3 years ago

Hello,

I am playing around with the CIPIC dataset and noticed the results for the conversion with SOFAconvertCIPIC2SOFA.m results in HRIR for the ipsislateral ear having lower amplitude than the contralateral ear. The CIPIC HRTFs in sofaconventions.org also seem to have the same issue (assuming channel 1 is for left and 2 is for the right, as is described in all the other datasets).

Here is an example of such observation:

ir

The code used to plot the image above:

CIPIC = load([local '\hrir_final.mat']);
Obj=SOFAconvertCIPIC2SOFA(CIPIC);
idx = dsearchn(Obj.SourcePosition(:,[1,2]), [90, 0]);
ir = squeeze(Obj.Data.IR(idx,:,:));

plot(ir.')
legend('left', 'right')
title(['azim: ' num2str(Obj.SourcePosition(idx,1)),...
      '° elev: ' num2str(Obj.SourcePosition(idx,2)) '°']);
isfmiho commented 3 years ago

Dear Davi,

it seems that CIPIC and SOFA have an inverted mapping of azimuth angles (left / right).

I'm quite sure that a "-" in SOFAconvertCIPIC2SOFA should fix the problem. I will check and fix that on Monday or Tuesday.

row 34 --> /[azi,ele]=hor2sph(-lat(ii),pol(ii));/

Best regards, Michael

Am 18.02.2021 um 15:45 schrieb Davi Carvalho:

Hello,

I am playing around with the CIPIC dataset and noticed the results for the conversion with SOFAconvertCIPIC2SOFA.m results in HRIR for the ipsislateral ear having lower amplitude than the contralateral ear. The CIPIC HRTFs in sofaconventions.org also seem to have the same issue (assuming channel 1 is for left and 2 is for the right, as is described in all the other datasets).

Here is an example of such observation: ir https://user-images.githubusercontent.com/49624338/108373012-2e654800-71de-11eb-9925-c841d39ce868.png

The code used to plot the image above: `CIPIC = load([local '\hrir_final.mat']); Obj=SOFAconvertCIPIC2SOFA(CIPIC); idx = dsearchn(Obj.SourcePosition(:,[1,2]), [90, 0]); ir = squeeze(Obj.Data.IR(idx,:,:));

plot(ir.') legend('left', 'right') title(['azim: ' num2str(Obj.SourcePosition(idx,1)),... '° elev: ' num2str(Obj.SourcePosition(idx,2)) '°']); `

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/sofacoustics/API_MO/issues/28, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC6VIMQMXEIQSK6NQFNHAMTS7URZFANCNFSM4X2NUKMA.