Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2nd order Binauralizer + MIT HRTF #28

Open
joshkopecek opened this issue Mar 17, 2021 · 3 comments
Open

2nd order Binauralizer + MIT HRTF #28

joshkopecek opened this issue Mar 17, 2021 · 3 comments

Comments

@joshkopecek
Copy link

Using the CAmbisonicBinauralizer, it works fine with 1st order. However, when I come to configure 2nd order, it fails because in AmbisonicLib.cpp, the speakers are initialised like this - note the Elevation of Loudspeaker 1 as -69.1º.

case kAmblib_Dodecahedron:
        // This arrangement is used for second and third orders
        m_nSpeakers = 20;
        m_pAmbSpeakers = new CAmbisonicSpeaker[m_nSpeakers];
        // Loudspeaker 1
        polPosition.fElevation = DegreesToRadians(-69.1f);
        polPosition.fAzimuth = DegreesToRadians(90.f);
        m_pAmbSpeakers[0].Configure(m_nOrder, m_b3D, 0);
        m_pAmbSpeakers[0].SetPosition(polPosition);
        // Loudspeaker 2
        polPosition.fAzimuth = DegreesToRadians(-90.f);
        m_pAmbSpeakers[1].Configure(m_nOrder, m_b3D, 0);
        m_pAmbSpeakers[1].SetPosition(polPosition);
        …

then when loading the MIT HRTF in mit_hrtf_lib.c:

unsigned int mit_hrtf_availability(int azimuth, int elevation, unsigned int samplerate)
{
    if(elevation > 90 || elevation < -40)
        return 0;

    if(azimuth > 180 || azimuth < -180)
        return 0;

    if(samplerate == 44100)
        return MIT_HRTF_44_TAPS;
    else if(samplerate == 48000)
        return MIT_HRTF_48_TAPS;
    else if(samplerate == 88200)
        return MIT_HRTF_88_TAPS;
    else if(samplerate == 96000)
        return MIT_HRTF_96_TAPS;

    return 0;
}

It fails because the Elevation of the speaker is below -40º, which seems like it is intended for MIT HRTF.

If I disable this check, it fails further down because the filters/taps are not available for below -40º.

The speaker arrangement is automatically configured as a kAmblib_Dodecahedron because of 2nd order in CAmbisonicBinauralizer.

Any help here or pointers as to how to set up 2nd (or 3rd?) order would be greatly appreciated.

@joshkopecek joshkopecek changed the title Issue with 2nd order with Binauralizer 2nd order Binauralizer + MIT HRTF Mar 18, 2021
@joshkopecek
Copy link
Author

FYI, I'm going to try using SOFA instead with some data from York Uni's SADIE database

@joshkopecek
Copy link
Author

Just to let you know I've had success with SOFA.

It might be good to put some info into the readme detailing that:

  1. MIT HRTF does not work with > FOA with the Binauralizer.
  2. libmysofa is required to use the SOFA files (along with a .sofa file, although libmysofa includes one).

Happy to PR the readme, if needed.

@tguillem tguillem assigned tguillem and unassigned tguillem Mar 22, 2021
@jbkempf
Copy link
Collaborator

jbkempf commented Apr 10, 2021

@joshkopecek yes, more documentation and information would be nice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants