Acoustic localization of sound source, using real-time correlation analysis with
From McGill University Physics Department Technical Services Wiki
This is SSID's webpage. Pronounced [sid] and stands for Sound Source Indication Device, although Mark wants him to become a Death ray when he grows up.
The idea behind this project is simple, build a stepper-motor driven device that will react as soon as you make a sound. The software behind it on the other hand, is making me pull out a rocket launcher and start shooting at random stuff. Besides from the fact that it eats up EVERY SINGLE minute of my time, it is also very uncooperative and likes to display surprises from time to time.
Using the properties of sound waves and a special sort of data correlation, the exact coordinates of a sound source could be found, relative to sid.
First stage:
[done] write a simulation software that will test the correlation method
[done] make it super customizable. note: input in command line: #samples, max Δt in samples, phase in samples, frequency (Hz), Sampling frequency (Hz)
Second stage:
[done] Build a testing platform. note: using only 2 mics
[done] Build 3 amplifiers, low noise, to bring mic level to around 1Volt from 50 milivolts. note: amplifiers can give around 20-30 gain, to about 1-2 volts out
[done] Test the amplifier, and see if there is improvement needed
[done] Fix and debug so that the data makes sense
[done] Test microphones at different circumstances
Third stage:
Write the solution finding software, with a maximum-of-a-curve finding software
Make a real-time upgrade to the software
Build a 3 microphone platform
Include the motor and angle of rotation
Final stage:
Watch sid live!
So after constructing the first version of sid, and testing the modified correlation program (to fit the mic data), we noticed something ... weird... well the Labmaster has some sort of inherited signal oscillating at 3.8KHz, and that it occurs ALWAYS AT THE SAME TIME, producing two IDENTICAL spikes in the data, EVERY TIME!! You can feel the frustration. So we spent around 3hrs trying to figure out if that was aliens contacting us or is it just us. With help from Mark, and two TAs, we concluded that it was a weird Labmaster property. So it was decided that we will amplify the signals form the mics so that their amplitude is a lot bigger than those oscillations, and thus they wouldn't appear EVERY FRIGGIN' TIME!
The building of the amplifiers was fun, pics on the side. Mark didn't have any LM386 so I built the whole thing at home, using my parts. It actually worked from the first time, so no frustration here. There might be some distortion associated with the amplifier, but we'll see how bad it is next week. One problem that may occur is that I put an indicator LED and a series resistor with the power rails, but the resistor is 1/8 Watt I think. It did not overheat with only 1 amplifier running, but I don't know when all three are running at the same time... If the amp draws more than 100 milliwatts, I'd have to change it.
So the resistor WILL overheat, and therefore it was replaced by three 1/4 Watt 330 ohm resistors in parallel, thus increasing greatly the power tolerance.
Also blocking caps were added at the inputs, and a load resistor at the output... since apparently LM386's don't like the high impedance of the ADC's. Spent 4 hrs trying to figure out what's wrong until it was discovered, mostly by Marc (Thank you), that the system is doomed, unless its fixed. The results that were obtained after fixing were PERFECT!
We had a bit of trouble with the maximum finding software, but after a couple of hours of pulling our hair, it works. Also apparently, the maximum sample array that is possible with our setup and our code is 32000 samples. I think that is due to how big the Double type is. It might be possible to increase that if the sum that gives numbers larger than that is divided and a rounding factor is introduced... too much work, and not really useful, since 32000 samples is orders of magnitude bigger than what we actually need.
Progress! I made the program for finding the phase difference a pseudo-real-time program. The phase is seen how it evolves with time, and a graph with intensity is plotted... now we need to figure out how to get rid of random noise, that just messes up everything, then figure out how to implement the rotation of the motor concept.
