6. Implementation Details

6.1 Basic Details

The code used for the production of all the demonstrations in this paper was written in C++. It was compiled using GNU G++ on Sun and Silicon Graphics machines. All input and output samples were at 16 bit and 44.1 kHz sample rate, or resampled to this rate.

6.2 Flow of The Program

Sound files were processed by a number of passes over the data, saving each step's output to a temporary file. A list of source files and positions to be mixed into the final output are entered into a script for the program to read. The program reads the information for each source sequentially and completes each one before going on the next. Sound files were processed by a number of passes over the data, saving each step's output to a temporary file. First the data was processed for phase delay and doppler shift using fixed position information or multiple-position information in a separate file. Then the same position information was used to apply the HRTF data via convolution on 128 data points at a time. Then the sound file was mixed into a common sound file with the other reverberations and signals processed so far in the script.

6.3 Phase and Doppler Shift

Phase was implemented assuming a speed of sound of 330 m/s. Distance was measured from the center of the head. Doppler shift was implemented through a careful implementation of phase. A file with a moving source was processed with an accompanying position file which contained azimuth, elevation, and distance measurements for each sample. For each sample of the input sound file, it's position in the output sound file was calculated. Since these shifted samples rarely fell exactly on output sample positions, linear interpolation was used to determine the output sample value. Where there were multiple or reflected sources, each source was compiled separately, with appropriate silence at the start of the file, then combined at the end

6.4 Reflections

Reflections were processed as separate sources, and not at the same time as the original or direct source. Thus, their positions were calculated outside the main program, by hand or by helper programs, especially for large position files. Then they were processed with an attenuation factor and the same source file as the direct source. Their position was determined by taking the mirror image of the auditory scene along the axis of the wall, and calculating the distance and direction of the mirror source to the non-mirror listener. This proved to work well for Blauert, although he calculated hundreds of reflections in his concert hall simulations. In most demonstrations, only the loudest reflections were calculated, but the system is capable of handling any number since it processes them sequentially.

6.5 Effectiveness

The implementations of doppler shift and the HRTFs seem to be very effective. Some basic directionality is definitely discernable in each case. The clarity of the signal, however, does not seem to be high. This may be adversly affecting the reverberation qualities of the samples, as depth is not readily apparent in the processed samples. Reverberation, upon a visual inspection of the waveforms, does seem to be working properly.


Paul Joseph Henley
Last modified: Thu Jun 10 10:36:54 CDT 1999