cannam@127: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> cannam@127: <html> cannam@127: <!-- This manual is for FFTW cannam@127: (version 3.3.5, 30 July 2016). cannam@127: cannam@127: Copyright (C) 2003 Matteo Frigo. cannam@127: cannam@127: Copyright (C) 2003 Massachusetts Institute of Technology. cannam@127: cannam@127: Permission is granted to make and distribute verbatim copies of this cannam@127: manual provided the copyright notice and this permission notice are cannam@127: preserved on all copies. cannam@127: cannam@127: Permission is granted to copy and distribute modified versions of this cannam@127: manual under the conditions for verbatim copying, provided that the cannam@127: entire resulting derived work is distributed under the terms of a cannam@127: permission notice identical to this one. cannam@127: cannam@127: Permission is granted to copy and distribute translations of this manual cannam@127: into another language, under the above conditions for modified versions, cannam@127: except that this permission notice may be stated in a translation cannam@127: approved by the Free Software Foundation. --> cannam@127: <!-- Created by GNU Texinfo 5.2, http://www.gnu.org/software/texinfo/ --> cannam@127: <head> cannam@127: <title>FFTW 3.3.5: Introduction</title> cannam@127: cannam@127: <meta name="description" content="FFTW 3.3.5: Introduction"> cannam@127: <meta name="keywords" content="FFTW 3.3.5: Introduction"> cannam@127: <meta name="resource-type" content="document"> cannam@127: <meta name="distribution" content="global"> cannam@127: <meta name="Generator" content="makeinfo"> cannam@127: <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> cannam@127: <link href="index.html#Top" rel="start" title="Top"> cannam@127: <link href="Concept-Index.html#Concept-Index" rel="index" title="Concept Index"> cannam@127: <link href="index.html#SEC_Contents" rel="contents" title="Table of Contents"> cannam@127: <link href="index.html#Top" rel="up" title="Top"> cannam@127: <link href="Tutorial.html#Tutorial" rel="next" title="Tutorial"> cannam@127: <link href="index.html#Top" rel="prev" title="Top"> cannam@127: <style type="text/css"> cannam@127: <!-- cannam@127: a.summary-letter {text-decoration: none} cannam@127: blockquote.smallquotation {font-size: smaller} cannam@127: div.display {margin-left: 3.2em} cannam@127: div.example {margin-left: 3.2em} cannam@127: div.indentedblock {margin-left: 3.2em} cannam@127: div.lisp {margin-left: 3.2em} cannam@127: div.smalldisplay {margin-left: 3.2em} cannam@127: div.smallexample {margin-left: 3.2em} cannam@127: div.smallindentedblock {margin-left: 3.2em; font-size: smaller} cannam@127: div.smalllisp {margin-left: 3.2em} cannam@127: kbd {font-style:oblique} cannam@127: pre.display {font-family: inherit} cannam@127: pre.format {font-family: inherit} cannam@127: pre.menu-comment {font-family: serif} cannam@127: pre.menu-preformatted {font-family: serif} cannam@127: pre.smalldisplay {font-family: inherit; font-size: smaller} cannam@127: pre.smallexample {font-size: smaller} cannam@127: pre.smallformat {font-family: inherit; font-size: smaller} cannam@127: pre.smalllisp {font-size: smaller} cannam@127: span.nocodebreak {white-space:nowrap} cannam@127: span.nolinebreak {white-space:nowrap} cannam@127: span.roman {font-family:serif; font-weight:normal} cannam@127: span.sansserif {font-family:sans-serif; font-weight:normal} cannam@127: ul.no-bullet {list-style: none} cannam@127: --> cannam@127: </style> cannam@127: cannam@127: cannam@127: </head> cannam@127: cannam@127: <body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000"> cannam@127: <a name="Introduction"></a> cannam@127: <div class="header"> cannam@127: <p> cannam@127: Next: <a href="Tutorial.html#Tutorial" accesskey="n" rel="next">Tutorial</a>, Previous: <a href="index.html#Top" accesskey="p" rel="prev">Top</a>, Up: <a href="index.html#Top" accesskey="u" rel="up">Top</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html#Concept-Index" title="Index" rel="index">Index</a>]</p> cannam@127: </div> cannam@127: <hr> cannam@127: <a name="Introduction-1"></a> cannam@127: <h2 class="chapter">1 Introduction</h2> cannam@127: <p>This manual documents version 3.3.5 of FFTW, the cannam@127: <em>Fastest Fourier Transform in the West</em>. FFTW is a comprehensive cannam@127: collection of fast C routines for computing the discrete Fourier cannam@127: transform (DFT) and various special cases thereof. cannam@127: <a name="index-discrete-Fourier-transform"></a> cannam@127: <a name="index-DFT"></a> cannam@127: </p><ul> cannam@127: <li> FFTW computes the DFT of complex data, real data, even- cannam@127: or odd-symmetric real data (these symmetric transforms are usually cannam@127: known as the discrete cosine or sine transform, respectively), and the cannam@127: discrete Hartley transform (DHT) of real data. cannam@127: cannam@127: </li><li> The input data can have arbitrary length. cannam@127: FFTW employs <i>O</i>(<i>n</i> log <i>n</i>) algorithms for all lengths, including cannam@127: prime numbers. cannam@127: cannam@127: </li><li> FFTW supports arbitrary multi-dimensional data. cannam@127: cannam@127: </li><li> FFTW supports the SSE, SSE2, AVX, AVX2, AVX512, KCVI, Altivec, VSX, and cannam@127: NEON vector instruction sets. cannam@127: cannam@127: </li><li> FFTW includes parallel (multi-threaded) transforms cannam@127: for shared-memory systems. cannam@127: </li><li> Starting with version 3.3, FFTW includes distributed-memory parallel cannam@127: transforms using MPI. cannam@127: </li></ul> cannam@127: cannam@127: <p>We assume herein that you are familiar with the properties and uses of cannam@127: the DFT that are relevant to your application. Otherwise, see cannam@127: e.g. <cite>The Fast Fourier Transform and Its Applications</cite> by E. O. Brigham cannam@127: (Prentice-Hall, Englewood Cliffs, NJ, 1988). cannam@127: <a href="http://www.fftw.org">Our web page</a> also has links to FFT-related cannam@127: information online. cannam@127: <a name="index-FFTW"></a> cannam@127: </p> cannam@127: cannam@127: <p>In order to use FFTW effectively, you need to learn one basic concept cannam@127: of FFTW’s internal structure: FFTW does not use a fixed algorithm for cannam@127: computing the transform, but instead it adapts the DFT algorithm to cannam@127: details of the underlying hardware in order to maximize performance. cannam@127: Hence, the computation of the transform is split into two phases. cannam@127: First, FFTW’s <em>planner</em> “learns” the fastest way to compute the cannam@127: transform on your machine. The planner cannam@127: <a name="index-planner"></a> cannam@127: produces a data structure called a <em>plan</em> that contains this cannam@127: <a name="index-plan"></a> cannam@127: information. Subsequently, the plan is <em>executed</em> cannam@127: <a name="index-execute"></a> cannam@127: to transform the array of input data as dictated by the plan. The cannam@127: plan can be reused as many times as needed. In typical cannam@127: high-performance applications, many transforms of the same size are cannam@127: computed and, consequently, a relatively expensive initialization of cannam@127: this sort is acceptable. On the other hand, if you need a single cannam@127: transform of a given size, the one-time cost of the planner becomes cannam@127: significant. For this case, FFTW provides fast planners based on cannam@127: heuristics or on previously computed plans. cannam@127: </p> cannam@127: <p>FFTW supports transforms of data with arbitrary length, rank, cannam@127: multiplicity, and a general memory layout. In simple cases, however, cannam@127: this generality may be unnecessary and confusing. Consequently, we cannam@127: organized the interface to FFTW into three levels of increasing cannam@127: generality. cannam@127: </p><ul> cannam@127: <li> The <em>basic interface</em> computes a single cannam@127: transform of contiguous data. cannam@127: </li><li> The <em>advanced interface</em> computes transforms cannam@127: of multiple or strided arrays. cannam@127: </li><li> The <em>guru interface</em> supports the most general data cannam@127: layouts, multiplicities, and strides. cannam@127: </li></ul> cannam@127: <p>We expect that most users will be best served by the basic interface, cannam@127: whereas the guru interface requires careful attention to the cannam@127: documentation to avoid problems. cannam@127: <a name="index-basic-interface"></a> cannam@127: <a name="index-advanced-interface"></a> cannam@127: <a name="index-guru-interface"></a> cannam@127: </p> cannam@127: cannam@127: <p>Besides the automatic performance adaptation performed by the planner, cannam@127: it is also possible for advanced users to customize FFTW manually. For cannam@127: example, if code space is a concern, we provide a tool that links only cannam@127: the subset of FFTW needed by your application. Conversely, you may need cannam@127: to extend FFTW because the standard distribution is not sufficient for cannam@127: your needs. For example, the standard FFTW distribution works most cannam@127: efficiently for arrays whose size can be factored into small primes cannam@127: (<em>2</em>, <em>3</em>, <em>5</em>, and <em>7</em>), and otherwise it uses a cannam@127: slower general-purpose routine. If you need efficient transforms of cannam@127: other sizes, you can use FFTW’s code generator, which produces fast C cannam@127: programs (“codelets”) for any particular array size you may care cannam@127: about. cannam@127: <a name="index-code-generator"></a> cannam@127: <a name="index-codelet"></a> cannam@127: For example, if you need transforms of size cannam@127: 513 = 19*3<sup>3</sup>,you can customize FFTW to support the factor <em>19</em> efficiently. cannam@127: </p> cannam@127: <p>For more information regarding FFTW, see the paper, “The Design and cannam@127: Implementation of FFTW3,” by M. Frigo and S. G. Johnson, which was an cannam@127: invited paper in <cite>Proc. IEEE</cite> <b>93</b> (2), p. 216 (2005). The cannam@127: code generator is described in the paper “A fast Fourier transform cannam@127: compiler”, cannam@127: <a name="index-compiler"></a> cannam@127: by M. Frigo, in the <cite>Proceedings of the 1999 ACM SIGPLAN Conference cannam@127: on Programming Language Design and Implementation (PLDI), Atlanta, cannam@127: Georgia, May 1999</cite>. These papers, along with the latest version of cannam@127: FFTW, the FAQ, benchmarks, and other links, are available at cannam@127: <a href="http://www.fftw.org">the FFTW home page</a>. cannam@127: </p> cannam@127: <p>The current version of FFTW incorporates many good ideas from the past cannam@127: thirty years of FFT literature. In one way or another, FFTW uses the cannam@127: Cooley-Tukey algorithm, the prime factor algorithm, Rader’s algorithm cannam@127: for prime sizes, and a split-radix algorithm (with a cannam@127: “conjugate-pair” variation pointed out to us by Dan Bernstein). cannam@127: FFTW’s code generator also produces new algorithms that we do not cannam@127: completely understand. cannam@127: <a name="index-algorithm"></a> cannam@127: The reader is referred to the cited papers for the appropriate cannam@127: references. cannam@127: </p> cannam@127: <p>The rest of this manual is organized as follows. We first discuss the cannam@127: sequential (single-processor) implementation. We start by describing cannam@127: the basic interface/features of FFTW in <a href="Tutorial.html#Tutorial">Tutorial</a>. cannam@127: Next, <a href="Other-Important-Topics.html#Other-Important-Topics">Other Important Topics</a> discusses data alignment cannam@127: (see <a href="SIMD-alignment-and-fftw_005fmalloc.html#SIMD-alignment-and-fftw_005fmalloc">SIMD alignment and fftw_malloc</a>), cannam@127: the storage scheme of multi-dimensional arrays cannam@127: (see <a href="Multi_002ddimensional-Array-Format.html#Multi_002ddimensional-Array-Format">Multi-dimensional Array Format</a>), and FFTW’s mechanism for cannam@127: 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@127: <a href="FFTW-Reference.html#FFTW-Reference">FFTW Reference</a> provides comprehensive documentation of all cannam@127: FFTW’s features. Parallel transforms are discussed in their own cannam@127: 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@127: <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@127: install FFTW in your computer system and how to adapt FFTW to your cannam@127: 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@127: <a href="Acknowledgments.html#Acknowledgments">Acknowledgments</a>. cannam@127: </p> cannam@127: <hr> cannam@127: <div class="header"> cannam@127: <p> cannam@127: Next: <a href="Tutorial.html#Tutorial" accesskey="n" rel="next">Tutorial</a>, Previous: <a href="index.html#Top" accesskey="p" rel="prev">Top</a>, Up: <a href="index.html#Top" accesskey="u" rel="up">Top</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html#Concept-Index" title="Index" rel="index">Index</a>]</p> cannam@127: </div> cannam@127: cannam@127: cannam@127: cannam@127: </body> cannam@127: </html>