cannam@95
|
1 <html lang="en">
|
cannam@95
|
2 <head>
|
cannam@95
|
3 <title>Real-data DFT Array Format - 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="Basic-Interface.html#Basic-Interface" title="Basic Interface">
|
cannam@95
|
9 <link rel="prev" href="Real_002ddata-DFTs.html#Real_002ddata-DFTs" title="Real-data DFTs">
|
cannam@95
|
10 <link rel="next" href="Real_002dto_002dReal-Transforms.html#Real_002dto_002dReal-Transforms" title="Real-to-Real Transforms">
|
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="Real-data-DFT-Array-Format"></a>
|
cannam@95
|
50 <a name="Real_002ddata-DFT-Array-Format"></a>
|
cannam@95
|
51 <p>
|
cannam@95
|
52 Next: <a rel="next" accesskey="n" href="Real_002dto_002dReal-Transforms.html#Real_002dto_002dReal-Transforms">Real-to-Real Transforms</a>,
|
cannam@95
|
53 Previous: <a rel="previous" accesskey="p" href="Real_002ddata-DFTs.html#Real_002ddata-DFTs">Real-data DFTs</a>,
|
cannam@95
|
54 Up: <a rel="up" accesskey="u" href="Basic-Interface.html#Basic-Interface">Basic Interface</a>
|
cannam@95
|
55 <hr>
|
cannam@95
|
56 </div>
|
cannam@95
|
57
|
cannam@95
|
58 <h4 class="subsection">4.3.4 Real-data DFT Array Format</h4>
|
cannam@95
|
59
|
cannam@95
|
60 <p><a name="index-r2c_002fc2r-multi_002ddimensional-array-format-199"></a>
|
cannam@95
|
61 The output of a DFT of real data (r2c) contains symmetries that, in
|
cannam@95
|
62 principle, make half of the outputs redundant (see <a href="What-FFTW-Really-Computes.html#What-FFTW-Really-Computes">What FFTW Really Computes</a>). (Similarly for the input of an inverse c2r transform.) In
|
cannam@95
|
63 practice, it is not possible to entirely realize these savings in an
|
cannam@95
|
64 efficient and understandable format that generalizes to
|
cannam@95
|
65 multi-dimensional transforms. Instead, the output of the r2c
|
cannam@95
|
66 transforms is <em>slightly</em> over half of the output of the
|
cannam@95
|
67 corresponding complex transform. We do not “pack” the data in any
|
cannam@95
|
68 way, but store it as an ordinary array of <code>fftw_complex</code> values.
|
cannam@95
|
69 In fact, this data is simply a subsection of what would be the array in
|
cannam@95
|
70 the corresponding complex transform.
|
cannam@95
|
71
|
cannam@95
|
72 <p>Specifically, for a real transform of d (= <code>rank</code>)
|
cannam@95
|
73 dimensions n<sub>0</sub> × n<sub>1</sub> × n<sub>2</sub> × … × n<sub>d-1</sub>, the complex data is an n<sub>0</sub> × n<sub>1</sub> × n<sub>2</sub> × … × (n<sub>d-1</sub>/2 + 1) array of
|
cannam@95
|
74 <code>fftw_complex</code> values in row-major order (with the division rounded
|
cannam@95
|
75 down). That is, we only store the <em>lower</em> half (non-negative
|
cannam@95
|
76 frequencies), plus one element, of the last dimension of the data from
|
cannam@95
|
77 the ordinary complex transform. (We could have instead taken half of
|
cannam@95
|
78 any other dimension, but implementation turns out to be simpler if the
|
cannam@95
|
79 last, contiguous, dimension is used.)
|
cannam@95
|
80
|
cannam@95
|
81 <p><a name="index-out_002dof_002dplace-200"></a>For an out-of-place transform, the real data is simply an array with
|
cannam@95
|
82 physical dimensions n<sub>0</sub> × n<sub>1</sub> × n<sub>2</sub> × … × n<sub>d-1</sub> in row-major order.
|
cannam@95
|
83
|
cannam@95
|
84 <p><a name="index-in_002dplace-201"></a><a name="index-padding-202"></a>For an in-place transform, some complications arise since the complex data
|
cannam@95
|
85 is slightly larger than the real data. In this case, the final
|
cannam@95
|
86 dimension of the real data must be <em>padded</em> with extra values to
|
cannam@95
|
87 accommodate the size of the complex data—two extra if the last
|
cannam@95
|
88 dimension is even and one if it is odd. That is, the last dimension of
|
cannam@95
|
89 the real data must physically contain
|
cannam@95
|
90 2 * (n<sub>d-1</sub>/2+1)<code>double</code> values (exactly enough to hold the complex data). This
|
cannam@95
|
91 physical array size does not, however, change the <em>logical</em> array
|
cannam@95
|
92 size—only
|
cannam@95
|
93 n<sub>d-1</sub>values are actually stored in the last dimension, and
|
cannam@95
|
94 n<sub>d-1</sub>is the last dimension passed to the planner.
|
cannam@95
|
95
|
cannam@95
|
96 <!-- =========> -->
|
cannam@95
|
97 </body></html>
|
cannam@95
|
98
|