why the result of cross-correlation coefficient is 1?
5 次查看(过去 30 天)
显示 更早的评论
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)
0 个评论
采纳的回答
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 个)
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.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Signal Analysis 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!