annotate fft/fftw/fftw-3.3.4/doc/html/Complex-Multi_002dDimensional-DFTs.html @ 40:223f770b5341 kissfft-double tip

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