Main Page Explanation & FAQ Code Details Conclusions

Details on our MATLAB Implementation:
The first level in any system is the hardware level. In our case, we found that it would be difficult(by which we mean expensive) to build the physical microphone and A/D converter system. Interface cards capable of sampling the desired number of inputs simultaneously are not common, and furthermore, our preferred processing system, matlab, doesn't support real-time inputs.

We decided to write code capable of real-time processing, and then simulate the microphone data stream by reading sequential blocks of input from pre-recorded wavefiles. Our driver code is basically for a system that records for a while, then stops, processes, and displays the output. However, all of the other code processes one block at a time, and is thus independant of how those blocks are inputted. This relieved us of matlab's limitations, but allowed us to write code as if we were implementing a real-time system. The wavefiles that we used as our testfiles were generated using Creative Labs Wave Editor. Each track of the stereo wavefile simulates the data from one microphone. When we implemented code for more than 2 microphoness, we simply used multiple wavefiles.

2-Microphone Simulation

Our driver code for simulating a system of 2 microphones, gowave2.m , reads data from the wavefile in 1024 word blocks. The driver then calls fshift.m to find the shift between the 2 signals. It sends this delay as a parameter to twomicplot.m. Twomicplot.m contains all of the "physics" and "geometry" logic, and displays the possible signal positions for the given delay. The driver is written so as to plot the results from each of the blocks on the same graph.

4-Microphone Simulation

We were not satisfied with simple azimuth detection though, so we decided to write the code for a system of 4 microphones that was capapable of ranging. The driver code, gowave4.m, reads inputs from 2 wavefiles, and breaks them up into 1024 word blocks. Fshift.m is used to find the 3 delays, which are then sent to quadmath.m. Our function quadmath() contains all logic code necessary to approximate the polar coordinates of the signal source, and returns these coordinates to the driver. For speed reasons, the driver buffers 5 points, and then displays them on a polar plot. All points for the selected file are displayed on the same plot.

Code and Test Files:

endfire.m
fshift.m
gowave2.m
gowave4.m
initpolar.m
quadmath.m
twomicplot.m
5th0.wav
5thld184rd50.wav
5thld69.wav
5thrd129.wav
5thrd50.wav

To test, download the code and test files above, then use the following MATLAB commands:

gowave2('5th0.wav',1)

gowave2('5thrd50.wav',1)

gowave2('5thld69.wav',1)

gowave2('5thrd129.wav',1)

gowave4('5th0.wav','5thld184rd50.wav',1)


Main Page Explanation & FAQ Code Details Conclusions