Mathematics    

FFT Length Versus Speed

You can add a second argument to fft to specify a number of points n for the transform

With this syntax, fft pads x with zeros if it is shorter than n, or truncates it if it is longer than n. If you do not specify n, fft defaults to the length of the input sequence.

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.

The inverse FFT function ifft also accepts a transform length argument.

For practical application of the FFT, the Signal Processing Toolbox includes numerous functions for spectral analysis.


  Magnitude and Phase of Transformed Data Function Functions