interpolateHRTF always trows warnings or errors when using either methods

I am trying to interpolate positions from the ARI database to the CIPIC database, but when I use the 'bilinear' mode the functions can't find the correct B position and trows an error.
However when I try to use the 'vbap' mode I ALWAYS get "Warning: Matrix is close to singular or badly scaled.
Results may be inaccurate." no matter the objective positions specified. What should I do? Please someone send help!

답변 (1개)

Can I ask what version of Matlab you are using?
If you can provide some sample code, it might also help. Does the help example work correctly on your machine? If so, does this also work afterwards?
interpolatedIRVBAP = interpolateHRTF(hrtfData,sourcePosition,desiredPosition,'Algorithm','VBAP');

댓글 수: 6

I am running Matlab R2020a, and the help example works just fine
.
He
re is what I am trying to perfo
rm:
clear all; clc;
%% LOAD DATA
local = 'B:\Documentos\#3 - TCC\EAC-TCC-Davi\HRTF-datasets\';
pathcipic = dir([local 'Banco CIPIC\SOFA\*.sofa']);
pathari = dir([local '\Banco ARI\HRTF_DTF\database\ari\hrtf b_nh*.sofa']);
path3d3a = dir([local '\Banco 3D3A lab\Public-Data\Subject*\Subject*_HRIRs.sofa']);
CIPIC = SOFAload([pathcipic(1).folder '\' pathcipic(1).name], 'nochecks');
ARI = SOFAload([pathari(1).folder, '\',pathari(1).name], 'nochecks');
D3A = SOFAload([path3d3a(1).folder, '\',path3d3a(1).name], 'nochecks');
%% case 1 % %
inpt_pos = ARI.SourcePosition;
des_pos = CIPIC.SourcePosition;
IR_ari_cip = interpolateHRTF(ARI.Data.IR, inpt_pos(:,[1,2]), des_pos(:,[1,2]), ...
'Algorithm','vbap' );
%% case 2
inpt_pos = CIPIC.SourcePosition;
des_pos = D3A.SourcePosition;
IR_cip_d3a = interpolateHRTF(CIPIC.Data.IR, inpt_pos(:,[1,2]), des_pos(:,[1,2]), ...
'Algorithm','bilinear' );
Is there something I'm doing wrong, or is the function misbehaving?
Your usage is correct.
For Bilinear, it appears that the CIPIC database did not take measurements on the kind of grid layout required for the bilinear method to find the 3 points it needs. I inverted the two databases here and this works:
des_pos = CIPIC.SourcePosition;
inpt_pos = D3A.SourcePosition;
IR_cip_d3a = interpolateHRTF(D3A.Data.IR, inpt_pos(:,[1,2]), des_pos(:,[1,2]), ...
'Algorithm','bilinear' );
I will have to dive deaper to see if the bilinear method could be enhanced to work with this different grid layout.
For VBAP, there is a numerical warning when the azimuths are 99.x or 260.x (360-99.x). This will be fixed ASAP. In the meantime I'll just say p*pinv(a) can sometimes be an alternative to p/a. Hope that helps :)
I did a quick look at the bilinear function and it seems like there is no flexibility to how point A is choosen. After finding the closest point to the desired position if there is no point B at the same elevation it goes directly to error. If you allow it to try another point A (the next one with smaller error) you could add more flexibility to the function. It's just an idea.
Thank you for that suggestion. I looked into the method being implemented and it looks like that's where the limitation came from.
"It is assumed, without loss of generality, that the points A and B have the same elevation"
I'd hope to keep A as the closest point, but have the computation work even if B doesn't have the same elevation. Ideally we only need A, B and C to form a triangle around the destination point.
Indeed, when I read it the first time it seemed weird the implementation that point B "must" be at the same elevation as A, but that's why I suggested to change point A if it couldn't find a point B match.
when you manage to solve the functions, will I need to wait until a new matlab update to use your implementations? :/

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Calendar에 대해 자세히 알아보기

제품

릴리스

R2019b

질문:

2020년 3월 30일

편집:

2020년 4월 9일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by