# Binaural
# 1 HRTF
Head-related transfer function.
Describes how sound reaches each ear separately.
# 2 HRIR
Head-related impulse response.
Pairs of impulse responses, one for each ear, from a sound source in space.
# 2.1 MIT KEMAR
https://sound.media.mit.edu/resources/KEMAR/
Overall 710 orientations at 1.4m distance from dummy head.
Processed to 128 sample length at 44100Hz sample rate, see compact.tar.Z
.
Raw headerless sample data is stereo interleaved s16be.
Only one side of the data is present, for the rest you have to swap channels.
# 3 Ambisonic Decoder
See ambisonics.
ADT can generate decoders for arbitrary speaker layouts:
https://bitbucket.org/ambidecodertoolbox/adt
I made a speaker layout corresponding to the KEMAR positions and generated 1-band decoder matrices for Ambisonic orders 1 through 5. Then I generated binaural impulse responses for each Ambisonic channel, by decoding an impulse from each. This works by linearity.
# 3.1 Decoder Data
Data format is interleaved f32le, as C code:
#define ORDER 3
#define INCHANNELS ((ORDER + 1) * (ORDER + 1))
#define IRSAMPLES 128
#define OUTCHANNELS 2
float decoder[IRSAMPLES][INCHANNELS][OUTCHANNELS];
Convolve with Ambisonic input and sum to get binaural output.