DSPRelated.com
Forums

time shift between two sine waves

Started by rashdk November 16, 2006
I have an acoustic source generating a  sine wave at a distance ,say , 100m
from a point A and at 120 m from a point B. I need to find out the
difference in arrival of the wave at A and B. Whats the way around. Can it
be done in matlab. can the phase shift between the waves at A and B be
found out to give the time shift....please suggest... 


On Thu, 16 Nov 2006 12:41:16 -0600, "rashdk" <singhdk@rediffmail.com> wrote:

>I have an acoustic source generating a sine wave at a distance ,say , 100m >from a point A and at 120 m from a point B. I need to find out the >difference in arrival of the wave at A and B. Whats the way around. Can it >be done in matlab. can the phase shift between the waves at A and B be >found out to give the time shift....please suggest...
The problem I see is that if you are talking about sound travelling in air, the distances you have in mind are large compared to the wavelength of most normal audio frequencies. Therefore the phase difference can be more than 360 degrees. This introduces an ambiguity since a sine wave looks the same 360 degrees later. You might need to vary the frequency and combine phase readings at several different frequencies to resolve the ambiguity. Or you could use a discrete edge, like the starting or stopping of the sound, to make a rough measurement that is further refined by your sine wave phase measurements. Robert Scott Ypsilanti, Michigan
rashdk wrote:
> I have an acoustic source generating a sine wave at a distance ,say , 100m > from a point A and at 120 m from a point B. I need to find out the > difference in arrival of the wave at A and B. Whats the way around. Can it > be done in matlab. can the phase shift between the waves at A and B be > found out to give the time shift....please suggest...
distance time = ---------- velocity Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
On Thu, 16 Nov 2006 15:37:28 -0500, Jerry Avins <jya@ieee.org> wrote:

>At 20C, the speed of sound in air is 343.6 m/s. The time difference will >be .0582 s at a difference of 120 m no matter what the frequency. That's >the time for one cycle at 17.18 Hz.
So if the OP was using, say, 100 Hz or higher there would be no hope of uniquely identifying the time difference based on phase measurements alone. But if phase differences were measured for 100 Hz and then for 105 Hz, then he could uniquely find the time difference. Robert Scott Ypsilanti, Michigan
Robert Scott wrote:
> On Thu, 16 Nov 2006 12:41:16 -0600, "rashdk" <singhdk@rediffmail.com> wrote: > >> I have an acoustic source generating a sine wave at a distance ,say , 100m >>from a point A and at 120 m from a point B. I need to find out the >> difference in arrival of the wave at A and B. Whats the way around. Can it >> be done in matlab. can the phase shift between the waves at A and B be >> found out to give the time shift....please suggest... > > The problem I see is that if you are talking about sound travelling in air, the > distances you have in mind are large compared to the wavelength of most normal > audio frequencies. Therefore the phase difference can be more than 360 degrees. > This introduces an ambiguity since a sine wave looks the same 360 degrees later. > You might need to vary the frequency and combine phase readings at several > different frequencies to resolve the ambiguity. Or you could use a discrete > edge, like the starting or stopping of the sound, to make a rough measurement > that is further refined by your sine wave phase measurements.
At 20C, the speed of sound in air is 343.6 m/s. The time difference will be .0582 s at a difference of 120 m no matter what the frequency. That's the time for one cycle at 17.18 Hz. Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
rashdk wrote:
> I have an acoustic source generating a sine wave at a distance ,say , 100m > from a point A and at 120 m from a point B. I need to find out the > difference in arrival of the wave at A and B. Whats the way around. Can it > be done in matlab. can the phase shift between the waves at A and B be > found out to give the time shift....please suggest...
You need what is known as the time-difference of arrival. Find it by cross-correlating the two receievd signals. Naebad
Robert Scott wrote:
> On Thu, 16 Nov 2006 15:37:28 -0500, Jerry Avins <jya@ieee.org> wrote: > >> At 20C, the speed of sound in air is 343.6 m/s. The time difference will >> be .0582 s at a difference of 120 m no matter what the frequency. That's >> the time for one cycle at 17.18 Hz. > > So if the OP was using, say, 100 Hz or higher there would be no hope of uniquely > identifying the time difference based on phase measurements alone. But if phase > differences were measured for 100 Hz and then for 105 Hz, then he could uniquely > find the time difference.
Yes, and short pulses would reduce the computation needed. To measure phase, he needs simultaneous information from both receiving locations. A firecracker would be a pretty good marker. Start counting time when it's heard at the first location and stop when it's heard at the other. One could use a long pseudo-random sequence and cross correlate the received signals with one another or each with the source. He could use a tape measure. He could ask the janitor. Still, if he has to use sine waves, he either does it your way, measuring at two frequencies, or with one suitably low frequency. Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
naebad wrote:
> rashdk wrote: >> I have an acoustic source generating a sine wave at a distance ,say , 100m >> from a point A and at 120 m from a point B. I need to find out the >> difference in arrival of the wave at A and B. Whats the way around. Can it >> be done in matlab. can the phase shift between the waves at A and B be >> found out to give the time shift....please suggest... > > You need what is known as the time-difference of arrival. Find it by > cross-correlating the two receievd signals.
Cross correlating sine waves leaves the ambiguity discussed above. Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
Jerry Avins wrote:
> naebad wrote: > > rashdk wrote: > >> I have an acoustic source generating a sine wave at a distance ,say , 100m > >> from a point A and at 120 m from a point B. I need to find out the > >> difference in arrival of the wave at A and B. Whats the way around. Can it > >> be done in matlab. can the phase shift between the waves at A and B be > >> found out to give the time shift....please suggest... > > > > You need what is known as the time-difference of arrival. Find it by > > cross-correlating the two receievd signals. > > Cross correlating sine waves leaves the ambiguity discussed above.
Seems like any signal which has some sort of self-shift-invariant property over the window bounds and within the measurement error would have this ambiguity. Not just sine waves. IMHO. YMMV. -- rhn A.T nicholson d.0.t C-o-M
Ron N. wrote:
> Jerry Avins wrote: >> naebad wrote: >>> rashdk wrote: >>>> I have an acoustic source generating a sine wave at a distance ,say , 100m >>>> from a point A and at 120 m from a point B. I need to find out the >>>> difference in arrival of the wave at A and B. Whats the way around. Can it >>>> be done in matlab. can the phase shift between the waves at A and B be >>>> found out to give the time shift....please suggest... >>> You need what is known as the time-difference of arrival. Find it by >>> cross-correlating the two receievd signals. >> Cross correlating sine waves leaves the ambiguity discussed above. > > Seems like any signal which has some sort of self-shift-invariant > property over the window bounds and within the measurement > error would have this ambiguity. Not just sine waves.
Yes. That's what makes very short signals or long-period sequences so useful. The former are simpler to implement, while the latter are more robust in the presence of noise. Sonar, anybody? Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;