Sound Location with the Qwiic Sound Trigger and the u-blox ZED-F9x
Contributors:
PaulZC
Calculating the Location of a Sound
Now that we know how fast sound travels, we can talk about how we go about calculating the location of the sound.
Let’s say that we have two sound triggers, one at each end of a corridor, and we want to calculate where the sound of footsteps came from. If the sound triggers are 10 metres (10m) apart and the footstep came from 3m away from one, 7m away from the other, then:
- It takes 3 / 343.42 = 8.74x10-3 seconds (8.74 milliseconds) for the sound to reach the first sound trigger
- It takes 7 / 343.42 = 20.38x10-3 seconds (20.38 milliseconds) for the sound to reach the second sound trigger
But how do we calculate the location if all we have is the time each sound trigger hears the footstep? Like this:
- We have a ZED-F9P at each end and timestamp each trigger event very accurately
- The difference between the two timestamps will be 11.65ms (20.38ms - 8.74ms)
- We can use the time difference to calculate the location, because we know how far apart the sound triggers are
- In 11.65ms sound travels 343.42 * 0.01165 = 4.0m
- We can calculate the distance from the first sound trigger by subtracting 4.0m from 10.0m and then dividing by 2
- Our sound came from 3.0m away from the first sound trigger
If we want to calculate the location of a sound in two dimensions, X and Y, or East and North, then we need three sound triggers so we can triangulate the location. We will show you how to do that in the next tutorial!