cannam@95
|
1 <html lang="en">
|
cannam@95
|
2 <head>
|
cannam@95
|
3 <title>Introduction - FFTW 3.3.3</title>
|
cannam@95
|
4 <meta http-equiv="Content-Type" content="text/html">
|
cannam@95
|
5 <meta name="description" content="FFTW 3.3.3">
|
cannam@95
|
6 <meta name="generator" content="makeinfo 4.13">
|
cannam@95
|
7 <link title="Top" rel="start" href="index.html#Top">
|
cannam@95
|
8 <link rel="prev" href="index.html#Top" title="Top">
|
cannam@95
|
9 <link rel="next" href="Tutorial.html#Tutorial" title="Tutorial">
|
cannam@95
|
10 <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
cannam@95
|
11 <!--
|
cannam@95
|
12 This manual is for FFTW
|
cannam@95
|
13 (version 3.3.3, 25 November 2012).
|
cannam@95
|
14
|
cannam@95
|
15 Copyright (C) 2003 Matteo Frigo.
|
cannam@95
|
16
|
cannam@95
|
17 Copyright (C) 2003 Massachusetts Institute of Technology.
|
cannam@95
|
18
|
cannam@95
|
19 Permission is granted to make and distribute verbatim copies of
|
cannam@95
|
20 this manual provided the copyright notice and this permission
|
cannam@95
|
21 notice are preserved on all copies.
|
cannam@95
|
22
|
cannam@95
|
23 Permission is granted to copy and distribute modified versions of
|
cannam@95
|
24 this manual under the conditions for verbatim copying, provided
|
cannam@95
|
25 that the entire resulting derived work is distributed under the
|
cannam@95
|
26 terms of a permission notice identical to this one.
|
cannam@95
|
27
|
cannam@95
|
28 Permission is granted to copy and distribute translations of this
|
cannam@95
|
29 manual into another language, under the above conditions for
|
cannam@95
|
30 modified versions, except that this permission notice may be
|
cannam@95
|
31 stated in a translation approved by the Free Software Foundation.
|
cannam@95
|
32 -->
|
cannam@95
|
33 <meta http-equiv="Content-Style-Type" content="text/css">
|
cannam@95
|
34 <style type="text/css"><!--
|
cannam@95
|
35 pre.display { font-family:inherit }
|
cannam@95
|
36 pre.format { font-family:inherit }
|
cannam@95
|
37 pre.smalldisplay { font-family:inherit; font-size:smaller }
|
cannam@95
|
38 pre.smallformat { font-family:inherit; font-size:smaller }
|
cannam@95
|
39 pre.smallexample { font-size:smaller }
|
cannam@95
|
40 pre.smalllisp { font-size:smaller }
|
cannam@95
|
41 span.sc { font-variant:small-caps }
|
cannam@95
|
42 span.roman { font-family:serif; font-weight:normal; }
|
cannam@95
|
43 span.sansserif { font-family:sans-serif; font-weight:normal; }
|
cannam@95
|
44 --></style>
|
cannam@95
|
45 </head>
|
cannam@95
|
46 <body>
|
cannam@95
|
47 <div class="node">
|
cannam@95
|
48 <a name="Introduction"></a>
|
cannam@95
|
49 <p>
|
cannam@95
|
50 Next: <a rel="next" accesskey="n" href="Tutorial.html#Tutorial">Tutorial</a>,
|
cannam@95
|
51 Previous: <a rel="previous" accesskey="p" href="index.html#Top">Top</a>,
|
cannam@95
|
52 Up: <a rel="up" accesskey="u" href="index.html#Top">Top</a>
|
cannam@95
|
53 <hr>
|
cannam@95
|
54 </div>
|
cannam@95
|
55
|
cannam@95
|
56 <h2 class="chapter">1 Introduction</h2>
|
cannam@95
|
57
|
cannam@95
|
58 <p>This manual documents version 3.3.3 of FFTW, the
|
cannam@95
|
59 <em>Fastest Fourier Transform in the West</em>. FFTW is a comprehensive
|
cannam@95
|
60 collection of fast C routines for computing the discrete Fourier
|
cannam@95
|
61 transform (DFT) and various special cases thereof.
|
cannam@95
|
62 <a name="index-discrete-Fourier-transform-1"></a><a name="index-DFT-2"></a>
|
cannam@95
|
63 <ul>
|
cannam@95
|
64 <li>FFTW computes the DFT of complex data, real data, even-
|
cannam@95
|
65 or odd-symmetric real data (these symmetric transforms are usually
|
cannam@95
|
66 known as the discrete cosine or sine transform, respectively), and the
|
cannam@95
|
67 discrete Hartley transform (DHT) of real data.
|
cannam@95
|
68
|
cannam@95
|
69 <li>The input data can have arbitrary length.
|
cannam@95
|
70 FFTW employs <i>O</i>(<i>n</i> log <i>n</i>) algorithms for all lengths, including
|
cannam@95
|
71 prime numbers.
|
cannam@95
|
72
|
cannam@95
|
73 <li>FFTW supports arbitrary multi-dimensional data.
|
cannam@95
|
74
|
cannam@95
|
75 <li>FFTW supports the SSE, SSE2, AVX, Altivec, and MIPS PS instruction
|
cannam@95
|
76 sets.
|
cannam@95
|
77
|
cannam@95
|
78 <li>FFTW includes parallel (multi-threaded) transforms
|
cannam@95
|
79 for shared-memory systems.
|
cannam@95
|
80 <li>Starting with version 3.3, FFTW includes distributed-memory parallel
|
cannam@95
|
81 transforms using MPI.
|
cannam@95
|
82 </ul>
|
cannam@95
|
83
|
cannam@95
|
84 <p>We assume herein that you are familiar with the properties and uses of
|
cannam@95
|
85 the DFT that are relevant to your application. Otherwise, see
|
cannam@95
|
86 e.g. <cite>The Fast Fourier Transform and Its Applications</cite> by E. O. Brigham
|
cannam@95
|
87 (Prentice-Hall, Englewood Cliffs, NJ, 1988).
|
cannam@95
|
88 <a href="http://www.fftw.org">Our web page</a> also has links to FFT-related
|
cannam@95
|
89 information online.
|
cannam@95
|
90 <a name="index-FFTW-3"></a>
|
cannam@95
|
91 <!-- TODO: revise. We don't need to brag any longer -->
|
cannam@95
|
92 <!-- FFTW is usually faster (and sometimes much faster) than all other -->
|
cannam@95
|
93 <!-- freely-available Fourier transform programs found on the Net. It is -->
|
cannam@95
|
94 <!-- competitive with (and often faster than) the FFT codes in Sun's -->
|
cannam@95
|
95 <!-- Performance Library, IBM's ESSL library, HP's CXML library, and -->
|
cannam@95
|
96 <!-- Intel's MKL library, which are targeted at specific machines. -->
|
cannam@95
|
97 <!-- Moreover, FFTW's performance is @emph{portable}. Indeed, FFTW is -->
|
cannam@95
|
98 <!-- unique in that it automatically adapts itself to your machine, your -->
|
cannam@95
|
99 <!-- cache, the size of your memory, your number of registers, and all the -->
|
cannam@95
|
100 <!-- other factors that normally make it impossible to optimize a program -->
|
cannam@95
|
101 <!-- for more than one machine. An extensive comparison of FFTW's -->
|
cannam@95
|
102 <!-- performance with that of other Fourier transform codes has been made, -->
|
cannam@95
|
103 <!-- and the results are available on the Web at -->
|
cannam@95
|
104 <!-- @uref{http://fftw.org/benchfft, the benchFFT home page}. -->
|
cannam@95
|
105 <!-- @cindex benchmark -->
|
cannam@95
|
106 <!-- @fpindex benchfft -->
|
cannam@95
|
107
|
cannam@95
|
108 <p>In order to use FFTW effectively, you need to learn one basic concept
|
cannam@95
|
109 of FFTW's internal structure: FFTW does not use a fixed algorithm for
|
cannam@95
|
110 computing the transform, but instead it adapts the DFT algorithm to
|
cannam@95
|
111 details of the underlying hardware in order to maximize performance.
|
cannam@95
|
112 Hence, the computation of the transform is split into two phases.
|
cannam@95
|
113 First, FFTW's <dfn>planner</dfn> “learns” the fastest way to compute the
|
cannam@95
|
114 transform on your machine. The planner
|
cannam@95
|
115 <a name="index-planner-4"></a>produces a data structure called a <dfn>plan</dfn> that contains this
|
cannam@95
|
116 <a name="index-plan-5"></a>information. Subsequently, the plan is <dfn>executed</dfn>
|
cannam@95
|
117 <a name="index-execute-6"></a>to transform the array of input data as dictated by the plan. The
|
cannam@95
|
118 plan can be reused as many times as needed. In typical
|
cannam@95
|
119 high-performance applications, many transforms of the same size are
|
cannam@95
|
120 computed and, consequently, a relatively expensive initialization of
|
cannam@95
|
121 this sort is acceptable. On the other hand, if you need a single
|
cannam@95
|
122 transform of a given size, the one-time cost of the planner becomes
|
cannam@95
|
123 significant. For this case, FFTW provides fast planners based on
|
cannam@95
|
124 heuristics or on previously computed plans.
|
cannam@95
|
125
|
cannam@95
|
126 <p>FFTW supports transforms of data with arbitrary length, rank,
|
cannam@95
|
127 multiplicity, and a general memory layout. In simple cases, however,
|
cannam@95
|
128 this generality may be unnecessary and confusing. Consequently, we
|
cannam@95
|
129 organized the interface to FFTW into three levels of increasing
|
cannam@95
|
130 generality.
|
cannam@95
|
131 <ul>
|
cannam@95
|
132 <li>The <dfn>basic interface</dfn> computes a single
|
cannam@95
|
133 transform of contiguous data.
|
cannam@95
|
134 <li>The <dfn>advanced interface</dfn> computes transforms
|
cannam@95
|
135 of multiple or strided arrays.
|
cannam@95
|
136 <li>The <dfn>guru interface</dfn> supports the most general data
|
cannam@95
|
137 layouts, multiplicities, and strides.
|
cannam@95
|
138 </ul>
|
cannam@95
|
139 We expect that most users will be best served by the basic interface,
|
cannam@95
|
140 whereas the guru interface requires careful attention to the
|
cannam@95
|
141 documentation to avoid problems.
|
cannam@95
|
142 <a name="index-basic-interface-7"></a><a name="index-advanced-interface-8"></a><a name="index-guru-interface-9"></a>
|
cannam@95
|
143
|
cannam@95
|
144 <p>Besides the automatic performance adaptation performed by the planner,
|
cannam@95
|
145 it is also possible for advanced users to customize FFTW manually. For
|
cannam@95
|
146 example, if code space is a concern, we provide a tool that links only
|
cannam@95
|
147 the subset of FFTW needed by your application. Conversely, you may need
|
cannam@95
|
148 to extend FFTW because the standard distribution is not sufficient for
|
cannam@95
|
149 your needs. For example, the standard FFTW distribution works most
|
cannam@95
|
150 efficiently for arrays whose size can be factored into small primes
|
cannam@95
|
151 (2, 3, 5, and 7), and otherwise it uses a
|
cannam@95
|
152 slower general-purpose routine. If you need efficient transforms of
|
cannam@95
|
153 other sizes, you can use FFTW's code generator, which produces fast C
|
cannam@95
|
154 programs (“codelets”) for any particular array size you may care
|
cannam@95
|
155 about.
|
cannam@95
|
156 <a name="index-code-generator-10"></a><a name="index-codelet-11"></a>For example, if you need transforms of size
|
cannam@95
|
157 513 = 19*3<sup>3</sup>,you can customize FFTW to support the factor 19 efficiently.
|
cannam@95
|
158
|
cannam@95
|
159 <p>For more information regarding FFTW, see the paper, “The Design and
|
cannam@95
|
160 Implementation of FFTW3,” by M. Frigo and S. G. Johnson, which was an
|
cannam@95
|
161 invited paper in <cite>Proc. IEEE</cite> <b>93</b> (2), p. 216 (2005). The
|
cannam@95
|
162 code generator is described in the paper “A fast Fourier transform
|
cannam@95
|
163 compiler”,
|
cannam@95
|
164 <a name="index-compiler-12"></a>by M. Frigo, in the <cite>Proceedings of the 1999 ACM SIGPLAN Conference
|
cannam@95
|
165 on Programming Language Design and Implementation (PLDI), Atlanta,
|
cannam@95
|
166 Georgia, May 1999</cite>. These papers, along with the latest version of
|
cannam@95
|
167 FFTW, the FAQ, benchmarks, and other links, are available at
|
cannam@95
|
168 <a href="http://www.fftw.org">the FFTW home page</a>.
|
cannam@95
|
169
|
cannam@95
|
170 <p>The current version of FFTW incorporates many good ideas from the past
|
cannam@95
|
171 thirty years of FFT literature. In one way or another, FFTW uses the
|
cannam@95
|
172 Cooley-Tukey algorithm, the prime factor algorithm, Rader's algorithm
|
cannam@95
|
173 for prime sizes, and a split-radix algorithm (with a
|
cannam@95
|
174 “conjugate-pair” variation pointed out to us by Dan Bernstein).
|
cannam@95
|
175 FFTW's code generator also produces new algorithms that we do not
|
cannam@95
|
176 completely understand.
|
cannam@95
|
177 <a name="index-algorithm-13"></a>The reader is referred to the cited papers for the appropriate
|
cannam@95
|
178 references.
|
cannam@95
|
179
|
cannam@95
|
180 <p>The rest of this manual is organized as follows. We first discuss the
|
cannam@95
|
181 sequential (single-processor) implementation. We start by describing
|
cannam@95
|
182 the basic interface/features of FFTW in <a href="Tutorial.html#Tutorial">Tutorial</a>.
|
cannam@95
|
183 Next, <a href="Other-Important-Topics.html#Other-Important-Topics">Other Important Topics</a> discusses data alignment
|
cannam@95
|
184 (see <a href="SIMD-alignment-and-fftw_005fmalloc.html#SIMD-alignment-and-fftw_005fmalloc">SIMD alignment and fftw_malloc</a>),
|
cannam@95
|
185 the storage scheme of multi-dimensional arrays
|
cannam@95
|
186 (see <a href="Multi_002ddimensional-Array-Format.html#Multi_002ddimensional-Array-Format">Multi-dimensional Array Format</a>), and FFTW's mechanism for
|
cannam@95
|
187 storing plans on disk (see <a href="Words-of-Wisdom_002dSaving-Plans.html#Words-of-Wisdom_002dSaving-Plans">Words of Wisdom-Saving Plans</a>). Next,
|
cannam@95
|
188 <a href="FFTW-Reference.html#FFTW-Reference">FFTW Reference</a> provides comprehensive documentation of all
|
cannam@95
|
189 FFTW's features. Parallel transforms are discussed in their own
|
cannam@95
|
190 chapters: <a href="Multi_002dthreaded-FFTW.html#Multi_002dthreaded-FFTW">Multi-threaded FFTW</a> and <a href="Distributed_002dmemory-FFTW-with-MPI.html#Distributed_002dmemory-FFTW-with-MPI">Distributed-memory FFTW with MPI</a>. Fortran programmers can also use FFTW, as described in
|
cannam@95
|
191 <a href="Calling-FFTW-from-Legacy-Fortran.html#Calling-FFTW-from-Legacy-Fortran">Calling FFTW from Legacy Fortran</a> and <a href="Calling-FFTW-from-Modern-Fortran.html#Calling-FFTW-from-Modern-Fortran">Calling FFTW from Modern Fortran</a>. <a href="Installation-and-Customization.html#Installation-and-Customization">Installation and Customization</a> explains how to
|
cannam@95
|
192 install FFTW in your computer system and how to adapt FFTW to your
|
cannam@95
|
193 needs. License and copyright information is given in <a href="License-and-Copyright.html#License-and-Copyright">License and Copyright</a>. Finally, we thank all the people who helped us in
|
cannam@95
|
194 <a href="Acknowledgments.html#Acknowledgments">Acknowledgments</a>.
|
cannam@95
|
195
|
cannam@95
|
196 </body></html>
|
cannam@95
|
197
|