| Image Processing Toolbox | Search  Help Desk |
| fft2 | Examples See Also |
Compute two-dimensional fast Fourier transform (FFT)
Syntax
B = fft2(A)
B = fft2(A,m,n)
Description
B = fft2(A) performs a two-dimensional fast Fourier transform, returning the result in B. B is the same size as A; if A is a vector, B has the same orientation as A.
B = fft2(A,m,n) truncates or zero pads A, if necessary, to create an m-by-n matrix before performing the FFT. The result B is also m-by-n.
Class Support
The input matrixA can be of class double or of any integer class. The output matrix B is of class double.
Remarks
fft2 is a function in MATLAB.
Example
load imdemos saturn2 imshow(saturn2)
B = fftshift(fft2(saturn2)); imshow(log(abs(B)),[]), colormap(jet(64)), colorbar
Algorithm
fft2(A) is simply
fft(fft(A).').'This computes the one-dimensional
fft of each column A, then of each row of the result. The time required to compute fft2(A) depends on the number of prime factors of m and n. fft2 is fastest when m and n are powers of 2.
See Also
dct2, fftshift, idct2, ifft2
fft, ifft in the online MATLAB Function Reference