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

Convincing proximity simulation #1113

Open
ThreeDeeJay opened this issue Feb 17, 2025 · 4 comments
Open

Convincing proximity simulation #1113

ThreeDeeJay opened this issue Feb 17, 2025 · 4 comments

Comments

@ThreeDeeJay
Copy link
Contributor

ThreeDeeJay commented Feb 17, 2025

I know there's been multiple discussions on ways to improve proximity using Near-Field Control/multi-field, but the issues have been closed even though distance is still not quite convincing yet, and our options come with compromises:

  • NFC
    ❌Requires ambi3 which noticeably degrades HRTF positional accuracy compared to full
    ⚠️Using this config, with the default HRTF and SADIE D1 it's too subtle and with others like SADIE H6 it gets way too bassy when getting up close (which was related to sample size or something?). Also there's some panning artifacts after setting nfc=true.
  Recordings
NFC_Default_DFC_on.mp4
NFC_D1_44K_16bit_256tap_FIR_SOFA_DFC_off.mp4
NFC_SADIE.II.H6_DFC_off.mp4
  • Multi-field/Multi-SOFA
    ✅Sounds a lot more convincing, especially in the "whisper zone", compared to nfc (plus doesn't suffer from panning artifacts heard in the clips above), though not as good as CMSS-3D's MacroFX or 3DTI
    ❌Requires an HRTF that has been specifically recorded in multiple fields.
  Recording
NFC_SCUT_KEMAR_radius_all-48000_DFC_on.mp4

I'm not really an expert at any of this and I'm not sure if I'm just missing something and comparing apples to oranges (different reverb/air absorption strength/nfc scale/attenuation linearity/max gain/HRTF density?), but ultimately I just trust my ears and I can't get over how well distance is simulated in 3DTI AudioToolkit. Like I can much more easily tell when the sound is in the "whisper zone", at arm's length or a couple meters away, regardless of volume or bass, compared to the same HRTF in OpenAL Soft in the second clip above.

BinauralTestApp_FrGDGriGdp.mp4

Perhaps there are more technical hints about how they're able to achieve this in their code, which is also written C++ though I'm not sure if licenses are compatible at the moment: https://github.com/3DTune-In/3dti_AudioToolkit/blob/master/3dti_Toolkit/BinauralSpatializer/ILD.cpp

@kcat
Copy link
Owner

kcat commented Feb 18, 2025

The panning artifacts with NFC is due to the filter parameters changing with distance, which changes the frequency response. This is primarily an issue in higher orders (2+) which have more significant low-frequency alterations. This can be fixed by somehow blending or interpolating between the two states. Ideally changes to the NFC filter could be synced with changes to the panning gains and direct/send filters (that is, the old properties fade out together while the new ones fade in, without any bleedover (the new filter properties subtly fading in at the old position that's fading out, and the old filter properties audibly fading out at the new position that's fading in)). But that would be very difficult to do as things currently are.

As for the inconsistent bass response, that's likely due to differences in the HRTF, since the NFC filter is only boosting (or attenuating) the low frequencies that are already there and these are more difficult to hear frequencies. HRTFs that don't keep much of the very low frequencies will likely have a less audible change, while HRTFs that try to give a more rich bass response will have more a audible change.

Regarding the 3DTI code, that source file at least doesn't really have much. It's just a couple functions to convert the given distance and azimuth to an index and give back the ILD (Inter-aural Level Difference; basically the frequency FIR filter) for the given ear that was already loaded into the relevant arrays. There's no info there about how the near-field effect is done (oddly, the near-field coefficients are separate from the normal ones, even though both include the distance for the index lookup). Interestingly, it seems all the filters only use a fixed 10-sample length, and it doesn't handle height.

@ThreeDeeJay
Copy link
Contributor Author

@PyrApple
Copy link

PyrApple commented Mar 5, 2025

3DTI uses warped 4th order IIR [1] fit to a spherical ILD model [2]. Code isn't mine to share, no trickery involved though, won't be too hard to reproduce from papers.

[1] Frequency-warped signal processing for audio applications. Harma, Karjalainen, Savioja, Valimaki, Laine, Huopaniemi. J. Audio Eng. Soc. 2000.
[2] Range dependence of the response of a spherical head model. Duda, Martens. J. Acoust. Soc. Am. 1998

@ThreeDeeJay
Copy link
Contributor Author

I'm not sure about 1 but OpenAL Soft's SOFA converter has an option for spherical head delay which might be relevant 🤔

fmt::println(ofile, " -d {{dataset| Specify the model used for calculating the head-delay timing");
fmt::println(ofile, " sphere}} values (default: {}).", ((HM_Default == HM_Dataset) ? "dataset" : "sphere"));

Also I noticed 3DTI apparently was superseded by BeRTA, which includes SOFAs for discrete NFC distances
@kcat could makemhr perhaps use those to generate multi-field MHRs with "baked-in" NFC? Unless NFC isn't fully "baked" into those SOFAs and also relies on extra software to handle it. Just a wild guess though, my brain's too smooth for research papers 🗿

NFC on noticeably improves distance simulation up close, though even after I turned it off, distance simulation was still somewhat convincing, apparently because of the BRIR which seems to be doing some heavy lifting (at least until positioning starts becoming diffuse) but OpenAL Soft seems to already use reverb differently depending on the sound's distance, right?

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