Effacer les filtres
Effacer les filtres

why the result of cross-correlation coefficient is 1?

5 vues (au cours des 30 derniers jours)
bin
bin le 10 Mar 2012
Hi,there is a simple program to compute the cross correlation coefficient between 'orginal signal' and 'reconstructing signal'。There are two questions: (1)why the values of the X and the Y are different? (2)now that the values are different,why the cross correlation coefficient is always 1, in spite of different dbN wavelet? Help me please!Thank you!
x=randn(1,50);
[cA,cD]=dwt(x,'db4');
subplot(311);
plot(x);
title('Original signal');
y=idwt(cA,cD,'db4');
subplot(312);
plot(y);
title('Reconstructing signal');
difference=x-y;
subplot(313);
plot(difference);
title('error');
r=corrcoef(x,y)

Réponse acceptée

Wayne King
Wayne King le 10 Mar 2012
Hi Bin, the Cyclist is absolutely right. There is no difference between the two because all you have done is invert the wavelet transform.
When you say there are differences, what are the sizes of these "differences"?
execute this line and see what you get:
max(abs(x-y))
I get something on the order of 10^(-12) for my particular realization of randn().
When the largest difference between any two elements of a vector is that small, then you should not expect the cross correlation sequence to be anything but 1 at all lags.
  1 commentaire
bin
bin le 10 Mar 2012
Hi Wayne King,thank you for your detailed explanation,and I have understood the reason.

Connectez-vous pour commenter.

Plus de réponses (1)

the cyclist
the cyclist le 10 Mar 2012
I am not an expert on wavelet transforms, but first you transform "x", and then you apply the inverse transform (with the same coefficients and N) to that to get "y". Therefore, x is equal to y, and they have perfect correlation.
  1 commentaire
bin
bin le 10 Mar 2012
Thank you for your answer!There should not be difference existed between X and Y,on the contrary the difference is really existing,whatever the value or the length of X.Looking from the values of X and Y,the cross correlation coefficient should be also existed.

Connectez-vous pour commenter.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by