annotate src/fftw-3.3.8/doc/intro.texi @ 169:223a55898ab9 tip default

Add null config files
author Chris Cannam <cannam@all-day-breakfast.com>
date Mon, 02 Mar 2020 14:03:47 +0000
parents bd3cc4d1df30
children
rev   line source
cannam@167 1 @node Introduction, Tutorial, Top, Top
cannam@167 2 @chapter Introduction
cannam@167 3 This manual documents version @value{VERSION} of FFTW, the
cannam@167 4 @emph{Fastest Fourier Transform in the West}. FFTW is a comprehensive
cannam@167 5 collection of fast C routines for computing the discrete Fourier
cannam@167 6 transform (DFT) and various special cases thereof.
cannam@167 7 @cindex discrete Fourier transform
cannam@167 8 @cindex DFT
cannam@167 9 @itemize @bullet
cannam@167 10 @item FFTW computes the DFT of complex data, real data, even-
cannam@167 11 or odd-symmetric real data (these symmetric transforms are usually
cannam@167 12 known as the discrete cosine or sine transform, respectively), and the
cannam@167 13 discrete Hartley transform (DHT) of real data.
cannam@167 14
cannam@167 15 @item The input data can have arbitrary length.
cannam@167 16 FFTW employs @Onlogn{} algorithms for all lengths, including
cannam@167 17 prime numbers.
cannam@167 18
cannam@167 19 @item FFTW supports arbitrary multi-dimensional data.
cannam@167 20
cannam@167 21 @item FFTW supports the SSE, SSE2, AVX, AVX2, AVX512, KCVI, Altivec, VSX, and
cannam@167 22 NEON vector instruction sets.
cannam@167 23
cannam@167 24 @item FFTW includes parallel (multi-threaded) transforms
cannam@167 25 for shared-memory systems.
cannam@167 26 @item Starting with version 3.3, FFTW includes distributed-memory parallel
cannam@167 27 transforms using MPI.
cannam@167 28 @end itemize
cannam@167 29
cannam@167 30 We assume herein that you are familiar with the properties and uses of
cannam@167 31 the DFT that are relevant to your application. Otherwise, see
cannam@167 32 e.g. @cite{The Fast Fourier Transform and Its Applications} by E. O. Brigham
cannam@167 33 (Prentice-Hall, Englewood Cliffs, NJ, 1988).
cannam@167 34 @uref{http://www.fftw.org, Our web page} also has links to FFT-related
cannam@167 35 information online.
cannam@167 36 @cindex FFTW
cannam@167 37
cannam@167 38 @c TODO: revise. We don't need to brag any longer
cannam@167 39 @c
cannam@167 40 @c FFTW is usually faster (and sometimes much faster) than all other
cannam@167 41 @c freely-available Fourier transform programs found on the Net. It is
cannam@167 42 @c competitive with (and often faster than) the FFT codes in Sun's
cannam@167 43 @c Performance Library, IBM's ESSL library, HP's CXML library, and
cannam@167 44 @c Intel's MKL library, which are targeted at specific machines.
cannam@167 45 @c Moreover, FFTW's performance is @emph{portable}. Indeed, FFTW is
cannam@167 46 @c unique in that it automatically adapts itself to your machine, your
cannam@167 47 @c cache, the size of your memory, your number of registers, and all the
cannam@167 48 @c other factors that normally make it impossible to optimize a program
cannam@167 49 @c for more than one machine. An extensive comparison of FFTW's
cannam@167 50 @c performance with that of other Fourier transform codes has been made,
cannam@167 51 @c and the results are available on the Web at
cannam@167 52 @c @uref{http://fftw.org/benchfft, the benchFFT home page}.
cannam@167 53 @c @cindex benchmark
cannam@167 54 @c @fpindex benchfft
cannam@167 55
cannam@167 56 In order to use FFTW effectively, you need to learn one basic concept
cannam@167 57 of FFTW's internal structure: FFTW does not use a fixed algorithm for
cannam@167 58 computing the transform, but instead it adapts the DFT algorithm to
cannam@167 59 details of the underlying hardware in order to maximize performance.
cannam@167 60 Hence, the computation of the transform is split into two phases.
cannam@167 61 First, FFTW's @dfn{planner} ``learns'' the fastest way to compute the
cannam@167 62 transform on your machine. The planner
cannam@167 63 @cindex planner
cannam@167 64 produces a data structure called a @dfn{plan} that contains this
cannam@167 65 @cindex plan
cannam@167 66 information. Subsequently, the plan is @dfn{executed}
cannam@167 67 @cindex execute
cannam@167 68 to transform the array of input data as dictated by the plan. The
cannam@167 69 plan can be reused as many times as needed. In typical
cannam@167 70 high-performance applications, many transforms of the same size are
cannam@167 71 computed and, consequently, a relatively expensive initialization of
cannam@167 72 this sort is acceptable. On the other hand, if you need a single
cannam@167 73 transform of a given size, the one-time cost of the planner becomes
cannam@167 74 significant. For this case, FFTW provides fast planners based on
cannam@167 75 heuristics or on previously computed plans.
cannam@167 76
cannam@167 77 FFTW supports transforms of data with arbitrary length, rank,
cannam@167 78 multiplicity, and a general memory layout. In simple cases, however,
cannam@167 79 this generality may be unnecessary and confusing. Consequently, we
cannam@167 80 organized the interface to FFTW into three levels of increasing
cannam@167 81 generality.
cannam@167 82 @itemize @bullet
cannam@167 83 @item The @dfn{basic interface} computes a single
cannam@167 84 transform of contiguous data.
cannam@167 85 @item The @dfn{advanced interface} computes transforms
cannam@167 86 of multiple or strided arrays.
cannam@167 87 @item The @dfn{guru interface} supports the most general data
cannam@167 88 layouts, multiplicities, and strides.
cannam@167 89 @end itemize
cannam@167 90 We expect that most users will be best served by the basic interface,
cannam@167 91 whereas the guru interface requires careful attention to the
cannam@167 92 documentation to avoid problems.
cannam@167 93 @cindex basic interface
cannam@167 94 @cindex advanced interface
cannam@167 95 @cindex guru interface
cannam@167 96
cannam@167 97
cannam@167 98 Besides the automatic performance adaptation performed by the planner,
cannam@167 99 it is also possible for advanced users to customize FFTW manually. For
cannam@167 100 example, if code space is a concern, we provide a tool that links only
cannam@167 101 the subset of FFTW needed by your application. Conversely, you may need
cannam@167 102 to extend FFTW because the standard distribution is not sufficient for
cannam@167 103 your needs. For example, the standard FFTW distribution works most
cannam@167 104 efficiently for arrays whose size can be factored into small primes
cannam@167 105 (@math{2}, @math{3}, @math{5}, and @math{7}), and otherwise it uses a
cannam@167 106 slower general-purpose routine. If you need efficient transforms of
cannam@167 107 other sizes, you can use FFTW's code generator, which produces fast C
cannam@167 108 programs (``codelets'') for any particular array size you may care
cannam@167 109 about.
cannam@167 110 @cindex code generator
cannam@167 111 @cindex codelet
cannam@167 112 For example, if you need transforms of size
cannam@167 113 @ifinfo
cannam@167 114 @math{513 = 19 x 3^3},
cannam@167 115 @end ifinfo
cannam@167 116 @tex
cannam@167 117 $513 = 19 \cdot 3^3$,
cannam@167 118 @end tex
cannam@167 119 @html
cannam@167 120 513&nbsp;=&nbsp;19*3<sup>3</sup>,
cannam@167 121 @end html
cannam@167 122 you can customize FFTW to support the factor @math{19} efficiently.
cannam@167 123
cannam@167 124 For more information regarding FFTW, see the paper, ``The Design and
cannam@167 125 Implementation of FFTW3,'' by M. Frigo and S. G. Johnson, which was an
cannam@167 126 invited paper in @cite{Proc. IEEE} @b{93} (2), p. 216 (2005). The
cannam@167 127 code generator is described in the paper ``A fast Fourier transform
cannam@167 128 compiler'',
cannam@167 129 @cindex compiler
cannam@167 130 by M. Frigo, in the @cite{Proceedings of the 1999 ACM SIGPLAN Conference
cannam@167 131 on Programming Language Design and Implementation (PLDI), Atlanta,
cannam@167 132 Georgia, May 1999}. These papers, along with the latest version of
cannam@167 133 FFTW, the FAQ, benchmarks, and other links, are available at
cannam@167 134 @uref{http://www.fftw.org, the FFTW home page}.
cannam@167 135
cannam@167 136 The current version of FFTW incorporates many good ideas from the past
cannam@167 137 thirty years of FFT literature. In one way or another, FFTW uses the
cannam@167 138 Cooley-Tukey algorithm, the prime factor algorithm, Rader's algorithm
cannam@167 139 for prime sizes, and a split-radix algorithm (with a
cannam@167 140 ``conjugate-pair'' variation pointed out to us by Dan Bernstein).
cannam@167 141 FFTW's code generator also produces new algorithms that we do not
cannam@167 142 completely understand.
cannam@167 143 @cindex algorithm
cannam@167 144 The reader is referred to the cited papers for the appropriate
cannam@167 145 references.
cannam@167 146
cannam@167 147 The rest of this manual is organized as follows. We first discuss the
cannam@167 148 sequential (single-processor) implementation. We start by describing
cannam@167 149 the basic interface/features of FFTW in @ref{Tutorial}.
cannam@167 150 Next, @ref{Other Important Topics} discusses data alignment
cannam@167 151 (@pxref{SIMD alignment and fftw_malloc}),
cannam@167 152 the storage scheme of multi-dimensional arrays
cannam@167 153 (@pxref{Multi-dimensional Array Format}), and FFTW's mechanism for
cannam@167 154 storing plans on disk (@pxref{Words of Wisdom-Saving Plans}). Next,
cannam@167 155 @ref{FFTW Reference} provides comprehensive documentation of all
cannam@167 156 FFTW's features. Parallel transforms are discussed in their own
cannam@167 157 chapters: @ref{Multi-threaded FFTW} and @ref{Distributed-memory FFTW
cannam@167 158 with MPI}. Fortran programmers can also use FFTW, as described in
cannam@167 159 @ref{Calling FFTW from Legacy Fortran} and @ref{Calling FFTW from
cannam@167 160 Modern Fortran}. @ref{Installation and Customization} explains how to
cannam@167 161 install FFTW in your computer system and how to adapt FFTW to your
cannam@167 162 needs. License and copyright information is given in @ref{License and
cannam@167 163 Copyright}. Finally, we thank all the people who helped us in
cannam@167 164 @ref{Acknowledgments}.
cannam@167 165