Re: anyone have an answer to this?
- From: "bronx" <branko_blagojevic@xxxxxxxxxxx>
- Date: Mon, 07 Apr 2008 13:41:54 -0500
On Apr 7, 6:37=A0am, "bronx" <branko_blagoje...@xxxxxxxxxxx> wrote:post,
Hi there,
Just wondering if this question was answered...I know it is an old
asbut just taking a long shot here. Essentially I am getting the same
outcome...specifically, in matlab, I can generate an appropriate
correlation plot, and retrieve the correct delay with xcorr...as well
correctusing the TF method : max(ifft(fft(x1).*conj(fft(x2))), i.e. through
regular cross correlation.
However, when I try to retrieve phase correlation:
X1 =3D fft(x1);
X2 =3D fft(x2);
numerator =3D X1.*X2;
PhaseCorr =3D fftshift(ifft((numerator)./abs(numerator)));
I don't get the kroeneker delta that I should be getting in the
betweendelay position. What am I doing wrong???
My signals (x1, and x2) are two sinusoids of freq f and delay T
each other, and length N samples...they have been zero padded with N-1
extra zeroes.
Does someone have a solution to this probem.
What exactly is "phase correlation"? Give me a description, not
equations.
Where do you expect the delta to be?
Why do you expect to get a delta function out of what you are doing?
Dirk
Hi,
sorry, I should have been more clear...I am trying to perform the
generalized cross correlation PHAT (phase transform). This is also
sometimes called normalized cross correlation. This is essentially a
regular cross correlation algorithm in the frequency domain, for two
signals, divided by the absolute value of the product of one signal and
the conjugate of the other. for example:
PHAT = X1.*conj(X2)./abs(X1.*conj(X2))
If the signals are just a delayed version of each other, then the inverse
fourier transform of the PHAT should provide a plot of the signal with a
kronecker delta in the location of the time delay between the two time
shifted signals. I am looking for this time delay.
More detail regarding the algorithm is found here.
http://en.wikipedia.org/wiki/Phase_correlation
My issue is that when i plot this in matlab using the following code to
retrieve the delay information using the following code:
(x1 and x2 are equivalent sinusoids (N samples in 20ms segment) delayed by
time T from one another)
time = 20ms;
x1pad = [x1 zeros(N-1)];
x2pad = [x2 zeros(N-1)];
X1 = fft(x1pad);
X2 = fft(x2pad);
numerator = X1.*X2;
PhaseCorr = fftshift(ifft((numerator)./abs(numerator)));
y = time*linspace(-1,1, 2*N-1);
plot(t,PhaseCorr);
[maxAmp maxIndex] = max(PhaseCorr);
Tretrieved = t(maxIndex);
I don't get a delta at time Tretrieved (which is the retrieved T delay) as
I should....When I plug in normal correlation (i.e. remove
'./abs(numerator)' in the code above, then I do get a maximum in the right
time interval T. Instead my maximum point under the PHAT algorithn (which
is not very large in amplitude) is closer to the origin rather than at
time T.
The problem with using the regular CC method is that it really gets messy
when there are multiple sinusoids in the signal, and multiple delays
between them. I read that weighting CC algorithms such as the PHAT, SCOT
and Hanan Thomson transform are typically used for the retrieval of a time
delay because they are more robust to noise, and signal overlay...and most
papers suggest the PHAT one in particular.
So, my question is whether I am doing something wrong, judging from the
code above...why am I getting the right delay for regular cross
correlation, but not for the PHAT algorithm...
Any suggestions??
.
- Follow-Ups:
- Re: anyone have an answer to this?
- From: bronx
- Re: anyone have an answer to this?
- References:
- anyone have an answer to this?
- From: bronx
- Re: anyone have an answer to this?
- From: dbell
- anyone have an answer to this?
- Prev by Date: Re: Need algorithm to "stabilize" input data
- Next by Date: Re: anyone have an answer to this?
- Previous by thread: Re: anyone have an answer to this?
- Next by thread: Re: anyone have an answer to this?
- Index(es):
Relevant Pages
|