Digital Signal Processing Reference
In-Depth Information
1.9000
>> x*[yn(5:10), yn(1:4)]./length(x)
ans =
1.3000
>> x*[yn(4:10), yn(1:3)]./length(x)
ans =
0.4000
>> x*[yn(3:10), yn(1:2)]./length(x)
ans =
1.3000
>> x*[yn(2:10), yn(1)]./length(x)
ans =
1.9000
Technically, the value returned above is not the correlation, but the cross-
covariance. One problem is that the shortcut used above only works when the
signal has an average of 0. Another problem with this value is that it does not tell
us if the two signals are an exact match. That is, in the rst example above, the
cross-covariance between x and y was found to be 4.4, but if we were to compare
signal x with some other signal, could the cross-covariance be higher? Actually, the
answer is yes! The following two commands show why this is the case. Taking the
signal y and multiplying each value by 10, then nding the cross-covariance, leads
to an answer 10 times the original.
>> clear all
>> x = [ 0 0 1 5 1 -2 -3 -2 0 0 ];
>> y = [ 1 5 1 -2 -3 -2 0 0 0 0 ];
Search WWH ::




Custom Search