-1

I am working on a project that's supposed to "track down" the destination of Sounds.

For that i have 2 microphone arrays placed next to each other to later construct an triangle and find its position, but that's getting out of scope.

At the moment i have 2 dicts with all the microphones and how many decibel they heard.

microphoneRadians = {
    "a": 0,
    "b": pi / 4,
    "c": pi / 2,
    "d": 3 * pi / 4,
    "e": pi,
    "f": 5 * pi / 4,
    "g": 3 * pi / 2,
    "h": 7 * pi / 4
}

horizontalArrays = {
    "A": {"a": 70, "b": 90, "c": 90, "d": 65, "e": 50, "f": 40, "g": 40, "h": 40},
    "B": {"a": 40, "b": 50, "c": 70, "d": 100, "e": 70, "f": 50, "g": 40, "h": 40},
}

As you might have noticed this is just example data since the microphones haven't arrived yet.

In this image i have already constructed an Triangle but to do this in my program later i need to find the direction of where an sound came from (from array A and B).

Triangle

Basically i am looking for an function that i can pass in such an microphone arrays dict and it returns me the radiant of where it came from.
Also here is a quick problem i ran into:
You cant just use the max() function to find where it was the loudest and then just resolve the microphone name / letter to the Radiant because it will be imprecise.

For example Array A, where b and c are the highest (90), If they both heard 90db it would be in the middle of them so π/3.

And also in the real world, if a=80db and b=95db π/4 (radiant of microphone b is π/4) wont be the correct answer).

Thanks for any help even tough this is a very complicated question (at least for me), And since i am planning to expand this project and with that also expand my expertise, please tell me the way you found the solution.

starball
  • 20,030
  • 7
  • 43
  • 238

1 Answers1

0

I'd recommend to wait for the microphones to arrive and test the whole thing out.

If the microphone arrays are rather small, I'd expect all the microphones to demonstrate very similar volume values, with the difference between the min and max value being very close to noise level, and thus the arrays won't provide much directional data.

Chances are that the project would be more successful if it were measuring the time shift between the signal captured by different microphones, rather than the volume. So, the microphone that was the first to receive the signal would give an indication to the direction. Again, however, the arrays need to be pretty large in order for the microphone signal to have substantial difference.

Thinking about this further - does this project even need microphone arrays? Humans and other animals can capture the direction to the source of the signal using two "microphones" only - the ears. Maybe having just two microphones with substantial distance between them, and doing triangulation could be of help? https://en.m.wikipedia.org/wiki/Triangulation

The way I'd start approaching this problem would be to build a sound recording setup, and then start emitting sounds at it from various known points, then record the signals, compare and try to reconstruct the known location from the recordings.

Ilya Nekhay
  • 101
  • 4
  • Yea i do have a script done to "construct" an triangle find source, but when i upgraded it to having example data of the Arrays and not just already having the angles of A and B, i ran into this problem. Also, an human ear is not enough to find the coordinates which is what i am trying to achieve. With 2 microphones you can basically only hear left or right (humans can do more because an ear is not comparable with an microphone), An gunfire locator also works with an microphone array by the way https://en.wikipedia.org/wiki/Gunfire_locator. – MatrixBytes Jan 02 '23 at 01:33
  • And i am not too sure about the time shift part, but i do know sound travels at 343 m per second but i am not sure how much sound decreases over cm or m. – MatrixBytes Jan 02 '23 at 01:47
  • Well, so the Gunfire locator page you linked links to this other page, explaining that the classical method for locating the source of sound is called Time Difference of Arrival (TDOA), requires 2+ microphones. See here, under "Methods", formulas provided: https://en.m.wikipedia.org/wiki/Acoustic_location – Ilya Nekhay Jan 02 '23 at 03:51
  • Yeah your right, must be an better approach. Thanks alot! – MatrixBytes Jan 02 '23 at 14:19