GNU Info

Info Node: (fftw.info)Data Types

(fftw.info)Data Types


Next: One-dimensional Transforms Reference Prev: FFTW Reference Up: FFTW Reference
Enter node , (file) or (file)node

Data Types
==========

   The routines in the FFTW package use three main kinds of data types.
"Real" and "complex" numbers should be already known to the reader.  We
also use the term "halfcomplex" to describe complex arrays in a special
packed format used by the one-dimensional real transforms (taking
advantage of the "hermitian" symmetry that arises in those cases).

   By including `<fftw.h>' or `<rfftw.h>', you will have access to the
following definitions:

     typedef double fftw_real;
     
     typedef struct {
          fftw_real re, im;
     } fftw_complex;
     
     #define c_re(c)  ((c).re)
     #define c_im(c)  ((c).im)

   All FFTW operations are performed on the `fftw_real' and
`fftw_complex' data types.  For `fftw_complex' numbers, the two macros
`c_re' and `c_im' retrieve, respectively, the real and imaginary parts
of the number.

   A "real array" is an array of real numbers.  A "complex array" is an
array of complex numbers.  A one-dimensional array X of n complex
numbers is "hermitian" if the following property holds: for all 0 <= i
< n, we have X[i] = conj(X[n-i]).  Hermitian arrays are relevant to
FFTW because the Fourier transform of a real array is hermitian.

   Because of its symmetry, a hermitian array can be stored in half the
space of a complex array of the same size.  FFTW's one-dimensional real
transforms store hermitian arrays as "halfcomplex" arrays.  A
halfcomplex array of size n is a one-dimensional array of n `fftw_real'
numbers.  A hermitian array X in stored into a halfcomplex array Y as
follows.  For all integers i such that 0 <= i <= n / 2, we have Y[i] =
Re(X[i]).  For all integers i such that 0 < i < n / 2, we have Y[n-i] =
Im(X[i]).

   We now illustrate halfcomplex storage for n = 4 and n = 5, since the
scheme depends on the parity of n.  Let n = 4.  In this case, we have
Y[0] = Re(X[0]), Y[1] = Re(X[1]), Y[2] = Re(X[2]), and  Y[3] = Im(X[1]).
Let now n = 5.  In this case, we have Y[0] = Re(X[0]), Y[1] = Re(X[1]),
Y[2] = Re(X[2]), Y[3] = Im(X[2]), and Y[4] = Im(X[1]).

   By default, the type `fftw_real' equals the C type `double'.  To
work in single precision rather than double precision, `#define' the
symbol `FFTW_ENABLE_FLOAT' in `fftw.h' and then recompile the library.
On Unix systems, you can instead use `configure --enable-float' at
installation time (Note: Installation and Customization.).

   In version 1 of FFTW, the data types were called `FFTW_REAL' and
`FFTW_COMPLEX'.  We changed the capitalization for consistency with the
rest of FFTW's conventions.  The old names are still supported, but
their use is deprecated.


automatically generated by info2www version 1.2.2.9