フィルターのクリア

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 Center および File ExchangeSignal Analysis についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by