Fast Fourier Transforms
C Calling Examples

FFTW3 is a directory of C programs which illustate the use of the FFTW3 Fast Fourier Transform library, by Matteo Frigo and Steven Johnson.

The FFTW3 library can compute the discrete Fourier transform of:

FFTW3 can also compute the discrete Hartley transform of real data.

The length of the data is not required to be a power of 2. Any length of data can be processed.

The data is not restricted to 1 dimensional vectors. FFTW3 can handle data that is 2 or 3 dimensional. In fact, the program can handle data with any dimensionality.

Interested users should go to the FFTW home page: http://www.fftw.org/ which contains the current source code, examples, and documentation.


A sample copy of the C include file is available in this directory.

At link time, you must include the FFTW3 library. Depending on where this library is installed, an appropriate command might be

        gcc myprog.c -lfftw3


The computer code and data files described and made available on this web page are distributed under the GNU LGPL license.

Non-free licenses may also be purchased from MIT, for users who do not want their programs protected by the GPL.


FFTW3 examples are available in a C version and a FORTRAN77 version and a FORTRAN90 version.

Related Data and Programs:

FFTPACK4, a C library which implements the Fast Fourier Transform (FFT) by Paul Swarztrauber and Dick Valent, translated by Andrew Fernandes;

FFTPACK5, a FORTRAN90 library which implements the Fast Fourier Transform by Paul Swarztrauber and Dick Valent;

GROMACS, examples which illustrate the use of a molecular dynamics package which uses the FFTW3 library.

GSL, a C++ library which includes a number of FFT routines.

NMS, a FORTRAN90 library which includes a number of FFT routines.

SFTPACK, a C library which implements the "slow" Fourier transform, intended as a teaching tool and comparison with the fast Fourier transform.


Matteo Frigo, Steven Johnson


  1. William Briggs, Van Emden Henson,
    The DFT: An Owner's Manual for the Discrete Fourier Transform,
    SIAM, 1995,
    ISBN13: 978-0-898713-42-8,
    LC: QA403.5.B75.
  2. Elbert Brigham,
    The Fast Fourier Transform and Its Applications,
    Prentice-Hall, 1988,
    ISBN: 0133075052,
    LC: QA403.B74.
  3. Matteo Frigo and Steven Johnson,
    User Manual for FFTW.
    (Available from the FFTW web site)

Source Code:

Examples and Tests:

You can go up one level to the C source codes.

Last revised on 04 November 2007.