I want to use the RPI to process the incoming data from five crystal microphones in order to obtain the direction of arrival of sound so that i can steer a camera mounted on two servos to that direction.
Since there is no audio inputs to the RPI i think of using a two-channel analog to digital converter, one channel is connected to a refrence mic and the other channel is connected to the output of a 4-1 analog multiplexer connected to the other four mics.
Is it the right way to do my project? if not then how do i do it ? is there a recommended 2channel ADC and 4-1 analog mux compatible with the RPI?
What sort of accuracy are you looking for? What sort of budget do you have? Is this a "one off" design? Or, something that you want to reproduce? Commercialize?
Might I suggest, instead, using USB microphones? And, instead of requiring calibrated units, instead adopt a procedure whereby *you* calibrate them (perhaps in the same instrument).
Note that the calibration need not be as isolated, individual microphones. Rather, you could locate them in their intended positions. Then, position a sound source in a known location and *observe* the responses from each microphone. Move the sound source -- or, change the character of the source as different frequencies will react with the environment in different ways (e.g., multipath) -- and repeat.
I'm not sure USB microphones are a good recommendation. You seem to understand the need for synchronous sampling, which will be hard if not impossible to do with USB ADCs. So you are on the right track when you say you would use a 2 channel ADC.
So I would look for an ADC card for the rPi with at least two ADC inputs not multiplexed to one ADC. Then you will want some amount of amplification to match the output level of the mics to the input range of the ADC. Ideally this would be part of the daughter card for the rPi.
How do you plan to control the servos? I assume that will be another daughter card for the rPi. Can you stack cards on the rPi? You may need to find a servo card with a pair of ADC inputs. Are you happy with AC coupled inputs? I expect you won't need DC coupling to do the correlation you are talking about.
[much elided due to silly double-spacing of news client?]
Then you are hoping you can accurately measure the phase difference between the received signals at the two mics. What are you using to excite the system?
I was assuming you would look for difference in SPL between the mics and the referent. As such, you need to understand the gain/atten of each mic at frequency. Receiving a signal OF UNKNOWN CHARACTERISTICS (e.g., a *duck* quacking in the distance), you could measure the magnitude of the response from each mic. Then, look at the characteristics of the signal (i.e., record it) and, from that, determine what the incident magnitude of the signal at each microphone would have been (inverse transform of the calibration).
This removes the real-time aspects of the processing (beyond just capturing the "signals" from each microphone -- potentially skewed by an unknown amount through the data acquisition system.
If, OTOH, you can control the excitation signal and its waveform (and envelope), then you can sample each input (in any REPEATABLE fashion) and, having *observed* (through calibration) the relative phase difference through that REPEATABLE processing/sampling, can determine the actual phase/time difference between the incident signals.
Again, you haven't specified accuracy, excitation, cost, the acoustical characteristics of the environment (e.g., will you see reflections before primary signal incidence at ALL mics), etc.
On a sunny day (Thu, 14 Aug 2014 20:22:03 -0700 (PDT)) it happened email@example.com wrote in :
Yes, USB on raspi has severe throughput limitations (to the point of dropping keyboard characters on an USB keyboard). That rules out USB sound cards (I have tested that).
CRYSTAL mikes????? Now that is old age! Those have severe limitations (frequency spectrum related for example). You probably want electrets.
What is the maximum frequency? the OLD I2C PCF8591 has 4 channels and you could do the I2C a bit faster, IIRC (been 20 years or more) I tried that for low frequency sampling 8 bit audio... Else there are many real 'audio 16 bit chips'. But for DIRECTION you want phase information, and that could perhaps be simpler done with a simple analog phase comparator between the 2 mike signals?? I once worked on a chopper detector interceptor, but the frequencies were much lower, phase based, top secret of course, like everything else here, use electrets. Not seen a black heli since. :-) mm come to think of it, that one last night could have been black, but OK. And raspi has limited processing power.
How do you propose distinguishing the initial signal from any echoes? If it is a pulse signal (gunshot), you can use the first arrival as your timing point; but if it is extended beyond a few milliseconds (speech), you will have to do some very complex correlation calculations.
~ Adrian Tuddenham ~
(Remove the ".invalid"s and add ".co.uk" to reply)
s only two usb ports so i will have to use a usb hub and i have already bou ght the crystal mics.
e to do a synchronized sampling for a pair of mics (the refrence mic and a mic from the other four).
uess that the RPI would not tolerate that amount of processing (4 pairs of mics and controlling the servos)
im not planning to use any card to control the servos, i've seen a video of a similar project in which two servos were controlled using the raspberry pi alone and i dont THINK i need a card for that, im using micro servos so im not supposed to face any power problems.
i want to utilize my project in real time so it must be accurate, its excited by typical voice signals (300-3400Hz), im using the steered response power - phat transform (SRP-PHAT) algorithm so im not worried about reverberation.
ophones in order to obtain the direction of arrival of sound so that i can steer a camera mounted on two servos to that direction.
analog to digital converter, one channel is connected to a refrence mic and the other channel is connected to the output of a 4-1 analog multiplexer c onnected to the other four mics.
this is the design im thinking of:
1 refrence mic >----->pre-amp>---------------------> ADC >----> RPI >---> s ervos other mics >--------->pre-amp>---->analog MUX>----->ADC >-----> RPI >---->s ervos
and since im using the Steered Response Power - Phase Transform(SRP-PHAT) i only need to calculate the cross-correlation between each independent pair of mics, find the time difference of arrival and finally evaluate the dire ction of arrival.
am i missing any thing? do i have to do some beamforming techniques? e.g. d elay-and-sum, filter-and-sum, etc.