How to adjust the Head-related transfer function (HRTF) in OpenAL or Core Audio?
Asked Answered
P

3

7

OpenAL makes use of HRTF algorithms to fake surround sound with stereo headphones. However, there is an important dependency between HRTF and the shape of the users head and ears.

Simplified, this means: If your head / ears differ too much from the standard HRTF function they have implemented, the surround sound effect fades towards boring stereo.

I haven't yet found a way to adjust the various factors contributing to the HRTF algorithm, such as head diameter, pinna / external ear size, ear-to-ear distance, nose length and other important properties influencing the HRTF.

Is there any known way of setting these parameters for best surround sound experience?

Plume answered 23/1, 2012 at 22:24 Comment(0)
C
8

I don't believe you can alter the HRTF in OpenAL. You certainly couldn't do it by putting in parametric values such as nose or pinna size. The only way to find out your HRTF is to put some very tiny, very accurate microphones in your ears, go into an anechoic chamber and take frequency response measurements at every angle around your head. Obviously this is time consuming, expensive and impractical. It would be fantastic to be able to work out your HRTF from measuring your head, but unfortunately acoustics isn't that deterministic and your ear is very sensitive to inaccuracies as you pointed out. I think the OpenAL HRTF is based on some KEMAR dummy head measurements (these perhaps?).

So, I think the short answer is that you can't alter the HRTF for OpenAL. Because HRTF is such a complex function that your ear is so sensitive to, there's no accurate way to approximate it with parametric values.

Counterblast answered 26/1, 2012 at 12:32 Comment(2)
So does that basically mean only a subset of all users is able to hear true surround sound out of OpenAL when using headphones?Plume
Well, unless you actually are a KEMAR plastic dummy head, the spatial imaging using it's HRTF isn't going to be perfect. However, using a slightly inaccurate HRTF is a vast improvement to not using one at all. Don't forget that there's a lot of other factors involved too - how flat the frequency response of your headphones is (not very, even good ones), the nature of the audio source material etc. So nobody's actually going to hear "true" surround out of OpenAL using headphones, but that's not necessarily the point - consider it a surround "effect" rather than a precise spatial location tool.Counterblast
A
0

You might be able to make a "configuration game" out of optimizing the HRTF. I've been looking for an answer to the question if any of the virtual surround headsets or soundcards allow you adjust them to fit your personal HRTF.

Idea: You vary the different HRTF variables and play a sound. The user has to close his eyes and move the mouse into the direction he thought the sound came from. You measure how right he was. You could use something like a thin plate spline or statistical curve fitting to plot the accuracy results and sample different regions of the multidimensional HRTF space to optimize the solution. This would be a kind of "brute force" method to find a solution that is not necessary accurate, but as good as the user has patience to optimize his personal HRTF.

According to a readme in the OpenALSoft sourcecode it uses a 32-sample convolution filter and you can create using custom HRTF samples.

Ambition answered 14/2, 2014 at 17:25 Comment(0)
R
0

It looks like it is now possible. I stumbled upon this comment which describes how to use hrtf_tables for approximations of your own ears. Google is showing me results for something called hrtf-paths as well but I'm not sure what that is.

Repressive answered 28/1, 2017 at 3:30 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.