Sound Location with the Qwiic Sound Trigger and the u-blox ZED-F9x

Pages
Contributors: PaulZC
Favorited Favorite 3

Analyzing the TIM_TM2 Data

Our Python Examples will process the UBX files for you to calculate the location of the sound events!

For the simplest two-sound-trigger set-up:

  • Copy the TIM_TM2.ubx file from the SD card from the first system. Rename the file so you know which system it came from. You might want to call it TIM_TM2_1.ubx.
  • Do the same for the TIM_TM2.ubx file from the second system. Again, rename it so you know which system it came from.
  • Place both files in the same folder / directory as the Sound_Trigger_Analyzer_1D.py Python file

Run the Python code by calling:

language:python
python Sound_Trigger_Analyzer_1D.py TIM_TM2_1.ubx TIM_TM2_2.ubx 10.0 20.0
  • Replace TIM_TM2_1.ubx with the name of the file from the first system as necessary
  • Replace TIM_TM2_2.ubx with the name of the file from the second system as necessary
  • Replace the 10.0 with the distance between your two sound triggers in metres
  • The 20.0 is optional. It is the temperature in Celcius (Centigrade). Change this to your actual temperature for added accuracy

The Python code will open and analyze the two UBX files and extract the times of the sound events from the TIM_TM2 data. It will then look for pairs of events which are close enough together in time. For each pair it finds, it will calculate the distance of the sound from sensor 1. If you are testing this in a corridor, walking away from sensor 1 towards sensor 2, you will see the distance gradually increase with each footstep.

Next time, we take this to the next level with three systems doing 2D sound location! Stay tuned…