Description  The convolution of MX with the response function MRsp is calculated and stored in MY. A filter MFlt is also calculated. If more than one matrix is to be convolved with the same MRsp, use MF_convolve only once and use MF_filter for the other matrices.
The response has to be stored in MRsp in wraparound order in both dimensions: in each row i of MRsp, the response for zero and positive xvalues is stored in MRsp_{i,0} to MRsp_{i,len/2} and the response for negative xvalues (beginning with the most negative x) in MRsp_{i,len/2+1} to MRsp_{i,len1}.
Similarly, in each column of MRsp, the response for zero and positive yvalues is stored in MRsp_{0,j} to MRsp_{len/2,j} and the response for negative yvalues (beginning with the most negative y) in MRsp_{len/2+1,j} to MRsp_{len1,j}.
You may wish to use MF_Rows_rotate and MF_Cols_rotate, or MF_Rows_reflect and MF_Cols_reflect to achieve this wraparound order and to construct the response matrix. The result of the convolution appears scaled with the sum of all elements of MRsp. Normally, therefore, MRsp should be normalized to 1.0.
MX, MY, MRsp, and MFlt must all be of the same dimensions. Both len and ht have to be integer powers of 2. MX may be overwritten by MY, MRsp may be overwritten by MFlt, but MX and MFlt as well as MY and MRsp have to be distinct from each other.
A response function which attenuates some spatial frequences so much that any information about them is lost (e.g., high frequencies for a lowcut filter) is marked by very small values in MFlt for the respective frequencies. Here, "very small" means that they are in the order of roundoff error. In order to minimize roundoff error, MF_convolve replaces such small values in Flt by 0.
All one and twodimensional convolutions and deconvolutions use the same default threshold for this implicit filter editing. It can be retrieved by VF_setRspEdit. If you wish to set a different threshold for all calls to VF / MF_convolve and VF / MF_deconvolve, you may use VF_setRspEdit. However, this method is not threadsafe and should not be used to set different thresholds for different calls to VF / MF_convolve or VF / MF_deconvolve. Here, you have to use the variant MF_convolvewEdit, which takes the desired threshold as the argument thresh (and ignores the default threshold). As MFlt consists of complex numbers, and as it is sometimes desirable to treat real and imaginary parts differently, thresh is complex as well.
The input matrix is assumed to be periodic in both dimensions. See the description of VF_convolve on how to avoid end effects, in case it is not periodic.
