Contents Previous Next Subchapters

Two Dimensional Convolution Of Matrices Using FFT
Syntax f = conv2(gh)
See Also conv , fft2d

Description
Returns a matrix that is the two dimensional convolution of g with h, where g and h are integer, real, double-precision, or complex matrices. We use the following notation to specify the return matrix f:
Notation Meaning
mf number of rows in f
nf number of columns in f
mg number of rows in g
ng number of columns in g
mh number of rows in h
nh number of columns in h
If < i < mh and < j < nh we define
     H(ij) = h
                i,j
otherwise H(ij) is zero. The return value f has the same type as g and is defined by
     mf = mg + mh - 1
     nf = ng + nh - 1

           mg  ng
           --- --- 
     f   = >   >    g    H(m-i+1, n-j+1)
      m,n  --- ---   i,j
           i=1 j=1
An two dimensional fft is used to compute the convolution.

Example
     g = { ...
          [1., 1.], ...
          [1., 1.]  ...
     }
     conv2(g, g)
returns
     {
     [1 , 2 , 1], ...
     [2 , 4 , 2], ...
     [1 , 2 , 1] ...
     }