annotate src/fftw-3.3.3/doc/html/Complex-Multi_002dDimensional-DFTs.html @ 95:89f5e221ed7b

Add FFTW3
author Chris Cannam <cannam@all-day-breakfast.com>
date Wed, 20 Mar 2013 15:35:50 +0000
parents
children
rev   line source
cannam@95 1 <html lang="en">
cannam@95 2 <head>
cannam@95 3 <title>Complex Multi-Dimensional DFTs - 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="up" href="Tutorial.html#Tutorial" title="Tutorial">
cannam@95 9 <link rel="prev" href="Complex-One_002dDimensional-DFTs.html#Complex-One_002dDimensional-DFTs" title="Complex One-Dimensional DFTs">
cannam@95 10 <link rel="next" href="One_002dDimensional-DFTs-of-Real-Data.html#One_002dDimensional-DFTs-of-Real-Data" title="One-Dimensional DFTs of Real Data">
cannam@95 11 <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
cannam@95 12 <!--
cannam@95 13 This manual is for FFTW
cannam@95 14 (version 3.3.3, 25 November 2012).
cannam@95 15
cannam@95 16 Copyright (C) 2003 Matteo Frigo.
cannam@95 17
cannam@95 18 Copyright (C) 2003 Massachusetts Institute of Technology.
cannam@95 19
cannam@95 20 Permission is granted to make and distribute verbatim copies of
cannam@95 21 this manual provided the copyright notice and this permission
cannam@95 22 notice are preserved on all copies.
cannam@95 23
cannam@95 24 Permission is granted to copy and distribute modified versions of
cannam@95 25 this manual under the conditions for verbatim copying, provided
cannam@95 26 that the entire resulting derived work is distributed under the
cannam@95 27 terms of a permission notice identical to this one.
cannam@95 28
cannam@95 29 Permission is granted to copy and distribute translations of this
cannam@95 30 manual into another language, under the above conditions for
cannam@95 31 modified versions, except that this permission notice may be
cannam@95 32 stated in a translation approved by the Free Software Foundation.
cannam@95 33 -->
cannam@95 34 <meta http-equiv="Content-Style-Type" content="text/css">
cannam@95 35 <style type="text/css"><!--
cannam@95 36 pre.display { font-family:inherit }
cannam@95 37 pre.format { font-family:inherit }
cannam@95 38 pre.smalldisplay { font-family:inherit; font-size:smaller }
cannam@95 39 pre.smallformat { font-family:inherit; font-size:smaller }
cannam@95 40 pre.smallexample { font-size:smaller }
cannam@95 41 pre.smalllisp { font-size:smaller }
cannam@95 42 span.sc { font-variant:small-caps }
cannam@95 43 span.roman { font-family:serif; font-weight:normal; }
cannam@95 44 span.sansserif { font-family:sans-serif; font-weight:normal; }
cannam@95 45 --></style>
cannam@95 46 </head>
cannam@95 47 <body>
cannam@95 48 <div class="node">
cannam@95 49 <a name="Complex-Multi-Dimensional-DFTs"></a>
cannam@95 50 <a name="Complex-Multi_002dDimensional-DFTs"></a>
cannam@95 51 <p>
cannam@95 52 Next:&nbsp;<a rel="next" accesskey="n" href="One_002dDimensional-DFTs-of-Real-Data.html#One_002dDimensional-DFTs-of-Real-Data">One-Dimensional DFTs of Real Data</a>,
cannam@95 53 Previous:&nbsp;<a rel="previous" accesskey="p" href="Complex-One_002dDimensional-DFTs.html#Complex-One_002dDimensional-DFTs">Complex One-Dimensional DFTs</a>,
cannam@95 54 Up:&nbsp;<a rel="up" accesskey="u" href="Tutorial.html#Tutorial">Tutorial</a>
cannam@95 55 <hr>
cannam@95 56 </div>
cannam@95 57
cannam@95 58 <h3 class="section">2.2 Complex Multi-Dimensional DFTs</h3>
cannam@95 59
cannam@95 60 <p>Multi-dimensional transforms work much the same way as one-dimensional
cannam@95 61 transforms: you allocate arrays of <code>fftw_complex</code> (preferably
cannam@95 62 using <code>fftw_malloc</code>), create an <code>fftw_plan</code>, execute it as
cannam@95 63 many times as you want with <code>fftw_execute(plan)</code>, and clean up
cannam@95 64 with <code>fftw_destroy_plan(plan)</code> (and <code>fftw_free</code>).
cannam@95 65
cannam@95 66 <p>FFTW provides two routines for creating plans for 2d and 3d transforms,
cannam@95 67 and one routine for creating plans of arbitrary dimensionality.
cannam@95 68 The 2d and 3d routines have the following signature:
cannam@95 69 <pre class="example"> fftw_plan fftw_plan_dft_2d(int n0, int n1,
cannam@95 70 fftw_complex *in, fftw_complex *out,
cannam@95 71 int sign, unsigned flags);
cannam@95 72 fftw_plan fftw_plan_dft_3d(int n0, int n1, int n2,
cannam@95 73 fftw_complex *in, fftw_complex *out,
cannam@95 74 int sign, unsigned flags);
cannam@95 75 </pre>
cannam@95 76 <p><a name="index-fftw_005fplan_005fdft_005f2d-39"></a><a name="index-fftw_005fplan_005fdft_005f3d-40"></a>
cannam@95 77 These routines create plans for <code>n0</code> by <code>n1</code> two-dimensional
cannam@95 78 (2d) transforms and <code>n0</code> by <code>n1</code> by <code>n2</code> 3d transforms,
cannam@95 79 respectively. All of these transforms operate on contiguous arrays in
cannam@95 80 the C-standard <dfn>row-major</dfn> order, so that the last dimension has the
cannam@95 81 fastest-varying index in the array. This layout is described further in
cannam@95 82 <a href="Multi_002ddimensional-Array-Format.html#Multi_002ddimensional-Array-Format">Multi-dimensional Array Format</a>.
cannam@95 83
cannam@95 84 <p>FFTW can also compute transforms of higher dimensionality. In order to
cannam@95 85 avoid confusion between the various meanings of the the word
cannam@95 86 &ldquo;dimension&rdquo;, we use the term <em>rank</em>
cannam@95 87 <a name="index-rank-41"></a>to denote the number of independent indices in an array.<a rel="footnote" href="#fn-1" name="fnd-1"><sup>1</sup></a> For
cannam@95 88 example, we say that a 2d transform has rank&nbsp;2, a 3d transform has
cannam@95 89 rank&nbsp;3, and so on. You can plan transforms of arbitrary rank by
cannam@95 90 means of the following function:
cannam@95 91
cannam@95 92 <pre class="example"> fftw_plan fftw_plan_dft(int rank, const int *n,
cannam@95 93 fftw_complex *in, fftw_complex *out,
cannam@95 94 int sign, unsigned flags);
cannam@95 95 </pre>
cannam@95 96 <p><a name="index-fftw_005fplan_005fdft-42"></a>
cannam@95 97 Here, <code>n</code> is a pointer to an array <code>n[rank]</code> denoting an
cannam@95 98 <code>n[0]</code> by <code>n[1]</code> by <small class="dots">...</small> by <code>n[rank-1]</code> transform.
cannam@95 99 Thus, for example, the call
cannam@95 100 <pre class="example"> fftw_plan_dft_2d(n0, n1, in, out, sign, flags);
cannam@95 101 </pre>
cannam@95 102 <p>is equivalent to the following code fragment:
cannam@95 103 <pre class="example"> int n[2];
cannam@95 104 n[0] = n0;
cannam@95 105 n[1] = n1;
cannam@95 106 fftw_plan_dft(2, n, in, out, sign, flags);
cannam@95 107 </pre>
cannam@95 108 <p><code>fftw_plan_dft</code> is not restricted to 2d and 3d transforms,
cannam@95 109 however, but it can plan transforms of arbitrary rank.
cannam@95 110
cannam@95 111 <p>You may have noticed that all the planner routines described so far
cannam@95 112 have overlapping functionality. For example, you can plan a 1d or 2d
cannam@95 113 transform by using <code>fftw_plan_dft</code> with a <code>rank</code> of <code>1</code>
cannam@95 114 or <code>2</code>, or even by calling <code>fftw_plan_dft_3d</code> with <code>n0</code>
cannam@95 115 and/or <code>n1</code> equal to <code>1</code> (with no loss in efficiency). This
cannam@95 116 pattern continues, and FFTW's planning routines in general form a
cannam@95 117 &ldquo;partial order,&rdquo; sequences of
cannam@95 118 <a name="index-partial-order-43"></a>interfaces with strictly increasing generality but correspondingly
cannam@95 119 greater complexity.
cannam@95 120
cannam@95 121 <p><code>fftw_plan_dft</code> is the most general complex-DFT routine that we
cannam@95 122 describe in this tutorial, but there are also the advanced and guru interfaces,
cannam@95 123 <a name="index-advanced-interface-44"></a><a name="index-guru-interface-45"></a>which allow one to efficiently combine multiple/strided transforms
cannam@95 124 into a single FFTW plan, transform a subset of a larger
cannam@95 125 multi-dimensional array, and/or to handle more general complex-number
cannam@95 126 formats. For more information, see <a href="FFTW-Reference.html#FFTW-Reference">FFTW Reference</a>.
cannam@95 127
cannam@95 128 <!-- -->
cannam@95 129 <div class="footnote">
cannam@95 130 <hr>
cannam@95 131 <h4>Footnotes</h4><p class="footnote"><small>[<a name="fn-1" href="#fnd-1">1</a>]</small> The
cannam@95 132 term &ldquo;rank&rdquo; is commonly used in the APL, FORTRAN, and Common Lisp
cannam@95 133 traditions, although it is not so common in the C&nbsp;world.</p>
cannam@95 134
cannam@95 135 <hr></div>
cannam@95 136
cannam@95 137 </body></html>
cannam@95 138