FFTP2

Purpose:

Calculates the 2D FFT of an array in polar (magnitude-phase) form.

Syntax:

FFTP2(array, rowlen, collen)

array

-

An input array.

rowlen

-

Optional. An integer, the FFT row size. Defaults to numrows(a).

collen

-

Optional. An integer, the FFT column size. Defaults to numcols(a).

Returns:

A complex array.

Example:

fftp2({{1, 2}, {3, 4}})

 

returns the complex polar array:

 

{{10*exp(i*0),  2*exp(i*PI)}, 

 { 4*exp(i*PI), 0*exp(i*0)}} 

Example:

(x, y) = fxyvals(-2, 2, .1, -2, 2, .1);

W1: cos(x*y);setplottype(3);rainbow

W2: fftp2(W1)

W3: fftshift(log10(mag(W2)))

W4: fftshift(phase(W2))

 

Produces interesting 2D magnitude and phase images.

 

image\fftp2pic.gif

Remarks:

FFTP2 is often used in image processing applications.

 

Use FFTSHIFT to flip the output so the 0 frequency is in the center of the plot.

 

If rowlen is larger than the number of input rows or collen is greater than the number input of columns, the input is zero-padded.

 

If the input data is a series (i.e. a single column), a 1D FFT is performed.

See Also:

FFT

FFT2

FFTP

IFFT2

IFFTP2