I have created a fairly simple TDOA system that uses ultrasonic signals emitted from two speakers to geolocate (relative to the speakers) mobile phones. The two signals are separated by frequency.
The system has the following constraints:
- The signals must be inaudible. To that end we stick to frequencies above 17 kHz. A few people can still hear that, but most can't.
- Sample rate is 44.1 kHz.
- Music will typically be playing, so there is lots of interference at the lower frequencies.
- We don't have control over how well the speakers and microphones work at the upper frequencies, so we've kept our upper limit at around 20 kHz.
The particular signal that I am using is BPSK modulated 13-bit Barker codes because of their good autocorrelation properties. The autocorrelation looks like the following-
When I cross-correlate the expected signal against the received signal in real life, though, what I get typically looks like this-
The blue is the cross correlation with the speaker 1 signal, and the red is the cross-correlation with the speaker 2 signal. It appears that the echoes are significant and, unfortunately, often stronger than the direct path signal due to the directional gain of the microphone.
I tried simply detecting the earliest appearance of the signal as that is likely to be the direct path. This approach is very sensitive to the threshold that I use for deciding when the signal is present and so is not robust at all.
I would like a robust approach for determining the "true" arrival time of the signal- i.e. the arrival time of the direct path signal. Perhaps some form of channel estimation and deconvolution? If so, how would that work?
Data/Code: I want to make it clear that I am not expecting anyone to analyze the data or inspect my code. I have made them available in case you want to do so. I am mostly interested in ideas.
I made the raw received signal and modulated expected signals available for download. They are all sampled at 44.1 kHz. Correlating the received signal with the expected signals will produce something similar but not identical to the picture above because I move the received signals to baseband and decimate before correlating with the expected signals.
Matlab scripts The Matlab scripts has both the signal generation script (genLocationSig.m) and my receive/processing script (calcTimingOffset.m).