Chris@10: Chris@10: Chris@10: Guru Complex DFTs - FFTW 3.3.3 Chris@10: Chris@10: Chris@10: Chris@10: Chris@10: Chris@10: Chris@10: Chris@10: Chris@10: Chris@10: Chris@10: Chris@10: Chris@10: Chris@10:
Chris@10: Chris@10:

Chris@10: Next: , Chris@10: Previous: Guru vector and transform sizes, Chris@10: Up: Guru Interface Chris@10:


Chris@10:
Chris@10: Chris@10:

4.5.3 Guru Complex DFTs

Chris@10: Chris@10:
     fftw_plan fftw_plan_guru_dft(
Chris@10:           int rank, const fftw_iodim *dims,
Chris@10:           int howmany_rank, const fftw_iodim *howmany_dims,
Chris@10:           fftw_complex *in, fftw_complex *out,
Chris@10:           int sign, unsigned flags);
Chris@10:      
Chris@10:      fftw_plan fftw_plan_guru_split_dft(
Chris@10:           int rank, const fftw_iodim *dims,
Chris@10:           int howmany_rank, const fftw_iodim *howmany_dims,
Chris@10:           double *ri, double *ii, double *ro, double *io,
Chris@10:           unsigned flags);
Chris@10: 
Chris@10:

Chris@10: These two functions plan a complex-data, multi-dimensional DFT Chris@10: for the interleaved and split format, respectively. Chris@10: Transform dimensions are given by (rank, dims) over a Chris@10: multi-dimensional vector (loop) of dimensions (howmany_rank, Chris@10: howmany_dims). dims and howmany_dims should point Chris@10: to fftw_iodim arrays of length rank and Chris@10: howmany_rank, respectively. Chris@10: Chris@10:

flags is a bitwise OR (‘|’) of zero or more planner flags, Chris@10: as defined in Planner Flags. Chris@10: Chris@10:

In the fftw_plan_guru_dft function, the pointers in and Chris@10: out point to the interleaved input and output arrays, Chris@10: respectively. The sign can be either -1 (= Chris@10: FFTW_FORWARD) or +1 (= FFTW_BACKWARD). If the Chris@10: pointers are equal, the transform is in-place. Chris@10: Chris@10:

In the fftw_plan_guru_split_dft function, Chris@10: ri and ii point to the real and imaginary input arrays, Chris@10: and ro and io point to the real and imaginary output Chris@10: arrays. The input and output pointers may be the same, indicating an Chris@10: in-place transform. For example, for fftw_complex pointers Chris@10: in and out, the corresponding parameters are: Chris@10: Chris@10:

     ri = (double *) in;
Chris@10:      ii = (double *) in + 1;
Chris@10:      ro = (double *) out;
Chris@10:      io = (double *) out + 1;
Chris@10: 
Chris@10:

Because fftw_plan_guru_split_dft accepts split arrays, strides Chris@10: are expressed in units of double. For a contiguous Chris@10: fftw_complex array, the overall stride of the transform should Chris@10: be 2, the distance between consecutive real parts or between Chris@10: consecutive imaginary parts; see Guru vector and transform sizes. Note that the dimension strides are applied equally to the Chris@10: real and imaginary parts; real and imaginary arrays with different Chris@10: strides are not supported. Chris@10: Chris@10:

There is no sign parameter in fftw_plan_guru_split_dft. Chris@10: This function always plans for an FFTW_FORWARD transform. To Chris@10: plan for an FFTW_BACKWARD transform, you can exploit the Chris@10: identity that the backwards DFT is equal to the forwards DFT with the Chris@10: real and imaginary parts swapped. For example, in the case of the Chris@10: fftw_complex arrays above, the FFTW_BACKWARD transform Chris@10: is computed by the parameters: Chris@10: Chris@10:

     ri = (double *) in + 1;
Chris@10:      ii = (double *) in;
Chris@10:      ro = (double *) out + 1;
Chris@10:      io = (double *) out;
Chris@10: 
Chris@10: Chris@10: Chris@10: