d@0: d@0: d@0: Complex Multi-Dimensional DFTs - FFTW 3.2.1 d@0: d@0: d@0: d@0: d@0: d@0: d@0: d@0: d@0: d@0: d@0: d@0: d@0: d@0:
d@0:

d@0: d@0: d@0: Next: , d@0: Previous: Complex One-Dimensional DFTs, d@0: Up: Tutorial d@0:


d@0:
d@0: d@0:

2.2 Complex Multi-Dimensional DFTs

d@0: d@0:

Multi-dimensional transforms work much the same way as one-dimensional d@0: transforms: you allocate arrays of fftw_complex (preferably d@0: using fftw_malloc), create an fftw_plan, execute it as d@0: many times as you want with fftw_execute(plan), and clean up d@0: with fftw_destroy_plan(plan) (and fftw_free). The only d@0: difference is the routine you use to create the plan: d@0: d@0:

     fftw_plan fftw_plan_dft_2d(int n0, int n1,
d@0:                                 fftw_complex *in, fftw_complex *out,
d@0:                                 int sign, unsigned flags);
d@0:      fftw_plan fftw_plan_dft_3d(int n0, int n1, int n2,
d@0:                                 fftw_complex *in, fftw_complex *out,
d@0:                                 int sign, unsigned flags);
d@0:      fftw_plan fftw_plan_dft(int rank, const int *n,
d@0:                              fftw_complex *in, fftw_complex *out,
d@0:                              int sign, unsigned flags);
d@0: 
d@0:

d@0: These routines create plans for n0 by n1 two-dimensional d@0: (2d) transforms, n0 by n1 by n2 3d transforms, d@0: and arbitrary rank-dimensional transforms, respectively. In the d@0: third case, n is a pointer to an array n[rank] denoting d@0: an n[0] by n[1] by ... by n[rank-1] d@0: transform. All of these transforms operate on contiguous arrays in d@0: the C-standard row-major order, so that the last dimension has d@0: the fastest-varying index in the array. This layout is described d@0: further in Multi-dimensional Array Format. d@0: d@0:

You may have noticed that all the planner routines described so far d@0: have overlapping functionality. For example, you can plan a 1d or 2d d@0: transform by using fftw_plan_dft with a rank of 1 d@0: or 2, or even by calling fftw_plan_dft_3d with n0 d@0: and/or n1 equal to 1 (with no loss in efficiency). This d@0: pattern continues, and FFTW's planning routines in general form a d@0: “partial order,” sequences of d@0: interfaces with strictly increasing generality but correspondingly d@0: greater complexity. d@0: d@0:

fftw_plan_dft is the most general complex-DFT routine that we d@0: describe in this tutorial, but there are also the advanced and guru interfaces, d@0: which allow one to efficiently combine multiple/strided transforms d@0: into a single FFTW plan, transform a subset of a larger d@0: multi-dimensional array, and/or to handle more general complex-number d@0: formats. For more information, see FFTW Reference. d@0: d@0: d@0: d@0: