# fft2

## Purpose

2-D fast Fourier transform.

## Synopsis

    Y = fft2(X)
    Y = fft2(X,m,n)

## Description

`Y = fft2(X)` performs the two-dimensional FFT. The result `Y` is the same size as `X.`

`Y = fft2(X,m,n)` either truncates `X` or pads `X` with 0s to create an `m`-by-`n` array before doing the transform. The result is `m`-by-`n`.

## Algorithm

`fft2(X)` is simply

    fft(fft(X).').'

This computes the one-dimensional FFT of each column `X`, then of each row of the result. The time required to compute `fft2(X)` depends strongly on the number of prime factors in `[m,n] = size(X)`. It is fastest when `m` and `n` are powers of 2.

## See Also

`fft`, `fftshift`, `ifft2`

(c) Copyright 1994 by The MathWorks, Inc.