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


FFTW++ is a C++ header class for Version 3 of the highly optimized FFTW Fourier Transform library. FFTW++ is available for download as fftw++-1.03.tar.gz. Alternatively, you can download the required fftw++.h header and fftw++.cc files directly.

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 itself, both in-place and out-of-place transforms of arbitrary size are supported.

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

FFTW++ can also exploit the high-performance Array class (version 1.39 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).

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 FFTWComplex (or FFTWdouble) 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 FFTWComplex allocator:

1d complex 1d real-to-complex

1d convolution convolution.h

Examples using Array class:

1d complex 1d real-to-complex

2d complex 2d real-to-complex

3d complex 3d real-to-complex


  • High-performance multi-dimensional C++ Array class (as fast as Fortran)
  • HOME: http://www.math.ualberta.ca/~bowman