The best way is to feed each microphone into a different analogue input via the appropriate coupling circuits and amplifiers of course.
However loudness is not always related to peak voltage so one way would be to integrate the signal.
As to direction, you might get some indication from the arrival times of the different microphones but this only works with impulse noises ( think bang ) and requires a faster A/D than you have built in to the arduino. However it is not very good.
if i were to set up an array of mics forming a half circle would i be able to tell direction by which mic gets the strongest signal? or would the difference be to small to measure?
That's a surprisingly difficult thing to do, unless the sound from different sources comes in distinct, discreet "lumps", like Mike described.
Otherwise you have to correlate to identify the different sources, and the Arduino doesn't have the processing horsepower.
natecus:
could i just have the arduino collect the data from the mics and send it all back to a computer and have the computer do the calculating?
As well as it being a lot of data you would also have to break it up into packets and time stamp it. Then get it over, do the analysis and radio back the response. It is not going to be very real time.
In a previous life (or maybe it just seems that way) I did some R/D work using small directional/noise canceling mic’s to help cancel out distant audio while picking up near sources. Basically the mic has equal openings in front and back (the back normally has two small holes to accommodate the need for the electrical connections). The theory is that the more distant, or off access, the sound, the more likely it is that the audio will enter both sides of the mic at the same time and cancel out, while nearby, or on axis, sounds tend to enter one end sooner than the other and therefore does not cancel out. I would also agree with AWOL that a “cross”, or just dual, configuration would probably be more effective (greater delta between sensors, like human ears) than using more sensors, especially if each sensor was acoustically isolated from the others (think sound absorbing foam). Some things that could make things easier would be if the sound was in a short duration pulse source (as previously mentioned) i.e. a clap. Also, higher frequencies might make direction detection easier (long waves like sound can be difficult to work with over short distances) so an ultrasonic source could make things much easier (not to mention undetectable by people).
This sounds like an interesting project. I hope this is helpful and that you post your experiences.
well the more i post here the harder this project seems. is there any way for me to do this or should i just come up with another project to start? if there is a way please help me with the circuit, i am an alright programmer and can probably figure that out but im really just starting with circuits and could use some help
It sounds to me like it might be a fun project, but that the likelihood for it to not achieve the results you desire are high (sometimes referred to as “Failure”, but I like to call these learning experiences), so maybe not a good project for someone just starting out unless you are highly tolerant to “learning experiences”. I would suggest doing something simpler to start, but would love to see what is possible with this.
i am ok to have problems and start over many times, i just would like to get a good starting point before i just dive into it and find out it is not possible with the arduino.
amatbrewer:
It sounds to me like it might be a fun project, but that the likelihood for it to not achieve the results you desire are high (sometimes referred to as “Failure”, but I like to call these learning experiences), so maybe not a good project for someone just starting out unless you are highly tolerant to “learning experiences”. I would suggest doing something simpler to start, but would love to see what is possible with this.
I agree. Your first couple of projects should be based on projects others have 'proven' to be successful. I found designing and building a 5x5x5 led cube to be a perfect one for me to try and build on learning to program as I already had a hardware background. So I approached that project from a published one with the idea to use their hardware design as is but to write the sketch from scratch without even looking at their software. So build according to the skills you wish to acquire and build upon.
that is way cool, i would like to make something like that eventually but it would have to respond to just one loud bang instead of to continuous music
it would have to respond to just one loud bang instead of to continuous music
Well, project is merely a concept: measure phase -> calculate time difference -> calculate direction of the source. Localization of the loud bang differs only in last step, filtering / calculation direction.
For short impulses, less data available , the same time there is no need for "quasi real time" speed, so more math could be implemented to process received data pool, and consequently get even better accuracy. All depends, on how fast someone needs a result and what computational power is available.