Skip to content

HRTFs and Personalized Spatial Audio: A Deep Dive

By AR Compare Team ·

A head-related transfer function, or HRTF, is the acoustic fingerprint of your head and ears. Before a sound reaches your eardrum, it is delayed, shadowed and reshaped by your head, the folds of your outer ear and your upper body, in a way that depends on where the sound comes from. Your brain has learned your own HRTF and uses it to locate sounds. Spatial audio imitates that by filtering each sound through an HRTF for its intended direction. The catch is that every person’s HRTF is different, so a generic one can place sounds wrongly. Personalization, measuring or predicting your own HRTF, is how spatial audio gets more convincing.

This deep dive draws on Zandi and colleagues’ research on individualizing HRTFs, Ludovic Pirard’s thesis on HRTF personalization from ear images, Google’s Resonance Audio concepts, and Apple’s support page on Personalized Spatial Audio. For the basics, start with how spatial audio works. For listening glasses, see the best smart glasses for music.

The cues an HRTF carries

Google’s Resonance Audio guide sets out the 3 cues people use:

  • Timing difference between the ears, which locates low-pitched sounds left or right. The farther to the side, the bigger the delay.
  • Loudness difference, caused by the head’s acoustic shadow, which locates higher-pitched sounds left or right.
  • Spectral changes from the outer ear, which tell you height.

An HRTF bundles all 3. Zandi and colleagues describe it as a function of the direction of the sound, its angle around you and its height, and its frequency, with a separate HRTF for each ear.

The outer ear and elevation

The first 2 cues mostly tell left from right. Height is harder, and it depends on the outer ear, the pinna. Google’s guide explains that sound from different directions bounces off the inside of the outer ear in different ways, which changes its tone. Both sources agree that elevation is cued mainly by peaks and notches above about 5,000 hertz. Zandi and colleagues show that as a source moves toward the top of the head, the frequencies of those notches rise.

Ears are shaped very differently from person to person, which fits what researchers find below: height is where a borrowed HRTF fails most.

How an HRTF is applied

In practice, an HRTF for one direction is a pair of filters, one per ear. To place a sound, software takes a plain mono recording and runs it through the left-ear and right-ear filters for the chosen direction, a process called convolution. Zandi and colleagues built their listening tests exactly this way, generating test sounds at 24 positions by convolving a mono sound with HRTFs, once with a generic set and once with a personalized one. Played over headphones, the 2 filtered signals carry the timing, loudness and tonal cues of a real sound from that spot.

To handle many sounds and a moving listener at once, engines like Google’s Resonance Audio use ambisonics, which represents the whole sphere of sound around you. Google says the simulation gets more accurate as the ambisonic order rises.

What goes wrong with a generic HRTF

Pirard’s thesis lists the usual problems when listening through someone else’s HRTF:

  • Front-back confusion: a sound in front seems to come from behind, or the reverse.
  • No externalization: sound seems to sit inside your head rather than out in the room.
  • Localization errors, worst for elevation and smaller left to right.

Zandi and colleagues add that generic HRTFs also make playback less pleasant. They write that using another person’s HRTF or a generic one is the main source of errors in many spatial audio applications. That is the gap personalization tries to close, and the 5 routes below trade accuracy against effort in different ways.

Way 1: measure it

The gold standard is to measure. Pirard describes the setup: the listener sits in an anechoic chamber, a room with almost no echoes, with small microphones in the ear canals. Speakers play test sounds from many directions, and the microphones capture what reaches each eardrum. Zandi and colleagues note labs often mount speakers at different heights on an arc and rotate it to cover every direction.

The drawback is effort. Pirard notes it can take several hours per person and is not accessible to the public. Subjects often have to sit still for long periods, Zandi and colleagues add. Measured HRTFs are shared in research databases, and Pirard points to a standard file format, SOFA, used to store them. One widely used database, CIPIC, contains 45 subjects.

Way 2: use a dummy head

A middle route is a mannequin head with microphones in its ears. Pirard describes KEMAR, a dummy built to average body measurements. Its HRTF matches an average person, not you.

Way 3: simulate from a 3D scan

If you have a precise 3D model of someone’s head and ears, physics software can simulate how sound wraps around it. Pirard describes Mesh2HRTF, a tool that computes personal HRTFs from high-resolution 3D scans. The catch is that the result depends heavily on the scan’s quality, which is hard to get without special equipment, and the simulation is resource-intensive.

