Hi, thank you for creating this amazing project.
After the converting the HRTF result to HRIR, I realised that the impluse responses seem to be time reversed. I wonder if that is normal and what's the cause of that?
The following is the code I used to convert and plot one of the HRIR results.
file_name = 'EvaluationGrid.sofa'; % 'EvaluationGrid_flat.sofa' or 'HRIR_dfe.sofa'
n = 397; % data number (397 = [90, 0] for ARI)
hrtf = SOFAload(file_name);
hrir=SOFAconvertConventions(hrtf);
figure
plot(squeeze(hrir.Data.IR(n,1,:)))
hold on
plot(squeeze(hrir.Data.IR(n,2,:)))
title('HRIR')
figure
loglog(abs(squeeze(hrtf.Data.Real(n,1,:))+1i*squeeze(hrtf.Data.Imag(n,1,:))))
hold on
loglog(abs(squeeze(hrtf.Data.Real(n,2,:))+1i*squeeze(hrtf.Data.Imag(n,2,:))))
title('HRTF')
Sorry if this is one of the silly questions. I would like to thankyou in adanve for your kind support.
Hi,
this is not a silly question at all! I think the time reversal happens because Mesh2HRTF (or NumCalc to be precise) and Matlab use different sign conventions for the Fourier Transform.
I added a better way to get HRIRs to Mesh2HRTF 0.5.0. You can find it in
Output2HRTF/Source/Output2HRTF_Main.m(search forcomputeHRIRs) in the develop branch.Note that you should also reference your HRTF to the origin to get correct Levels and remove the delay due to the acoustic path length from the source to the ear (search for
referencein the same m-file).Best, Fabian
Thank you for your prompt reply! I will have a look into the code. :)
Many thanks,
bt