Name

fft - calculate forward or inverse Fourier transform of an 1-2-3D image

Usage

output = fft(image,[npad])

Input

image
input image, if real, the forward Fourier transform is calculated, if Fourier, the inverse Fourier transform is calculated. Input image is not modified by this command.
npad

optional integer argument that specifies how many time the input image will be padded with zeroes before Fourier transform is computed. Default is npad=1, meaning no additional padding is performed (only extension of the x dimension, see Description). npad = 3 means the real image will be padded with zeros to three times the original size and, in addition, its x dimension will be extended.

Output

output

the forward or inverse Fourier transform of the input image. The dimensions of the output image differ from that of the input image, i.e., if the input was real, the output image will have the x dimension extended. If the input was Fourier (and padded), the output image will have the size of the original real image (without padding). For details, see Description.

Description

`   0     1     2      3       4      5    ...       n-2      n-1         n   n+1`

`Re(0)  0.0  Re(1) Im(1)  Re(2) Im(2)            Re(n/2-1) Im(n/2-1)  Re(n/2) 0.0`

`   0     1     2      3       4      5    ...       n-2      n-1         n   n+1`

`Re(0)  0.0  Re(1) Im(1)  Re(2) Im(2)            Re(n/2-1) Im(n/2-1)  Re(n/2) Im(n/2)`

`   0,0     1,0     2,0      3 ,0      4,0      5,0    ...       n-2,0      n-1,0         n,0   n+1,0`

`Re(0,0)  0.0     Re(1,0) Im(1,0)  Re(2,0) Im(2,0)   ...   Re(n/2-1,0) Im(n/2-1,0)  Re(n/2,0) 0.0` `Re(0,1) Im(0,1)  Re(1,1) Im(1,1)  Re(2,1) Im(2,1)   ...   Re(n/2-1,1) Im(n/2-1,1)  Re(n/2,1) Im(n/2,1)` `...` `Re(0,m/2) Im(0,m/2)  Re(1,m/2) Im(1,m/2)  Re(2,m/2) Im(2,m/2)   ...   Re(n/2-1,m/2) Im(n/2-1,m/2)  Re(n/2,m/2) Im(n/2,m/2)` `Re(0,-m/2+1) Im(0,-m/2+1)  Re(1,-m/2+1) Im(1,-m/2+1)  Re(2,-m/2+1) Im(2,-m/2+1)   ...   Re(n/2-1,-m/2+1) Im(n/2-1,-m/2+1)  Re(n/2,-m/2+1) Im(n/2,-m/2+1)` `...` `Re(0,-1) Im(0,-1)  Re(1,-1) Im(1,-1)  Re(2,-1) Im(2,-1)   ...   Re(n/2-1,-1) Im(n/2-1,-1)  Re(n/2,-1) Im(n/2,-1)`

`Re(0,0)  0.0     Re(1,0) Im(1,0)  Re(2,0) Im(2,0)   ...   Re(n/2-1,0) Im(n/2-1,0)  Re(n/2,0) Im(n/2,0)` `Re(0,1) Im(0,1)  Re(1,1) Im(1,1)  Re(2,1) Im(2,1)   ...   Re(n/2-1,1) Im(n/2-1,1)  Re(n/2,1) Im(n/2,1)` `...` `Re(0,m/2) Im(0,m/2)  Re(1,m/2) Im(1,m/2)  Re(2,m/2) Im(2,m/2)   ...   Re(n/2-1,m/2) Im(n/2-1,m/2)  Re(n/2,m/2) Im(n/2,m/2)` `Re(0,-m/2) Im(0,-m/2)  Re(1,-m/2) Im(1,-m/2)  Re(2,-m/2) Im(2,-m/2)   ...   Re(n/2-1,-m/2) Im(n/2-1,-m/2)  Re(n/2,-m/2) Im(n/2,-m/2)` `...` `Re(0,-1) Im(0,-1)  Re(1,-1) Im(1,-1)  Re(2,-1) Im(2,-1)   ...   Re(n/2-1,-1) Im(n/2-1,-1)  Re(n/2,-1) Im(n/2,-1)`

Method

Reference

The references for particular algorithms depend on the FFT library used. The original FFT was reinvented by Cooley Tukey in 1965 after the original algorithm by Gauss. http://en.wikipedia.org/wiki/Cooley-Tukey_FFT_algorithm

Author / Maintainer

Grant Tang/ Pawel A. Penczek.

Keywords

category 1
TRANSFORMS
category 2
FOURIER

Files

fundamentals.py

See also

fftip

Maturity

stable
works for most people, has been tested; test cases/examples available.

Bugs

None. It is perfect.

fft (last edited 2013-07-01 13:12:41 by localhost)