N-D fast Fourier transform
Y = fftn(X)
Y = fftn(X,sz)
Y = fftn( truncates
X with trailing zeros before taking the transform
according to the elements of the vector
sz defines the length of the corresponding
transform dimensions. For example, if
X is a 5-by-5-by-5
Y = fftn(X,[8 8 8]) pads each dimension
with zeros resulting in an 8-by-8-by-8 transform
You can use the
fftn function to compute a 1-D fast Fourier transform in each dimension of a multidimensional array.
Create a 3-D signal
X. The size of
X is 20-by-20-by-20.
x = (1:20)'; y = 1:20; z = reshape(1:20,[1 1 20]); X = cos(2*pi*0.01*x) + sin(2*pi*0.02*y) + cos(2*pi*0.03*z);
Compute the 3-D Fourier transform of the signal, which is also a 20-by-20-by-20 array.
Y = fftn(X);
X with zeros to compute a 32-by-32-by-32 transform.
m = nextpow2(20); Y = fftn(X,[2^m 2^m 2^m]); size(Y)
ans = 32 32 32
X— Input array
Input array, specified as a matrix or a multidimensional array.
X is of type
computes in single precision, and
Y is also of
returned as type
Complex Number Support: Yes
sz— Length of transform dimensions
Length of the transform dimensions, specified as a vector of
positive integers. The elements of
to the transformation lengths of the corresponding dimensions of
be equal to
The discrete Fourier transform Y of an N-D array X is defined as
Each dimension has length mk for k = 1,2,...,N, and are complex roots of unity where i is the imaginary unit.
Usage notes and limitations:
sz argument must have a fixed