This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.


N-D fast Fourier transform


Y = fftn(X)
Y = fftn(X,siz)


Y = fftn(X) returns the discrete Fourier transform (DFT) of X, computed with a multidimensional fast Fourier transform (FFT) algorithm. The result Y is the same size as X.

Y = fftn(X,siz) pads X with zeros, or truncates X, to create a multidimensional array of size siz before performing the transform. The size of the result Y is siz.

Data Type Support

fftn supports inputs of data types double and single. If you call fftn with the syntax y = fftn(X, ...), the output y has the same data type as the input X.

More About

collapse all


fftn(X) is equivalent to

Y = X;
for p = 1:length(size(X))
    Y = fft(Y,[],p);

This computes in-place the one-dimensional fast Fourier transform along each dimension of X. The execution time for fft depends on the length of the transform. It is fastest for powers of two. It is almost as fast for lengths that have only small prime factors. It is typically several times slower for lengths that are prime or which have large prime factors.

    Note   You might be able to increase the speed of fftn using the utility function fftw, which controls the optimization of the algorithm used to compute an FFT of a particular size and dimension.

See Also

| | |

Introduced before R2006a

Was this topic helpful?