<< Chapter < Page | Chapter >> Page > |
In order to test the accuracy of our calculated HRTFs, we used 5.1 surround sound test files used to calibrate home theater systems. We first had to downsample these files from their original sampling rate of 48000 Hz to our sampling rate of 41000 Hz. Since the files were all meant to be played at the same time, each file only played sound part of the time. Therefore, we had to cut out the unused parts of each file and create new sound files which included only the testing segment of each directional file. After this process was complete, we were left with five signals, each of which specified which direction the sound was supposed to come from.
We then simulated these signals coming from particular directions using the equation from the HRTF calculation:
In this case 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 . This left us with the following equation:
By applying this equation to each calculated 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.
Notification Switch
Would you like to follow the 'The science of surround sound' conversation and receive update notifications?