pyroomacoustics icon indicating copy to clipboard operation
pyroomacoustics copied to clipboard

Can't reproduce simulation results with real world data

Open PascalPolygon opened this issue 3 years ago • 3 comments

Hello,

I am using pyroomacoustics to estimate the direction of arrival of a signal using a 3 mic array. The mics start recording within a short interval of each other and I synchronize the waveforms at the end of the recording. I setup the 3 mic array in pyroomacoustics and placed the source at the same location as in the physical setup. I used an app on an android device to measure the reverberation time in the room and used inverse sabine provided by pra to get absorption and max order. I also estimate the SNR using a statistical method. Despite having a terrible SNR, SRP and MUSIC perform reasonably well in the simulation, but when I run it on audio from my actual recordings it does not work. Sim results:

simulation_doa

Real world results:

real_doa

All the code is in this notebook: https://github.com/PascalPolygon/pyroomacoustics_IRL/blob/master/ice_lab_doa_sim_v_real.ipynb

Note: I'm only interested in the azimuth angle.

Any suggestions?

Thank you!

PascalPolygon avatar Jun 14 '21 21:06 PascalPolygon

Hi @PascalPolygon , do I understand correctly that your are using unsynchronized microphones (i.e., they do not share the same clock for their A/D converter) ? In that case it is not straightforward to apply DOA estimation. In addition to having no common time origin, the sampling frequency of the different devices may be subtly different. Doing DOA estimation with unsynchronized devices is a lot more challenging.

fakufaku avatar Jun 17 '21 01:06 fakufaku

Hello @fakufaku

Thanks for the response. I use the mics on 3 Android devices (3 mics), I save the system time on each phone at the start of recording, and knowing the offset between their clocks I calculate the latency at the start-of-recording between the phones. I use these relative latencies to shift the signals. This is my method for synchronizing the waveforms. However, I have no fix for subtle variations in the sampling rate. Do you have any thoughts on this approach?

PascalPolygon avatar Jun 17 '21 16:06 PascalPolygon

@PascalPolygon

I see, this is an interesting, yet challenging setup 😄 I am not convinced that the clocks of the phone may be sufficiently precise for the task at hand. Have you tried assessing what the synchronization error is ? You could do that by playing pulses from a know location (or a sine sweep) and check if the clock offset given by the phone internal clock matches the expected time delays due to propagation. Also, the two closest microphones are 70 cm apart, if we assume the speed of sound is 343 m/s, the longest propagation delay is 0.7 / 343 = 2 ms. So if the clocks can't give you millisecond accurate synchronization, you won't be able to do DOA. For good DOA estimation you will likely need to get sub-ms synchronization though. You could also evaluate how the synchronization error will affect the the DOA. I think in your case synchronization is most likely the dominant source of error (compared to sampling fequency mismatch), nevertheless if you are interested in sampling frequency offset evaluation, you could check this.

fakufaku avatar Jun 18 '21 02:06 fakufaku