HRTF personalisation with two sliders
an HRTF model learned from measured heads, fitted to a listener with a head-size slider and an ear slider
abstract
Most people hear binaural audio through one dummy head, the Neumann KU100. bambi’s decoder offers a head of your own for almost no effort: two sliders, one for the size of the head and one for the ears, over a head made from the average of 268 measured heads. The timbre stays the KU100’s; what changes is where sounds seem to come from. The aim is a quick gain over the dummy, not the reconstruction of anyone’s measured head.
the aim
A measured head — in a loudspeaker array, or from a scan — is the most accurate, and out of reach for most listeners. The dummy head is the opposite: one head for everyone, and for many people sounds that sit inside the head or flip from front to back. The decoder aims between the two: a head that beats the dummy after a few minutes of listening, found by ear, with nothing to measure and no file to load.
Heads are taken as symmetric: one ear over the whole sphere is a head, and the other ear its mirror. This halves what the model has to describe and makes every measured head two: its left ear mirrored, and its right. A head’s two ears differ by two thirds of what two different heads differ by, so the two are distinct heads rather than copies.
the cues
A head is described by what its two ears hear from a direction θ, on an auditory frequency axis: the ERB number, which spaces frequencies as the ear resolves them,
From the two ears’ transfer functions HL and HR come three cues. The summed level (the composite loudness level, CLL) carries what the two ears share, among it the outer ear’s cues for height; the level difference (ILD) and the time difference (ITD) carry left from right:
Together the first two give back the ears, so a head can be built from its cues (figure 1):
Each ear’s arrival time τ is where its response best matches its own minimum-phase version Hmin (made as in (19)), and the time difference is the difference between the two:
A symmetric head is one ear mirrored: for azimuth φ and elevation ϑ, a head made from a measured right ear is
so every measured person gives two heads, one from each ear.
the data
The model is learned from two public databases, both under CC BY 4.0: HUTUBS, 96 people measured over the whole sphere, and 3D3A, 38 people. Mirrored, they give 192 and 76 symmetric heads. The KU100 comes from SADIE II, measured on 8802 directions. A third, larger database, SONICOM, is not learned from: its heads serve only to check the model on people it has never seen.
Databases differ in how they measure more than in whom they measure, so they are made comparable first:
- One grid. Every head is fitted with spherical harmonics up to order 20, with a penalty on roughness, so that a database without measurements below the listener fills that gap from the population’s average rather than from any one head. What is fitted is the head’s deviation from its database’s average x̄D, with Y the harmonics at the measured directions and R the diagonal of n(n+1):(7)
- One level. Every head is equalised onto the KU100’s transfer function, ear by ear. An ear’s common transfer function is its level G = 20 log10|H| averaged over the directions, each weighted by the share αd of the sphere it covers; it is taken out, and the KU100’s, averaged over its two ears, put in:(8)The databases’ average levels, up to 17.6 dB apart before, end 2.1 to 2.5 dB apart: less than heads differ within one database.
- One average. Each database’s mean is moved onto the mean of all of them, each database weighted equally, with the spread between its heads kept:(9)After that, a linear classifier names a head’s database only at chance. Two random halves of one database differ by under 1.1 dB, a third of the gap between databases, so what is removed is measurement, not people.
a head in parts
A symmetric head is stored as the parts of what the two ears hear:
- the timbre: the summed level of the two ears, averaged over every direction. It is the head’s colour, not a cue for where a sound is.
- the smooth pattern: how the summed level changes over the sphere, as spherical harmonics up to order 4 — the head and the torso.
- the notches: three dips the outer ear cuts into the high frequencies, each a centre, a depth, a width and a presence over the sphere. They carry most of what tells above from below.
- the level difference between the ears (order 10) and the time difference(order 8), which carry left from right.
Every part is a pattern over the sphere: an expansion in real spherical harmonics, normalised as SN3D and ordered as ACN, the convention ambisonics uses,
so that the summed level of a head is its timbre T, a smooth pattern of order 4, and its notches — figure 2 shows the three on a measured head —
and the two differences are patterns of their own:
A direction is evaluated rather than looked up, and no measured grid is shipped. Along frequency, the coefficients are sampled every tenth of an ERB.
nobody’s head
Every part but the notches is the population’s mean: nobody’s head, the average of the 268 heads, each database’s mean taken first and then the mean of those, for every part p:
It is no one’s, and closer to anyone’s than the dummy is (figure 4).
Its timbre is the KU100’s. The dummy’s is flat within 3.4 dB from 0.3 to 16 kHz; the population’s spans 12.9 dB, up at 4 kHz and down at 16 kHz — the ear’s own resonance, which every measured head carries and the dummy’s equalisation takes out. In the perceptual study this model starts from [1], an individualised head won on externalisation and lost on timbre; keeping the dummy’s timbre keeps the colour a mix is judged on, and personalises only the cues for direction (figure 3).
the ear slider
The notches are a template of three notch surfaces over the sphere — centre, depth, width and presence, each as spherical harmonics of order 6 — learned from half of the heads and scored on the other half. A larger ear cuts its notches lower, a smaller one higher, so the slider shifts all three centres together along frequency, by −2 to +2 ERB. A measured head’s own shift spreads by 0.58 ERB. Around the median plane the notches are valleys that climb in frequency as the source rises (figure 5).
A notch fades in with its presence, so nothing switches as a source moves; in front, the template plays its notches at about 7.0, 9.2 and 13.7 kHz. Each notch i is a peaking filter’s dip with depth ai, centre ci and width wi, all patterns over the sphere, moved by the slider’s Δ:
faded in with its presence πi by a smoothstep, so that a notch never switches on as a source moves:
A shifted centre stays within 4 to 18 kHz, a width within 0.1 to 1.5 ERB, and a depth above −60 dB. The factor γ plays the notches at 1.5 times the depth the heads measure: deep enough to be heard as height, without the darkening a deeper template brings. Figure 6 moves the ears.
The template is learned by alignment. Each head’s dips k, found on its measured summed level, are given to the template notch they lie nearest, and the head’s own shift is the median of how far they sit, a shallow dip counting for less:
With the shifts taken out, each notch’s centre and width are fitted to the dips given to it, its depth to those dips alone, and its presence to every direction; four turns of this settle the template. Figure 7 shows the notches found on one measured head. The template fits SONICOM’s heads, which it never saw, as well as its own held-out ones.
the head slider
A larger head puts the ears further apart. The head slider, from 0.75 to 1.3, scales the time difference between the ears, and the level difference below 1.5 kHz goes with it, as it does across the measured heads; above, it is left alone. A measured head’s own scale spreads by about 9 %.
Both are learned over the heads: a head’s scale sh is the least-squares fit of its time difference to the population’s, and the level difference’s change G a unit of scale the least-squares line through all of them, each database weighing the same, kept below 1.5 kHz and faded out by 3 kHz:
Each slider moves its own cues. At 60° to the left, the ears ±10 % move the level difference by 1.6 dB at most, while the head ±10 % moves the time difference by ±70 µs and the summed level by 0.05 dB at most. Figure 8 moves the head.
rendering a direction
To play a direction, the decoder evaluates every part there: the summed level from the timbre, the smooth pattern and the shifted notches (11); the two ears from it and the level difference(4); both made minimum-phase through the real cepstrum,
and the pair delayed by the time difference, less what the minimum-phase pair already carries. Rendering the KU100 through the same chain, at its own size, comes within 0.60 dB (median) of its measured magnitudes and 3 µs of its measured time difference, over 300 directions.
A slider move rebuilds the filters off the audio thread: 240 directions at 513 frequencies take 1.28 ms on one core. The model ships as one file of about 0.36 MB.
limits
- A head’s own smooth pattern, the detail of its level difference, and the paths its notches take over direction are not in the model: no slider reaches them.
- The time difference’s shape — how it rises from the front to the side, any asymmetry between front and back — is not personalised; the head slider only scales it.
- The sliders are found by ear. A page for doing that against a real loudspeaker is still to be built, and the model is still to be heard by a round of listeners.
- Earbuds in transparency mode change the very cues the sliders move, so personalising a head is done on open headphones.
references
- L. Häusler, Data-Driven HRTF Individualization: Towards Enhanced Elevation Perception Using Interactive User Optimization, master’s thesis, University of Music and Performing Arts Graz, 2024.
- F. Brinkmann et al., “A Cross-Evaluated Database of Measured and Simulated HRTFs Including 3D Head Meshes, Anthropometric Features, and Headphone Impulse Responses”, Journal of the Audio Engineering Society 67(9), 2019. doi
- R. Sridhar, J. G. Tylka and E. Choueiri, “A Database of Head-Related Transfer Functions and Morphological Measurements”, AES 143rd Convention, New York, 2017.
- C. Armstrong, L. Thresh, D. Murphy and G. Kearney, “A Perceptual Evaluation of Individual and Non-Individual HRTFs: A Case Study of the SADIE II Database”, Applied Sciences 8(11), 2018. doi
- S. A. Ausili et al., “Sound Localization with Hearables in Transparency Mode”, Audiology Research 15(3), 2025. doi
Everything the decoder builds on is credited on foundations.