annotate src/fftw-3.3.3/doc/html/Advanced-Complex-DFTs.html @ 10:37bf6b4a2645

Add FFTW3
author Chris Cannam
date Wed, 20 Mar 2013 15:35:50 +0000
parents
children
rev   line source
Chris@10 1 <html lang="en">
Chris@10 2 <head>
Chris@10 3 <title>Advanced Complex DFTs - FFTW 3.3.3</title>
Chris@10 4 <meta http-equiv="Content-Type" content="text/html">
Chris@10 5 <meta name="description" content="FFTW 3.3.3">
Chris@10 6 <meta name="generator" content="makeinfo 4.13">
Chris@10 7 <link title="Top" rel="start" href="index.html#Top">
Chris@10 8 <link rel="up" href="Advanced-Interface.html#Advanced-Interface" title="Advanced Interface">
Chris@10 9 <link rel="prev" href="Advanced-Interface.html#Advanced-Interface" title="Advanced Interface">
Chris@10 10 <link rel="next" href="Advanced-Real_002ddata-DFTs.html#Advanced-Real_002ddata-DFTs" title="Advanced Real-data DFTs">
Chris@10 11 <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
Chris@10 12 <!--
Chris@10 13 This manual is for FFTW
Chris@10 14 (version 3.3.3, 25 November 2012).
Chris@10 15
Chris@10 16 Copyright (C) 2003 Matteo Frigo.
Chris@10 17
Chris@10 18 Copyright (C) 2003 Massachusetts Institute of Technology.
Chris@10 19
Chris@10 20 Permission is granted to make and distribute verbatim copies of
Chris@10 21 this manual provided the copyright notice and this permission
Chris@10 22 notice are preserved on all copies.
Chris@10 23
Chris@10 24 Permission is granted to copy and distribute modified versions of
Chris@10 25 this manual under the conditions for verbatim copying, provided
Chris@10 26 that the entire resulting derived work is distributed under the
Chris@10 27 terms of a permission notice identical to this one.
Chris@10 28
Chris@10 29 Permission is granted to copy and distribute translations of this
Chris@10 30 manual into another language, under the above conditions for
Chris@10 31 modified versions, except that this permission notice may be
Chris@10 32 stated in a translation approved by the Free Software Foundation.
Chris@10 33 -->
Chris@10 34 <meta http-equiv="Content-Style-Type" content="text/css">
Chris@10 35 <style type="text/css"><!--
Chris@10 36 pre.display { font-family:inherit }
Chris@10 37 pre.format { font-family:inherit }
Chris@10 38 pre.smalldisplay { font-family:inherit; font-size:smaller }
Chris@10 39 pre.smallformat { font-family:inherit; font-size:smaller }
Chris@10 40 pre.smallexample { font-size:smaller }
Chris@10 41 pre.smalllisp { font-size:smaller }
Chris@10 42 span.sc { font-variant:small-caps }
Chris@10 43 span.roman { font-family:serif; font-weight:normal; }
Chris@10 44 span.sansserif { font-family:sans-serif; font-weight:normal; }
Chris@10 45 --></style>
Chris@10 46 </head>
Chris@10 47 <body>
Chris@10 48 <div class="node">
Chris@10 49 <a name="Advanced-Complex-DFTs"></a>
Chris@10 50 <p>
Chris@10 51 Next:&nbsp;<a rel="next" accesskey="n" href="Advanced-Real_002ddata-DFTs.html#Advanced-Real_002ddata-DFTs">Advanced Real-data DFTs</a>,
Chris@10 52 Previous:&nbsp;<a rel="previous" accesskey="p" href="Advanced-Interface.html#Advanced-Interface">Advanced Interface</a>,
Chris@10 53 Up:&nbsp;<a rel="up" accesskey="u" href="Advanced-Interface.html#Advanced-Interface">Advanced Interface</a>
Chris@10 54 <hr>
Chris@10 55 </div>
Chris@10 56
Chris@10 57 <h4 class="subsection">4.4.1 Advanced Complex DFTs</h4>
Chris@10 58
Chris@10 59 <pre class="example"> fftw_plan fftw_plan_many_dft(int rank, const int *n, int howmany,
Chris@10 60 fftw_complex *in, const int *inembed,
Chris@10 61 int istride, int idist,
Chris@10 62 fftw_complex *out, const int *onembed,
Chris@10 63 int ostride, int odist,
Chris@10 64 int sign, unsigned flags);
Chris@10 65 </pre>
Chris@10 66 <p><a name="index-fftw_005fplan_005fmany_005fdft-232"></a>
Chris@10 67 This routine plans multiple multidimensional complex DFTs, and it
Chris@10 68 extends the <code>fftw_plan_dft</code> routine (see <a href="Complex-DFTs.html#Complex-DFTs">Complex DFTs</a>) to
Chris@10 69 compute <code>howmany</code> transforms, each having rank <code>rank</code> and size
Chris@10 70 <code>n</code>. In addition, the transform data need not be contiguous, but
Chris@10 71 it may be laid out in memory with an arbitrary stride. To account for
Chris@10 72 these possibilities, <code>fftw_plan_many_dft</code> adds the new parameters
Chris@10 73 <code>howmany</code>, {<code>i</code>,<code>o</code>}<code>nembed</code>,
Chris@10 74 {<code>i</code>,<code>o</code>}<code>stride</code>, and
Chris@10 75 {<code>i</code>,<code>o</code>}<code>dist</code>. The FFTW basic interface
Chris@10 76 (see <a href="Complex-DFTs.html#Complex-DFTs">Complex DFTs</a>) provides routines specialized for ranks 1, 2,
Chris@10 77 and&nbsp;3, but the advanced interface handles only the general-rank
Chris@10 78 case.
Chris@10 79
Chris@10 80 <p><code>howmany</code> is the number of transforms to compute. The resulting
Chris@10 81 plan computes <code>howmany</code> transforms, where the input of the
Chris@10 82 <code>k</code>-th transform is at location <code>in+k*idist</code> (in C pointer
Chris@10 83 arithmetic), and its output is at location <code>out+k*odist</code>. Plans
Chris@10 84 obtained in this way can often be faster than calling FFTW multiple
Chris@10 85 times for the individual transforms. The basic <code>fftw_plan_dft</code>
Chris@10 86 interface corresponds to <code>howmany=1</code> (in which case the <code>dist</code>
Chris@10 87 parameters are ignored).
Chris@10 88 <a name="index-howmany-parameter-233"></a><a name="index-dist-234"></a>
Chris@10 89
Chris@10 90 <p>Each of the <code>howmany</code> transforms has rank <code>rank</code> and size
Chris@10 91 <code>n</code>, as in the basic interface. In addition, the advanced
Chris@10 92 interface allows the input and output arrays of each transform to be
Chris@10 93 row-major subarrays of larger rank-<code>rank</code> arrays, described by
Chris@10 94 <code>inembed</code> and <code>onembed</code> parameters, respectively.
Chris@10 95 {<code>i</code>,<code>o</code>}<code>nembed</code> must be arrays of length <code>rank</code>,
Chris@10 96 and <code>n</code> should be elementwise less than or equal to
Chris@10 97 {<code>i</code>,<code>o</code>}<code>nembed</code>. Passing <code>NULL</code> for an
Chris@10 98 <code>nembed</code> parameter is equivalent to passing <code>n</code> (i.e. same
Chris@10 99 physical and logical dimensions, as in the basic interface.)
Chris@10 100
Chris@10 101 <p>The <code>stride</code> parameters indicate that the <code>j</code>-th element of
Chris@10 102 the input or output arrays is located at <code>j*istride</code> or
Chris@10 103 <code>j*ostride</code>, respectively. (For a multi-dimensional array,
Chris@10 104 <code>j</code> is the ordinary row-major index.) When combined with the
Chris@10 105 <code>k</code>-th transform in a <code>howmany</code> loop, from above, this means
Chris@10 106 that the (<code>j</code>,<code>k</code>)-th element is at <code>j*stride+k*dist</code>.
Chris@10 107 (The basic <code>fftw_plan_dft</code> interface corresponds to a stride of 1.)
Chris@10 108 <a name="index-stride-235"></a>
Chris@10 109
Chris@10 110 <p>For in-place transforms, the input and output <code>stride</code> and
Chris@10 111 <code>dist</code> parameters should be the same; otherwise, the planner may
Chris@10 112 return <code>NULL</code>.
Chris@10 113
Chris@10 114 <p>Arrays <code>n</code>, <code>inembed</code>, and <code>onembed</code> are not used after
Chris@10 115 this function returns. You can safely free or reuse them.
Chris@10 116
Chris@10 117 <p><strong>Examples</strong>:
Chris@10 118 One transform of one 5 by 6 array contiguous in memory:
Chris@10 119 <pre class="example"> int rank = 2;
Chris@10 120 int n[] = {5, 6};
Chris@10 121 int howmany = 1;
Chris@10 122 int idist = odist = 0; /* unused because howmany = 1 */
Chris@10 123 int istride = ostride = 1; /* array is contiguous in memory */
Chris@10 124 int *inembed = n, *onembed = n;
Chris@10 125 </pre>
Chris@10 126 <p>Transform of three 5 by 6 arrays, each contiguous in memory,
Chris@10 127 stored in memory one after another:
Chris@10 128 <pre class="example"> int rank = 2;
Chris@10 129 int n[] = {5, 6};
Chris@10 130 int howmany = 3;
Chris@10 131 int idist = odist = n[0]*n[1]; /* = 30, the distance in memory
Chris@10 132 between the first element
Chris@10 133 of the first array and the
Chris@10 134 first element of the second array */
Chris@10 135 int istride = ostride = 1; /* array is contiguous in memory */
Chris@10 136 int *inembed = n, *onembed = n;
Chris@10 137 </pre>
Chris@10 138 <p>Transform each column of a 2d array with 10 rows and 3 columns:
Chris@10 139 <pre class="example"> int rank = 1; /* not 2: we are computing 1d transforms */
Chris@10 140 int n[] = {10}; /* 1d transforms of length 10 */
Chris@10 141 int howmany = 3;
Chris@10 142 int idist = odist = 1;
Chris@10 143 int istride = ostride = 3; /* distance between two elements in
Chris@10 144 the same column */
Chris@10 145 int *inembed = n, *onembed = n;
Chris@10 146 </pre>
Chris@10 147 <!-- =========> -->
Chris@10 148 </body></html>
Chris@10 149