필터 지우기
필터 지우기

why the result of cross-correlation coefficient is 1?

조회 수: 5 (최근 30일)
bin
bin 2012년 3월 10일
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)

채택된 답변

Wayne King
Wayne King 2012년 3월 10일
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
bin
bin 2012년 3월 10일
Hi Wayne King,thank you for your detailed explanation,and I have understood the reason.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

the cyclist
the cyclist 2012년 3월 10일
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
bin
bin 2012년 3월 10일
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.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Signal Analysis에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by