Correlation |
correl(vx,vy) returns the 1D correlation of vectors vx and vy. Result is a vector of length length(vx) + length(vy) − 1, where each element is given by the summation of the vector product of vx with a shifted version of vy.
correl2d(M,K) returns the 2D correlation of a kernel, K, with the matrix M. Result is a matrix of the same size as M, where each element is given by overlapping the center of K with the corresponding element of M, multiplying each element in the overlapping areas, and summing the results. When K extends beyond the edges of M, boundaries are zero padded.
The output of the correl2d function is zero-padded, so it should not be used for 1D correlation, in which the vectors are not truncated.