Syntax C/C++  #include <MFstd.h>
void MF_xcorr( fMatrix MC, fMatrix MA, fMatrix MB, ui ht, ui len ); 
C++ MatObj  #include <OptiVec.h>
void matrix<T>::xcorr( const matrix<T>& MA, const matrix<T>& MB ); 
Pascal/Delphi  uses MFstd;
procedure MF_xcorr( MC, MA, MB:fMatrix; ht, len:UIntSize ); 

Description  The spatial crosscorrelation function (SCCF) of MA and MB is calculated and stored in MC in wraparound order in both dimensions: The row elements MC_{i,0} to MC_{i,len/21} contain the SCCF for zero and positive x lags. Beginning with the most negative lag in MC_{i,len/2+1}, the elements up to MC_{i,len1} contain the SCCF for negative lags. Since this function assumes MA and MB to be periodic, the SCCF for the most positive lag is identical to the SCCF for the most negative lag. This element is stored as MC_{i,len/2}.
Similarly, the column elements MC_{0,j} to MC_{len/21,j} contain the SCCF for zero and positive y lags. Beginning with the most negative lag in MC_{len/2+1,j}, the elements up to MC_{len1,j} contain the SCCF for negative lags.
To get the SCCF into normal order, you may call
MF_Rows_rotate( MC, ht, len, len/2 );
MF_Cols_rotate( MC, ht, len, ht/2 );
After that, the zero point is at the position MC_{ht/2,len/2}.
In case MA or MB are nonperiodic, you should avoid end effects by the methods described in connection with MF_convolve.
All three matrices involved have the same dimensions. Both ht and len must be integer powers of 2.
About special versions with the prefixes MFl_ and MFs_, consult chapter 4.8 of http://www.optivec.com/vecfuncs/. 
