Forums > MaxMSP

audio tracking

January 10, 2008 | 2:47 pm

hi,
i


January 10, 2008 | 8:15 pm

Quote: bungalowbill wrote on Thu, 10 January 2008 06:47
—————————————————-
> hi,
> i


January 10, 2008 | 10:17 pm


January 16, 2008 | 12:53 pm

thanks for your ideas,

i thought about using contact-microphones (attached directly to the floor) and use the step "noises" (excuse my english).

so, i


January 16, 2008 | 8:14 pm

Contact mics seem like a good idea. You’ll still have to work out onset detection, but it might work.

Let’s assume for a moment, you’ve got perfect onset detection, the next thing you need is the time difference between the same event in different mics. Let’s imagine just two mics for now. Let’s put them 10 meters apart. The time difference will range from zero ms (when something is exactly between the mics) to about 29.4 ms (with sound moving at 340 m/s) when something is right on one mic. By the way, that’s the speed of sound in air; I don’t know the speed of sound through floor. You could calibrate your system experimentally, though.

Whatever the actual values, the time difference tells you how much closer the sound is to one mic. If the time difference is 50% of the maximum time difference, than the object is 50% of the way from the middle point to the mic where the sound arrived first. (In the example, 2.5 meters from one mic and 7.5 meters from the other mic, assuming the person stays on a line between them.) By adding a third mic, you could position a sound inside a triangle by comparing pairs of mics as above.

Am I making any sense? Accuracy will be important in this project. Below is a quick patch to compare the time difference between two clicks.

mz

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P comment 243 81 100 196617 delay in ms;
#P flonum 248 96 52 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 248 134 64 196617 mstosamps~;
#P comment 360 521 100 196617 samples;
#P flonum 197 497 144 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 346 497 144 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 285 462 66 196617 mstosamps~;
#P newex 283 432 47 196617 * 1000.;
#P newex 211 184 94 196617 delay~ 44100 512;
#P user number~ 94 382 294 397 9 3 3 2 0. 0. 0 0. 250 0. 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 94 309 30 196617 -~ 0;
#P newex 94 252 31 196617 sah~;
#P user ezdac~ 433 97 477 130 0;
#P newex 27 198 58 196617 phasor~ 1.;
#P newex 190 250 31 196617 sah~;
#P button 117 30 15 0;
#P newex 115 83 37 196617 click~;
#P comment 201 525 100 196617 miliseconds;
#P comment 136 31 100 196617 < --- click;
#P connect 8 0 9 0;
#P connect 11 0 14 0;
#P connect 11 0 12 0;
#P connect 2 0 7 1;
#P connect 2 0 10 0;
#P connect 10 0 4 1;
#P connect 16 1 10 1;
#P connect 17 0 16 0;
#P fasten 5 0 7 0 32 227 99 227;
#P connect 7 0 8 0;
#P connect 3 0 2 0;
#P connect 4 0 8 1;
#P fasten 5 0 4 0 32 227 195 227;
#P connect 9 1 11 0;
#P connect 12 1 13 0;
#P window clipboard copycount 19;


January 16, 2008 | 9:25 pm

bungalowbill schrieb:
> i thought about using contact-microphones (attached directly to the
> floor) and use the step "noises" (excuse my english).

The sound travels probably faster through the floor than through the
air, you need to measure the times separately.
It will be tricky, but worth to try, I’d take more than three mics, the
difference in the arrival time will be a few milliseconds. You might
need to take a higher sampling rate to get it more precise…

And what if there are several people walking???

Stefan


Stefan Tiedje————x——-
–_____———–|————–
–(_|_ —-|—–|—–()——-
– _|_)—-|—–()————–
———-()——–www.ccmix.com


January 18, 2008 | 4:21 pm

hi mzed, hi stefan,

thanks for your ideas.

mzed: thanks for posting the patch, i copy & pasted it into a text editor & tried to open the file with max, but that doesn


January 18, 2008 | 4:32 pm

sorry, it seems that i can


July 22, 2009 | 3:02 pm

Hi bungalowbill,

I’m working on the same type of position tracking.
However I’m trying to use the microphone output amplitudes to do the math.

I was wondering if you got your patch stable and working at all?

regards,
Woody


July 22, 2009 | 4:35 pm

the basic concept seems a simple thing to me, you just measure the
time difference between the "attacks", the resrt is a bit of math.

1.
something like tj´s analyzer~ (or some custom code like that)
could be used to find attacks.

2.
the attacks will be converted to bangs.

3.
on the data layer you can now easily check for the delay between
the mics.

4.
convert those milliseconds to centimeters

5.
use simple geometric calculations to find position of sound
source in room.(of curse you need to know where the mics are)

the practice, well.

stepdance shoes might help.

-110


July 24, 2009 | 10:27 pm

you can easily make good onset detection doing the following (sorry don’t have max here):

- mic put your mic signal in an average~ 44100
- send commands "441" and "rms" to the average~
- connect out to snapshot~ 1
- connect to atodb
- connect to a bucket
- subtract atodb output from bucket output

now you have the rise and fall time of the sound, it indeed travels much faster through a floor than through air (+- 1000m/s vs 343 m/s) but is also much louder through the floor to te contac mic, so I think it should work.

you could use > some threshold in dB/s with a select 1 to generate trigger events

if you get retriggers, just change the "441" to some higher number and/or make the threshold higher

good luck

Kessito


July 25, 2009 | 10:49 am

Here you go


Viewing 12 posts - 1 through 12 (of 12 total)