annotate src/fftw-3.3.3/doc/html/Advanced-Complex-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>Advanced Complex 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="Advanced-Interface.html#Advanced-Interface" title="Advanced Interface">
cannam@95 9 <link rel="prev" href="Advanced-Interface.html#Advanced-Interface" title="Advanced Interface">
cannam@95 10 <link rel="next" href="Advanced-Real_002ddata-DFTs.html#Advanced-Real_002ddata-DFTs" title="Advanced Real-data DFTs">
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="Advanced-Complex-DFTs"></a>
cannam@95 50 <p>
cannam@95 51 Next:&nbsp;<a rel="next" accesskey="n" href="Advanced-Real_002ddata-DFTs.html#Advanced-Real_002ddata-DFTs">Advanced Real-data DFTs</a>,
cannam@95 52 Previous:&nbsp;<a rel="previous" accesskey="p" href="Advanced-Interface.html#Advanced-Interface">Advanced Interface</a>,
cannam@95 53 Up:&nbsp;<a rel="up" accesskey="u" href="Advanced-Interface.html#Advanced-Interface">Advanced Interface</a>
cannam@95 54 <hr>
cannam@95 55 </div>
cannam@95 56
cannam@95 57 <h4 class="subsection">4.4.1 Advanced Complex DFTs</h4>
cannam@95 58
cannam@95 59 <pre class="example"> fftw_plan fftw_plan_many_dft(int rank, const int *n, int howmany,
cannam@95 60 fftw_complex *in, const int *inembed,
cannam@95 61 int istride, int idist,
cannam@95 62 fftw_complex *out, const int *onembed,
cannam@95 63 int ostride, int odist,
cannam@95 64 int sign, unsigned flags);
cannam@95 65 </pre>
cannam@95 66 <p><a name="index-fftw_005fplan_005fmany_005fdft-232"></a>
cannam@95 67 This routine plans multiple multidimensional complex DFTs, and it
cannam@95 68 extends the <code>fftw_plan_dft</code> routine (see <a href="Complex-DFTs.html#Complex-DFTs">Complex DFTs</a>) to
cannam@95 69 compute <code>howmany</code> transforms, each having rank <code>rank</code> and size
cannam@95 70 <code>n</code>. In addition, the transform data need not be contiguous, but
cannam@95 71 it may be laid out in memory with an arbitrary stride. To account for
cannam@95 72 these possibilities, <code>fftw_plan_many_dft</code> adds the new parameters
cannam@95 73 <code>howmany</code>, {<code>i</code>,<code>o</code>}<code>nembed</code>,
cannam@95 74 {<code>i</code>,<code>o</code>}<code>stride</code>, and
cannam@95 75 {<code>i</code>,<code>o</code>}<code>dist</code>. The FFTW basic interface
cannam@95 76 (see <a href="Complex-DFTs.html#Complex-DFTs">Complex DFTs</a>) provides routines specialized for ranks 1, 2,
cannam@95 77 and&nbsp;3, but the advanced interface handles only the general-rank
cannam@95 78 case.
cannam@95 79
cannam@95 80 <p><code>howmany</code> is the number of transforms to compute. The resulting
cannam@95 81 plan computes <code>howmany</code> transforms, where the input of the
cannam@95 82 <code>k</code>-th transform is at location <code>in+k*idist</code> (in C pointer
cannam@95 83 arithmetic), and its output is at location <code>out+k*odist</code>. Plans
cannam@95 84 obtained in this way can often be faster than calling FFTW multiple
cannam@95 85 times for the individual transforms. The basic <code>fftw_plan_dft</code>
cannam@95 86 interface corresponds to <code>howmany=1</code> (in which case the <code>dist</code>
cannam@95 87 parameters are ignored).
cannam@95 88 <a name="index-howmany-parameter-233"></a><a name="index-dist-234"></a>
cannam@95 89
cannam@95 90 <p>Each of the <code>howmany</code> transforms has rank <code>rank</code> and size
cannam@95 91 <code>n</code>, as in the basic interface. In addition, the advanced
cannam@95 92 interface allows the input and output arrays of each transform to be
cannam@95 93 row-major subarrays of larger rank-<code>rank</code> arrays, described by
cannam@95 94 <code>inembed</code> and <code>onembed</code> parameters, respectively.
cannam@95 95 {<code>i</code>,<code>o</code>}<code>nembed</code> must be arrays of length <code>rank</code>,
cannam@95 96 and <code>n</code> should be elementwise less than or equal to
cannam@95 97 {<code>i</code>,<code>o</code>}<code>nembed</code>. Passing <code>NULL</code> for an
cannam@95 98 <code>nembed</code> parameter is equivalent to passing <code>n</code> (i.e. same
cannam@95 99 physical and logical dimensions, as in the basic interface.)
cannam@95 100
cannam@95 101 <p>The <code>stride</code> parameters indicate that the <code>j</code>-th element of
cannam@95 102 the input or output arrays is located at <code>j*istride</code> or
cannam@95 103 <code>j*ostride</code>, respectively. (For a multi-dimensional array,
cannam@95 104 <code>j</code> is the ordinary row-major index.) When combined with the
cannam@95 105 <code>k</code>-th transform in a <code>howmany</code> loop, from above, this means
cannam@95 106 that the (<code>j</code>,<code>k</code>)-th element is at <code>j*stride+k*dist</code>.
cannam@95 107 (The basic <code>fftw_plan_dft</code> interface corresponds to a stride of 1.)
cannam@95 108 <a name="index-stride-235"></a>
cannam@95 109
cannam@95 110 <p>For in-place transforms, the input and output <code>stride</code> and
cannam@95 111 <code>dist</code> parameters should be the same; otherwise, the planner may
cannam@95 112 return <code>NULL</code>.
cannam@95 113
cannam@95 114 <p>Arrays <code>n</code>, <code>inembed</code>, and <code>onembed</code> are not used after
cannam@95 115 this function returns. You can safely free or reuse them.
cannam@95 116
cannam@95 117 <p><strong>Examples</strong>:
cannam@95 118 One transform of one 5 by 6 array contiguous in memory:
cannam@95 119 <pre class="example"> int rank = 2;
cannam@95 120 int n[] = {5, 6};
cannam@95 121 int howmany = 1;
cannam@95 122 int idist = odist = 0; /* unused because howmany = 1 */
cannam@95 123 int istride = ostride = 1; /* array is contiguous in memory */
cannam@95 124 int *inembed = n, *onembed = n;
cannam@95 125 </pre>
cannam@95 126 <p>Transform of three 5 by 6 arrays, each contiguous in memory,
cannam@95 127 stored in memory one after another:
cannam@95 128 <pre class="example"> int rank = 2;
cannam@95 129 int n[] = {5, 6};
cannam@95 130 int howmany = 3;
cannam@95 131 int idist = odist = n[0]*n[1]; /* = 30, the distance in memory
cannam@95 132 between the first element
cannam@95 133 of the first array and the
cannam@95 134 first element of the second array */
cannam@95 135 int istride = ostride = 1; /* array is contiguous in memory */
cannam@95 136 int *inembed = n, *onembed = n;
cannam@95 137 </pre>
cannam@95 138 <p>Transform each column of a 2d array with 10 rows and 3 columns:
cannam@95 139 <pre class="example"> int rank = 1; /* not 2: we are computing 1d transforms */
cannam@95 140 int n[] = {10}; /* 1d transforms of length 10 */
cannam@95 141 int howmany = 3;
cannam@95 142 int idist = odist = 1;
cannam@95 143 int istride = ostride = 3; /* distance between two elements in
cannam@95 144 the same column */
cannam@95 145 int *inembed = n, *onembed = n;
cannam@95 146 </pre>
cannam@95 147 <!-- =========> -->
cannam@95 148 </body></html>
cannam@95 149