Contents Previous Next Subchapters

Two Dimensional Discrete Fourier Transform
Syntax dft2d(z)
See Also fft2 , idft2d , dft

Description
Returns the complex two-dimensional discrete Fourier transform of z, where z is an integer, real, double-precision or complex matrix. If M is the number of rows in z and N is the number of columns in z, the (m,n)-th element of the return value is equal to

  M      N
-----  -----          {         __ [ (i - 1) (m - 1) / M ] }
>      >      z    exp{ -2 pi \/-1 [           +         ] }
-----  -----   i,j    {            [ (j - 1) (n - 1) / N ] }
i = 1  j = 1

If the only prime factors of M and N are 2, 3, 5, and 7, the transform is done in order (M)(N)[log(N) + log(M)] operations; otherwise the transform is done in order (M)(N)(N + M) operations.

Example
In the following example M is 4, N is 2, and the (4,1)-th and (4,2)-th elements of z are one (the rest of the elements of z are zero). The (m,n)-th element of the transform is therefore equal to
            __                             __ 
exp{-2 pi \/-1 [(m - 1)3/4]} + exp{-2 pi \/-1 [(m - 1)3/4 + (n - 1)/2]}

which is also equal to
            __                                   __ 
exp{-2 pi \/-1 [(m - 1)3/4]} * ( 1 + exp{-2 pi \/-1 [(n - 1)/2]})

If you enter
     z = [{0, 0, 0, 1}, {0, 0, 0, 1}]
     dft2d(z)
O-Matrix replies
     {
     [ (2,0) , (0,0) ]
     [ (0,2) , (0,0) ]
     [ (-2,0) , (0,0) ]
     [ (0,-2) , (0,0) ]
     }

Mlmode
In Mlmode , this function is automatically included as fft2 instead of dft2d. If in Mlmode you enter
     z = [0 0 0 1; 0 0 0 1]';
     fft2(z)
O-Matrix replies
     {
     [ (2,0)  , (0,0) ]
     [ (0,2)  , (0,0) ]
     [ (-2,0) , (0,0) ]
     [ (0,-2) , (0,0) ]
     }