Distance calculations using a sound source and microphones
Hi guys, I'm wondering if anyone can help me, i have a patch which efectivly measures the length of time it takes for a signal to leave a load speaker and travel to a microphone using a timer, and I'm effectively managing to get values for this via a timer object. The whole process is carried out twice with two binaural microphones piking up a signal each from two different monitors. However i was wondering if there is a way to take these value which update roughly 4 times a second and use them to give a distance with some kind of visual i.e. a scale which slides from left to right depending on the distance of the microphones from the sound source. Im not sure if this is even possible in max but thanks in advance for any help!
Hi Callan,
If you're looking to just calculate the distance between your speaker and microphone, you could use the speed of sound formula:
time in seconds * 340 == distance in meters
hopefully this helps.
If you don't mind me asking, what are you using to measure the time? I'm working on a similar project with measuring the very short delay of arrival between two microphones and haven't been able to find something reliable to measure these .3-15ms delays.
Gen is good for timing things at sample rate - You should be able to time very very short durations (dependant on sample rate) using some variation of this:
To be precise, remember that the speed of sound dépends on temperature, altitude.
You could thus include in your system a calibration engine, measuring the actual speed of sound, with microphone & source at a known distance. Then your distance measuring tool will be more accurate.
not to forget the color of the walls in the recording room, which can influence the speed of light for several 100%s.
I don't know about the color of the walls, but both our perception of the sky's color and the speed of sound depend on the composition/density/temperature of the air.
More in line with your remark, we could build the following Max patch:
- send a burst of noise towards the studio wall
- record the reflected noise
- using timing, you get the distance of your apparatus to the wall
- with spectral analysis, you deduce automatically the material - and color! - of the wall