comparison src/fftw-3.3.5/doc/html/Complex-Multi_002dDimensional-DFTs.html @ 42:2cd0e3b3e1fd

Current fftw source
author Chris Cannam
date Tue, 18 Oct 2016 13:40:26 +0100
parents
children
comparison
equal deleted inserted replaced
41:481f5f8c5634 42:2cd0e3b3e1fd
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2 <html>
3 <!-- This manual is for FFTW
4 (version 3.3.5, 30 July 2016).
5
6 Copyright (C) 2003 Matteo Frigo.
7
8 Copyright (C) 2003 Massachusetts Institute of Technology.
9
10 Permission is granted to make and distribute verbatim copies of this
11 manual provided the copyright notice and this permission notice are
12 preserved on all copies.
13
14 Permission is granted to copy and distribute modified versions of this
15 manual under the conditions for verbatim copying, provided that the
16 entire resulting derived work is distributed under the terms of a
17 permission notice identical to this one.
18
19 Permission is granted to copy and distribute translations of this manual
20 into another language, under the above conditions for modified versions,
21 except that this permission notice may be stated in a translation
22 approved by the Free Software Foundation. -->
23 <!-- Created by GNU Texinfo 5.2, http://www.gnu.org/software/texinfo/ -->
24 <head>
25 <title>FFTW 3.3.5: Complex Multi-Dimensional DFTs</title>
26
27 <meta name="description" content="FFTW 3.3.5: Complex Multi-Dimensional DFTs">
28 <meta name="keywords" content="FFTW 3.3.5: Complex Multi-Dimensional DFTs">
29 <meta name="resource-type" content="document">
30 <meta name="distribution" content="global">
31 <meta name="Generator" content="makeinfo">
32 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
33 <link href="index.html#Top" rel="start" title="Top">
34 <link href="Concept-Index.html#Concept-Index" rel="index" title="Concept Index">
35 <link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
36 <link href="Tutorial.html#Tutorial" rel="up" title="Tutorial">
37 <link href="One_002dDimensional-DFTs-of-Real-Data.html#One_002dDimensional-DFTs-of-Real-Data" rel="next" title="One-Dimensional DFTs of Real Data">
38 <link href="Complex-One_002dDimensional-DFTs.html#Complex-One_002dDimensional-DFTs" rel="prev" title="Complex One-Dimensional DFTs">
39 <style type="text/css">
40 <!--
41 a.summary-letter {text-decoration: none}
42 blockquote.smallquotation {font-size: smaller}
43 div.display {margin-left: 3.2em}
44 div.example {margin-left: 3.2em}
45 div.indentedblock {margin-left: 3.2em}
46 div.lisp {margin-left: 3.2em}
47 div.smalldisplay {margin-left: 3.2em}
48 div.smallexample {margin-left: 3.2em}
49 div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
50 div.smalllisp {margin-left: 3.2em}
51 kbd {font-style:oblique}
52 pre.display {font-family: inherit}
53 pre.format {font-family: inherit}
54 pre.menu-comment {font-family: serif}
55 pre.menu-preformatted {font-family: serif}
56 pre.smalldisplay {font-family: inherit; font-size: smaller}
57 pre.smallexample {font-size: smaller}
58 pre.smallformat {font-family: inherit; font-size: smaller}
59 pre.smalllisp {font-size: smaller}
60 span.nocodebreak {white-space:nowrap}
61 span.nolinebreak {white-space:nowrap}
62 span.roman {font-family:serif; font-weight:normal}
63 span.sansserif {font-family:sans-serif; font-weight:normal}
64 ul.no-bullet {list-style: none}
65 -->
66 </style>
67
68
69 </head>
70
71 <body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
72 <a name="Complex-Multi_002dDimensional-DFTs"></a>
73 <div class="header">
74 <p>
75 Next: <a href="One_002dDimensional-DFTs-of-Real-Data.html#One_002dDimensional-DFTs-of-Real-Data" accesskey="n" rel="next">One-Dimensional DFTs of Real Data</a>, Previous: <a href="Complex-One_002dDimensional-DFTs.html#Complex-One_002dDimensional-DFTs" accesskey="p" rel="prev">Complex One-Dimensional DFTs</a>, Up: <a href="Tutorial.html#Tutorial" accesskey="u" rel="up">Tutorial</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html#Concept-Index" title="Index" rel="index">Index</a>]</p>
76 </div>
77 <hr>
78 <a name="Complex-Multi_002dDimensional-DFTs-1"></a>
79 <h3 class="section">2.2 Complex Multi-Dimensional DFTs</h3>
80
81 <p>Multi-dimensional transforms work much the same way as one-dimensional
82 transforms: you allocate arrays of <code>fftw_complex</code> (preferably
83 using <code>fftw_malloc</code>), create an <code>fftw_plan</code>, execute it as
84 many times as you want with <code>fftw_execute(plan)</code>, and clean up
85 with <code>fftw_destroy_plan(plan)</code> (and <code>fftw_free</code>).
86 </p>
87 <p>FFTW provides two routines for creating plans for 2d and 3d transforms,
88 and one routine for creating plans of arbitrary dimensionality.
89 The 2d and 3d routines have the following signature:
90 </p><div class="example">
91 <pre class="example">fftw_plan fftw_plan_dft_2d(int n0, int n1,
92 fftw_complex *in, fftw_complex *out,
93 int sign, unsigned flags);
94 fftw_plan fftw_plan_dft_3d(int n0, int n1, int n2,
95 fftw_complex *in, fftw_complex *out,
96 int sign, unsigned flags);
97 </pre></div>
98 <a name="index-fftw_005fplan_005fdft_005f2d"></a>
99 <a name="index-fftw_005fplan_005fdft_005f3d"></a>
100
101 <p>These routines create plans for <code>n0</code> by <code>n1</code> two-dimensional
102 (2d) transforms and <code>n0</code> by <code>n1</code> by <code>n2</code> 3d transforms,
103 respectively. All of these transforms operate on contiguous arrays in
104 the C-standard <em>row-major</em> order, so that the last dimension has the
105 fastest-varying index in the array. This layout is described further in
106 <a href="Multi_002ddimensional-Array-Format.html#Multi_002ddimensional-Array-Format">Multi-dimensional Array Format</a>.
107 </p>
108 <p>FFTW can also compute transforms of higher dimensionality. In order to
109 avoid confusion between the various meanings of the the word
110 &ldquo;dimension&rdquo;, we use the term <em>rank</em>
111 <a name="index-rank"></a>
112 to denote the number of independent indices in an array.<a name="DOCF2" href="#FOOT2"><sup>2</sup></a> For
113 example, we say that a 2d transform has rank&nbsp;2, a 3d transform has
114 rank&nbsp;3, and so on. You can plan transforms of arbitrary rank by
115 means of the following function:
116 </p>
117 <div class="example">
118 <pre class="example">fftw_plan fftw_plan_dft(int rank, const int *n,
119 fftw_complex *in, fftw_complex *out,
120 int sign, unsigned flags);
121 </pre></div>
122 <a name="index-fftw_005fplan_005fdft"></a>
123
124 <p>Here, <code>n</code> is a pointer to an array <code>n[rank]</code> denoting an
125 <code>n[0]</code> by <code>n[1]</code> by &hellip; by <code>n[rank-1]</code> transform.
126 Thus, for example, the call
127 </p><div class="example">
128 <pre class="example">fftw_plan_dft_2d(n0, n1, in, out, sign, flags);
129 </pre></div>
130 <p>is equivalent to the following code fragment:
131 </p><div class="example">
132 <pre class="example">int n[2];
133 n[0] = n0;
134 n[1] = n1;
135 fftw_plan_dft(2, n, in, out, sign, flags);
136 </pre></div>
137 <p><code>fftw_plan_dft</code> is not restricted to 2d and 3d transforms,
138 however, but it can plan transforms of arbitrary rank.
139 </p>
140 <p>You may have noticed that all the planner routines described so far
141 have overlapping functionality. For example, you can plan a 1d or 2d
142 transform by using <code>fftw_plan_dft</code> with a <code>rank</code> of <code>1</code>
143 or <code>2</code>, or even by calling <code>fftw_plan_dft_3d</code> with <code>n0</code>
144 and/or <code>n1</code> equal to <code>1</code> (with no loss in efficiency). This
145 pattern continues, and FFTW&rsquo;s planning routines in general form a
146 &ldquo;partial order,&rdquo; sequences of
147 <a name="index-partial-order"></a>
148 interfaces with strictly increasing generality but correspondingly
149 greater complexity.
150 </p>
151 <p><code>fftw_plan_dft</code> is the most general complex-DFT routine that we
152 describe in this tutorial, but there are also the advanced and guru interfaces,
153 <a name="index-advanced-interface-1"></a>
154 <a name="index-guru-interface-1"></a>
155 which allow one to efficiently combine multiple/strided transforms
156 into a single FFTW plan, transform a subset of a larger
157 multi-dimensional array, and/or to handle more general complex-number
158 formats. For more information, see <a href="FFTW-Reference.html#FFTW-Reference">FFTW Reference</a>.
159 </p>
160 <div class="footnote">
161 <hr>
162 <h4 class="footnotes-heading">Footnotes</h4>
163
164 <h3><a name="FOOT2" href="#DOCF2">(2)</a></h3>
165 <p>The
166 term &ldquo;rank&rdquo; is commonly used in the APL, FORTRAN, and Common Lisp
167 traditions, although it is not so common in the C&nbsp;world.</p>
168 </div>
169 <hr>
170 <div class="header">
171 <p>
172 Next: <a href="One_002dDimensional-DFTs-of-Real-Data.html#One_002dDimensional-DFTs-of-Real-Data" accesskey="n" rel="next">One-Dimensional DFTs of Real Data</a>, Previous: <a href="Complex-One_002dDimensional-DFTs.html#Complex-One_002dDimensional-DFTs" accesskey="p" rel="prev">Complex One-Dimensional DFTs</a>, Up: <a href="Tutorial.html#Tutorial" accesskey="u" rel="up">Tutorial</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html#Concept-Index" title="Index" rel="index">Index</a>]</p>
173 </div>
174
175
176
177 </body>
178 </html>