Get fftw++ at SourceForge.net. Fast, secure and Free Open Source software downloads

FFTW++: Fast Fourier Transform C++ Header Class for FFTW3


FFTW++ is a C++ header class for Version 3 of the highly optimized FFTW Fourier Transform library. Version 1.13 is now available for download. You can also sign up for announcements of upcoming releases.

FFTW++ provides a simple interface for 1D, 2D, and 3D complex-to-complex, real-to-complex, and complex-to-real Fast Fourier Transforms that takes care of the technical aspects of memory allocation, alignment, planning, and wisdom. Wrappers for multiple 1D transforms are also provided. As with the FFTW3 library, in-place and out-of-place multithreaded transforms of arbitrary size are supported.

Implicit dealiasing of standard and centered Hermitian convolutions is also implemented; in 2D and 3D this implicit zero-padding substantially reduces memory usage and computation time. See Efficient Dealiased Convolutions without Padding by John C. Bowman and Malcolm Roberts, SIAM Journal on Scientific Computing, 33:1, 386-406 (2011):

Convenient optional shift routines that place the Fourier origin in the logical center of the domain are provided for centered complex-to-real transforms in 2D and 3D; see fftw++.h for details.

FFTW++ can also exploit the high-performance Array class (version 1.47 or higher), designed for scientific computing. The arrays in that package do memory bounds checking in debugging mode, but can be optimized by specifying the -DNDEBUG compilation option (1D arrays optimize completely to pointer operations).

FFTW++ includes interfaces and examples for calling FFTW++ from C++, C, Python, and Fortran.

Detailed documentation is provided before each class in the fftw++.h header file. The included examples illustrate how easy it is to use FFTW in C++ with the FFTW++ header class. Use of the Array class is optional, but encouraged. If for some reason the Array class is not used, memory should be allocated with ComplexAlign (or doubleAlign) to ensure that the data is optimally aligned to sizeof(Complex), to enable the SIMD extensions. The optional alignment check in fftw++.h can be disabled with the -DNO_CHECK_ALIGN compiler option.

Examples using ComplexAlign allocator:

1D complex 1D real-to-complex

Examples using Array class:

1D complex 1D real-to-complex

2D complex 2D real-to-complex

3D complex 3D real-to-complex

Implicitly dealiased convolutions:

1D and 2D implicitly dealiased convolutions

1D complex convolution test
1D Hermitian convolution test
1D Hermitian ternary convolution test

2D complex convolution test
2D Hermitian convolution test
2D Hermitian ternary convolution test

3D complex convolution test
3D Hermitian convolution test


  • High-performance multi-dimensional C++ Array class (as fast as Fortran)
  • The latest Subversion developmental source code for fftw++ is available from http://sourceforge.net/p/fftwpp/code/
  • All source files in the FFTW++ project, unless explicitly noted otherwise, are released under version 3 (or later) of the GNU Lesser General Public License (see the files LICENSE.LESSER and LICENSE in the top-level source directory).

    HOME: http://www.math.ualberta.ca/~bowman