FFTW Library at SCS
Description
FFTW (
The Fastest Fourier Transform in the West) is a C subroutine library for computing the discrete Fourier transform (DFT) in one or more dimensions, of arbitrary input size, and of both real and complex data (as well as of even/odd data, i.e. the discrete cosine/sine transforms or DCT/DST). We believe that
FFTW, which is free software, should become the FFT library of choice for most applications.
Note that there are two main versions of FFTW, version 2 and version 3 which are not compatible.
General Use
The basic usage of FFTW to compute a one-dimensional DFT of size N is simple, and it typically looks something like this code:
#include <fftw3.h>
...
{
fftw_complex *in, *out;
fftw_plan p;
...
in = (fftw_complex*) fftw_malloc(sizeof(fftw_complex) * N);
out = (fftw_complex*) fftw_malloc(sizeof(fftw_complex) * N);
p = fftw_plan_dft_1d(N, in, out, FFTW_FORWARD, FFTW_ESTIMATE);
...
fftw_execute(p); /* repeat as needed */
...
fftw_destroy_plan(p);
fftw_free(in); fftw_free(out);
}
To link this code, you simply add -lfftw3 and -lm to your linker options.
Other examples can be found at the
FFTW tutorial pages.
Cluster Specific Use
Phoenix
- The fftw version 2 and version 3 are both installed as part of the OS install. The libraries are:
- /usr/lib/libfftw.a -- version 2
- /usr/lib/libfftw3.a -- version 3
- shared objects are also available.
- An fftw3 version compiled with single precision is available on: /usr/local/lib/fftw3/lib
- All versions are compiled with gcc.
Prism
- Only ffftw version 3 is installed on Prism. The libraries are:
- /usr/lib64/libfftw3_threads.so.3.1.1
- /usr/lib64/libfftw3_threads.so.3
- /usr/lib64/libfftw3.so.3.1.1
- /usr/lib64/libfftw3.so.3
- All versions are compiled with gcc.
--
JeffMcDonald - 19 Oct 2006
--
GeoffW - 29 Mar 2007