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