Way 4: predict from ear measurements or photos

A lighter approach estimates the HRTF from body measurements. Pirard’s thesis trains a neural network to place landmarks on photos of the ear. It learned from a public set of ear images marked with 55 landmarks, then used 12 of those points to compute 7 standard ear measurements from the HUTUBS database. Those measurements are used to pick or build a matching HRTF. No anechoic chamber is needed, just a picture.

Apple offers a consumer version. Its Personalized Spatial Audio uses an iPhone X or later to capture a representation of your ear and head shape, and syncs the resulting profile across your Apple devices.

Way 5: a few quick measurements plus a model

Zandi and colleagues tried a hybrid. Their measurement uses 2 small microphones in the ears while the user holds a phone at arm’s length and moves it around their body, playing sounds. It takes under 5 minutes. A generative neural network, trained on existing HRTF databases, is then adapted to those sparse measurements to predict a full personal HRTF.

They tested it on a public dataset and on 10 people of different ages and genders, including measurements taken in ordinary homes rather than a lab. They also found the predicted HRTFs had fewer errors for sounds in front of the listener than for sounds behind, where front-back confusion, one of the classic problems Pirard lists, tends to bite. Results:

  • A sound-localization model trained with the personalized HRTFs was about 15 degrees more accurate.
  • In listening tests, people correctly identified the left-right direction of sounds 183% more often with their personalized HRTF than with a generic one.

Source: Zandi and colleagues.

The 5 routes compared

RouteWhat you needPersonal to you?
Lab measurementAnechoic room, in-ear microphones, hours of sitting stillYes, the most exact
Dummy headNothing from youNo, an average head
3D scan and simulationA high-quality scan and heavy computingYes, if the scan is good
Ear photos or measurementsA few pictures or measurementsPartly, by matching shape
Quick measurements plus a modelIn-ear microphones and a phone, under 5 minutesYes, predicted from your data

Across these sources, the direction of travel is from the lab toward methods anyone can do at home, using models trained on lab data that already exists.

Why it matters beyond music

Zandi and colleagues point out that the same personal HRTFs help devices locate sounds, not just play them. Their prototypes included a system that works out where a sound comes from, which they suggest could alert a wearer to dangers around them. On glasses with microphones and speakers, that is a real use case: hearing where a sound came from, then being told about it.

Beyond the HRTF: rooms and head movement

Direction is only part of realism. Google’s Resonance Audio adds early reflections, which tell you the size and shape of a room, and late reverb, and it models objects blocking sound by cutting high frequencies more than low ones.

Head movement matters as much. Google explains that head-mounted devices track your head, and the software rotates the sound field the opposite way so sounds stay in place. Google also notes that moving our heads helps us perceive changes in where sounds are. Apple pairs spatial audio with head tracking on its AirPods.

What it means for glasses

Smart glasses play sound through open speakers in the arms or through bone conduction, not through sealed earbuds. Glasses with head tracking can still keep sounds pinned in space; see how IMU head tracking works.

When you compare glasses, 3 questions are worth asking:

  • Does spatial audio use head tracking, so sounds stay put when you turn?
  • Is any personalization offered, like Apple’s ear-shape profile, or only a generic HRTF?
  • Does it model rooms, with reflections and reverb, or only direction?

Then judge with your own ears. For the term itself, see the spatial audio glossary entry.

More buying guides: AI audio glasses and Bluetooth audio glasses.

Frequently asked questions

What is an HRTF?

A head-related transfer function: a description of how your head, outer ears and upper body change a sound from a given direction before it reaches each eardrum. Spatial audio applies it to make sounds seem to come from that direction.

Why does generic spatial audio sound wrong to some people?

Because HRTFs are personal. Research lists the usual symptoms of using someone else's: confusing front with back, sound that seems inside your head, and errors judging height.

How are HRTFs measured?

Traditionally with tiny microphones in your ears while speakers play sounds from many directions in an echo-free room. A thesis from the University of Mons notes this can take several hours per person.

Can a phone personalize spatial audio?

Yes. Apple's Personalized Spatial Audio uses an iPhone to capture your ear and head shape. Research methods also predict a personal HRTF from a few quick measurements or from photos of your ear.

Does personalization make a real difference?

In one 2022 study, people correctly identified the left-right direction of sounds 183% more often with a personalized HRTF than with a generic one.