Chris@82: Chris@82: Chris@82: Chris@82: Chris@82: Chris@82: FFTW 3.3.8: More DFTs of Real Data Chris@82: Chris@82: Chris@82: Chris@82: Chris@82: Chris@82: Chris@82: Chris@82: Chris@82: Chris@82: Chris@82: Chris@82: Chris@82: Chris@82: Chris@82: Chris@82: Chris@82: Chris@82: Chris@82: Chris@82: Chris@82:
Chris@82:

Chris@82: Previous: , Up: Tutorial   [Contents][Index]

Chris@82:
Chris@82:
Chris@82: Chris@82:

2.5 More DFTs of Real Data

Chris@82: Chris@82: Chris@82: Chris@82: Chris@82: Chris@82: Chris@82:

FFTW supports several other transform types via a unified r2r Chris@82: (real-to-real) interface, Chris@82: Chris@82: so called because it takes a real (double) array and outputs a Chris@82: real array of the same size. These r2r transforms currently fall into Chris@82: three categories: DFTs of real input and complex-Hermitian output in Chris@82: halfcomplex format, DFTs of real input with even/odd symmetry Chris@82: (a.k.a. discrete cosine/sine transforms, DCTs/DSTs), and discrete Chris@82: Hartley transforms (DHTs), all described in more detail by the Chris@82: following sections. Chris@82:

Chris@82:

The r2r transforms follow the by now familiar interface of creating an Chris@82: fftw_plan, executing it with fftw_execute(plan), and Chris@82: destroying it with fftw_destroy_plan(plan). Furthermore, all Chris@82: r2r transforms share the same planner interface: Chris@82:

Chris@82:
Chris@82:
fftw_plan fftw_plan_r2r_1d(int n, double *in, double *out,
Chris@82:                            fftw_r2r_kind kind, unsigned flags);
Chris@82: fftw_plan fftw_plan_r2r_2d(int n0, int n1, double *in, double *out,
Chris@82:                            fftw_r2r_kind kind0, fftw_r2r_kind kind1,
Chris@82:                            unsigned flags);
Chris@82: fftw_plan fftw_plan_r2r_3d(int n0, int n1, int n2,
Chris@82:                            double *in, double *out,
Chris@82:                            fftw_r2r_kind kind0,
Chris@82:                            fftw_r2r_kind kind1,
Chris@82:                            fftw_r2r_kind kind2,
Chris@82:                            unsigned flags);
Chris@82: fftw_plan fftw_plan_r2r(int rank, const int *n, double *in, double *out,
Chris@82:                         const fftw_r2r_kind *kind, unsigned flags);
Chris@82: 
Chris@82: Chris@82: Chris@82: Chris@82: Chris@82: Chris@82:

Just as for the complex DFT, these plan 1d/2d/3d/multi-dimensional Chris@82: transforms for contiguous arrays in row-major order, transforming (real) Chris@82: input to output of the same size, where n specifies the Chris@82: physical dimensions of the arrays. All positive n are Chris@82: supported (with the exception of n=1 for the FFTW_REDFT00 Chris@82: kind, noted in the real-even subsection below); products of small Chris@82: factors are most efficient (factorizing n-1 and n+1 for Chris@82: FFTW_REDFT00 and FFTW_RODFT00 kinds, described below), but Chris@82: an O(n log n) Chris@82: algorithm is used even for prime sizes. Chris@82:

Chris@82:

Each dimension has a kind parameter, of type Chris@82: fftw_r2r_kind, specifying the kind of r2r transform to be used Chris@82: for that dimension. Chris@82: Chris@82: Chris@82: (In the case of fftw_plan_r2r, this is an array kind[rank] Chris@82: where kind[i] is the transform kind for the dimension Chris@82: n[i].) The kind can be one of a set of predefined constants, Chris@82: defined in the following subsections. Chris@82:

Chris@82:

In other words, FFTW computes the separable product of the specified Chris@82: r2r transforms over each dimension, which can be used e.g. for partial Chris@82: differential equations with mixed boundary conditions. (For some r2r Chris@82: kinds, notably the halfcomplex DFT and the DHT, such a separable Chris@82: product is somewhat problematic in more than one dimension, however, Chris@82: as is described below.) Chris@82:

Chris@82:

In the current version of FFTW, all r2r transforms except for the Chris@82: halfcomplex type are computed via pre- or post-processing of Chris@82: halfcomplex transforms, and they are therefore not as fast as they Chris@82: could be. Since most other general DCT/DST codes employ a similar Chris@82: algorithm, however, FFTW’s implementation should provide at least Chris@82: competitive performance. Chris@82:

Chris@82:
Chris@82:
Chris@82:

Chris@82: Previous: , Up: Tutorial   [Contents][Index]

Chris@82:
Chris@82: Chris@82: Chris@82: Chris@82: Chris@82: