pyroomacoustics icon indicating copy to clipboard operation
pyroomacoustics copied to clipboard

find distance between two micro-array and sound source

Open kehinde-elelu opened this issue 2 years ago • 3 comments

I will like to ask how to find the distance between two micro and source source

kehinde-elelu avatar Nov 26 '21 06:11 kehinde-elelu

@ELELUABDULSALAM , do you mean you want to estimate the location of a source given acoustic measurements by a few microphones ? If yes, pyroomacoustics does not include such algorithms. Instead, you may checkout pylocus. Among other things there is an implementation of the SRLS algorithm found in the paper Exact and Approximate Solutions of Source Localization Problems that does what you want.

Note that using only two microphones may not give you very good results. You will likely need more measurements to accurately locate a source in practice.

fakufaku avatar Nov 29 '21 05:11 fakufaku

@fakufaku, I noticed for the SRLS algorithm, one of the required parameters in the SRLS method is w, the weights for the measurements (Nx1). I am a little unclear on using the 'w' parameter that I would like your help. Let me provide an example:

Say, we are in 3-d coordinate system (x, y, z) and I have a sound source at (3, 3, 3). I have 5 microphones close to the the origin—(0, 0, 0), (1, 0, 0), (-1, 0, 0), (0, 1, 0), (0, -1, 0).

Using combinations of the 5 microphones, I run one of the DOA methods from pyroomacoustics library and generate a list of candidate locations: [[2, 1, 0], [3, 4, 2], [-2, 3, 2], [3, 2, 3], [-1, 4, 3]].

Now comes my questions:

  1. By weights, I am assuming that means I am assigning a value to each of my candidate locations—on a scale from 0,1—which can be interpreted as how likely that candidate location is as the true sound source location. Is that a fair assumption to make?
  2. If I did not know the true location of my sound source, how would I be able to assign a weight to each of the candidate locations?

akhilvasvani avatar Nov 30 '21 21:11 akhilvasvani

Hi @akhilvasvani , the weight allows to give more weights to some sensors than others. For example, we may know that some sensors are more reliable, or less noisy than others.

Now, I am not really sure of what you are describing above. There is one source and five microphones. You say you use some DOA algorithms in pyroomacoustics, which will give you some direction only. Queston: How do you obtain the candidate locations in 3D from the DOA measurements ?

Then, there seems to be a misunderstanding of how SRLS works. SRLS does multi-lateration. The inputs are the locations of the sensors (anchors, a 5 x 3 numpy array with one sensor location in each row, in your case). The weights can be all ones if you don't have prior information. Finally, r2 is 5 x 1 numpy array that contains the estimated distance from the corresponding anchor to the source. The output of the algorithm will be the estimated location of the source.

In your case, I don't think that you have distance estimates to the source. Actually, without distance estimates, you may need to use a time-difference of arrival (TDOA) technique. I don't think pylocus implements those.

fakufaku avatar Dec 01 '21 06:12 fakufaku