How can I determine phase difference between two signals?
How can I determine phase difference between two signals?
(OP)
I have heard of an autocorrelation function that may work. What would the output of autocorrelation be? Specifically, I am working with six digitized audio signals input via an array of microphones in order to find the location of a speaker within a room based upon time delay of arrival. Any help would be greatly appreciated.
Danny
Danny





RE: How can I determine phase difference between two signals?
M
--
Dr Michael F Platten
RE: How can I determine phase difference between two signals?
I have a suspicion that the cross correlation technique is more accurate.
Cheers
Greg Locock
Please see FAQ731-376 for tips on how to make the best use of Eng-Tips.
RE: How can I determine phase difference between two signals?
>> x=0:0.1:50;
>> y=sin(x);
>> y2=sin(x-1);
>> a=xcorr(y,y2);
>> plot(a)
Am I on the right track?
Danny
RE: How can I determine phase difference between two signals?
try
CODE
plot(delay,a);
Note that this is only an ESTIMATE of the cross-covariance function. The true cross-covariance between two sine waves of the same frequency but different phases is also a sine wave (the plot you see is clearly not a pure sine wave). It is not possible (except with analytical integrable functions) to obtain the true cross-covariance unless your signals extend to +/- infinity on the x axis. Making the signal longer does not really help. In practice cross-covariance functions are usually determined by measuring an estimate of the cross-spectrum and performing an inverse DFT. The Wiener-Kinchine (I think!) theorem says that the cross-spectrum and cross-covariance form a Fourier transform pair.
M
--
Dr Michael F Platten