Hi all. First let me say that I am very new to the arduino and have been told that it has a rather steep learning curve. Furthermore, I have a fair amount of programming experience (C and C++), however my skills in electrical engineering are bit rusty
Anyway, to my question: I am doing a project for school that requires me to simultaneously read in 4 audio lines. I planned on using 4 electret condensers(standard mics) and simply plugging them into the analog inputs. However, after doing a bit of research on using microphones with the arduino (which seems to be lacking in any substantial amount of material), i read that using a mic through analog input could only distinguish between varying intensities of the detected sound. Is this so? Will I not be able to get accurate enough sample data to record a waveform? If so, is there any alternative method of accurately recording sound with the arduino?
Welcome to the Arduino forum. I don't think you will find the learning curve too long as you have the language experiance and the hardware is a learn as you use it kind of situation. As far as your application there are two areas to consider.
The amplitude of microphones is just millivolts and will need amplification via op-amp to get any useful resolution. The Arduino A/D are 10bit 0-5vdc inputs.
Sample speed. One has to sample at better then twice the highest desired bandwidth frequency to be able to reconstruct the signal. If however you just want to destingious between sound and no sound then sample rate may be less. And if you are wanting to sample all four channels then that is X4 for a single channel.
Perhaps if you explain better the application we can steer you better. It could be that the Arduino will not have the speed if 4 channels of audio need to be sampled at hi-fi bandwidths.
Essentially, I am attempting to triangulate the location of a sound by analyzing the frequency and intensity of that sound using four different microphones positioned in four different places. My first step is simply to look at the intensity of the sound. In the future, however, I foresee having to analyze frequency (likely via an FFT). Luckily, the frequency of this sound will likely be relatively low (<800Hz range).
In the meantime, Ill look into what you have suggested.
Yes, that was also a concern of mine, however, I was under the impression that it would be possible to stream the data directly to system memory one value at a time as opposed to populating an array and then obtaining the waveform
Sorry, "stream" probably wasnt the best terminology. Ultimately, I planned on simply using the 1k as a buffer. The actual data would be recorded and processed on my desktop system as opposed to doing everything on the arduino itself. This shouldnt be terribly memory intensive. Hopefully that is a better description?
That makes sense :-), just remember that Arduino uses some of the 1K for internal structures, and all your variables are also allocated from the same 1K, so you probably won't have more than around 700 bytes available.
What exactly will Arduinos role be ? capture data from 4 mics. and send it to the PC ?
wouldn't be easier to do this with a multichannel audio card?
It's quite computational and bandwidth heavy.
Not only the serial port is terribly slow, but maybe you introduce too much delays between the channels, and it would make it difficult to increase the accuracy of your project.
"wouldn't be easier to do this with a multichannel audio card?"
The main problem with this is budget: Im currently not willing to spend that much... Also, I have a feeling there would be a lot of pain involved in receiving data from a commercial audio card.