Hi, I made a patch to locate the position of a sound source between two microphones, which looks like this: [adc~] | | | [threshold~ 0.2 100] | | [threshold~ 0.2 100] | | [delay 10] | | [timer]
So a number of 10ms means that the source is exactly between the two microphones. This patch works kind of reliable and accurate. But I was wondering if there is a better possibility with higher resolution? At the moment I can distinguish the position with an accuracy of 1.333 ms, means I get about 12 different values out of my tube.
Has anyone an idea how I can get more precise readings? I thought about comparing the amplitudes of the two waves I get, but I have no idea how to do this or if this would be more exact.
Thanks for any help, Chris
I think the use of [threshold~] is limiting you to block resolution. Audio to do correlation will give you a theoretical resolution much better than one block, at half the sampling rate, 0.015m (one and a half centimeters) for 44kHz.(?) Assuming that the mics are identical, in phase etc.
[snapshot~] seems a better choice than [threshold~] because it gives you the instantaneous vaue of a sample. But I'm not quite sure how best to use it in this context.
It depends on the source, if its an impulse or if it's a periodic wave, for which correlation approach. I was reading this interesting one recently and wondered if anyone tried it
- Clip the two signals - i.e. amplify and saturate so the signals become a
series of 1s and 0s.
- XOR the result. You will use this result "X" in two ways:
- Integrate X to get Y
- Measure the variance of Y
When the variance of Y approaches zero, there is similarity. Y itself is a measure of time shift between the signals. This works for things like sinusoids. Fred
If it's for delocalisation/positioning of emitters where you get to decide what the sound is (and choose a nice ultrasonic sine wave) then it seems potentialy fast because it can be crudely sampled and carried out as logic.
On Sat, 23 Jun 2007 22:12:53 +0200 Chris chris@proquariat.de wrote:
Hi, I made a patch to locate the position of a sound source between two microphones, which looks like this: [adc~] | | | [threshold~ 0.2 100] | | [threshold~ 0.2 100] | | [delay 10] | | [timer]
So a number of 10ms means that the source is exactly between the two microphones. This patch works kind of reliable and accurate. But I was wondering if there is a better possibility with higher resolution? At the moment I can distinguish the position with an accuracy of 1.333 ms, means I get about 12 different values out of my tube.
Has anyone an idea how I can get more precise readings? I thought about comparing the amplitudes of the two waves I get, but I have no idea how to do this or if this would be more exact.
Thanks for any help, Chris
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
It depends on the source, if its an impulse or if it's a periodic wave, for which correlation approach. I was reading this interesting one recently and wondered if anyone tried it
Try using my sxcorr or sxcov patches from the previous thread about cross correlation, with pique~ to find the location of the peaks. It will give you sample accurate measurements.
You'll get better temporal accuracy using broadband signals, I think. Just play noise or frequency sweeps through the channel and correlate it with what you get back. I have tested this idea with blocksize of about 16384 (waaaay more than 10 ms) and it's not so cpu intensive. (but I only have a single microphone... your calculations must be more involved)
Good luck, Chuck
Another thought... When you have the two microphones, just correlate the noise between the two channels (not from the output/input1 and output/input2, but between input1/input2). When the speaker is equidistant from each microphone the delay is 0 (located at exactly half a block on the output from sxcov~.pd or sxcorr~.pd). Then, the distance from the center is simply proportional to the measured delay between the signals, divided by 2. e.g. at 44100 kHz, given c=343 m/sec distance from center=(delay in samples)/2/44100*343, meters
and the resolution is about 4 mm
noted difference: sxcorr~ accumulates it's values over time, so that you can get more accuracy, from using longer signals sxcov~ is instantaneous and not accumulated
Chuck