rand()
is for "Uniformly distributed pseudorandom numbers"I generate two
rand
arrays, and then use the cross-correlation (xcorr2
) and the normalized cross correlation (normxcorr2
) as follows:a = rand(512,512); b = rand(512,512); c = xcorr2(a,b); figure;surf(c);shading flat;axis tight; d = normxcorr2(a,b); figure;surf(d);shading flat;axis tight;
The results are as follows:
in which there is strong correlation in the
xcorr2()
.randn()
is for "Normally distributed pseudorandom numbers"The same as the above:
a = randn(512,512); b = randn(512,512); c = xcorr2(a,b); figure;surf(c);shading flat;axis tight; d = normxcorr2(a,b); figure;surf(d);shading flat;axis tight;
and the results are:
Then, my question is why there is apparent difference of xcorr2()
for the two random data?