We then simulated these signals coming from particular directions using the equation from the HRTF calculation:
H
Channel
(
ω
)
⋅
IN
(
ω
)
⋅
H
Directional
(
ω
)
=
OUT
(
ω
)
H
Channel
(
ω
)
⋅
IN
(
ω
)
⋅
H
Directional
(
ω
)
=
OUT
(
ω
)
size 12{H_ ital "Channel" \( ω \) cdot ital "IN" \( ω \) cdot H_ ital "Directional" \( ω \) = ital "OUT" \( ω \) } {}
(1)In this case
HChannelHChannel size 12{H_ ital "Channel"} {}is the earbud to ear channel transfer function. Unfortunately, we weren’t able to characterize this channel with our available resources, so in this instance we assumed that
HChannel=1HChannel=1 size 12{H_ ital "Channel"=1} {}. This left us with the following equation:
IN
(
ω
)
⋅
H
Directional
(
ω
)
=
OUT
(
ω
)
IN
(
ω
)
⋅
H
Directional
(
ω
)
=
OUT
(
ω
)
size 12{ ital "IN" \( ω \) cdot H_ ital "Directional" \( ω \) = ital "OUT" \( ω \) } {}
(2)By applying this equation to each calculated
HDirectional(ω)HDirectional(ω) size 12{H_ ital "Directional" \( ω \) } {}for both ears we were able to generate a series of synthesized sound files for each ear which when played in stereo would mimic a cound coming from a particular direction by using the following code:
L_OUT=[SYNTH_FL_L, SYNTH_FC_L, SYNTH_FR_L, SYNTH_RR_L, SYNTH_RL_L];
L_OUT=L_OUT';
R_OUT=[SYNTH_FL_R, SYNTH_FC_R, SYNTH_FR_R, SYNTH_RR_R, SYNTH_RL_R];
R_OUT=R_OUT';
FINAL_OUT=[L_OUT, R_OUT];
sound(FINAL_OUT, Fs);
In this code, the SYNTH terms are the vectors corresponding to the filtered test signals for front-left, front-center, front-right, rear-right, and rear-left directions. With the left and right ear outputs arranged as shown in FINAL_OUT, the sound command plays the first set of terms to the left speaker/headphone and the second set of terms to the right speaker/headphone as we desired.