Mercurial > hg > batch-feature-extraction-tool
comparison Lib/fftw-3.2.1/doc/html/.svn/text-base/Multi_002dDimensional-DFTs-of-Real-Data.html.svn-base @ 0:25bf17994ef1
First commit. VS2013, Codeblocks and Mac OSX configuration
author | Geogaddi\David <d.m.ronan@qmul.ac.uk> |
---|---|
date | Thu, 09 Jul 2015 01:12:16 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:25bf17994ef1 |
---|---|
1 <html lang="en"> | |
2 <head> | |
3 <title>Multi-Dimensional DFTs of Real Data - FFTW 3.2.1</title> | |
4 <meta http-equiv="Content-Type" content="text/html"> | |
5 <meta name="description" content="FFTW 3.2.1"> | |
6 <meta name="generator" content="makeinfo 4.8"> | |
7 <link title="Top" rel="start" href="index.html#Top"> | |
8 <link rel="up" href="Tutorial.html#Tutorial" title="Tutorial"> | |
9 <link rel="prev" href="One_002dDimensional-DFTs-of-Real-Data.html#One_002dDimensional-DFTs-of-Real-Data" title="One-Dimensional DFTs of Real Data"> | |
10 <link rel="next" href="More-DFTs-of-Real-Data.html#More-DFTs-of-Real-Data" title="More DFTs of Real Data"> | |
11 <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage"> | |
12 <!-- | |
13 This manual is for FFTW | |
14 (version 3.2.1, 5 February 2009). | |
15 | |
16 Copyright (C) 2003 Matteo Frigo. | |
17 | |
18 Copyright (C) 2003 Massachusetts Institute of Technology. | |
19 | |
20 Permission is granted to make and distribute verbatim copies of | |
21 this manual provided the copyright notice and this permission | |
22 notice are preserved on all copies. | |
23 | |
24 Permission is granted to copy and distribute modified versions of | |
25 this manual under the conditions for verbatim copying, provided | |
26 that the entire resulting derived work is distributed under the | |
27 terms of a permission notice identical to this one. | |
28 | |
29 Permission is granted to copy and distribute translations of this | |
30 manual into another language, under the above conditions for | |
31 modified versions, except that this permission notice may be | |
32 stated in a translation approved by the Free Software Foundation. | |
33 --> | |
34 <meta http-equiv="Content-Style-Type" content="text/css"> | |
35 <style type="text/css"><!-- | |
36 pre.display { font-family:inherit } | |
37 pre.format { font-family:inherit } | |
38 pre.smalldisplay { font-family:inherit; font-size:smaller } | |
39 pre.smallformat { font-family:inherit; font-size:smaller } | |
40 pre.smallexample { font-size:smaller } | |
41 pre.smalllisp { font-size:smaller } | |
42 span.sc { font-variant:small-caps } | |
43 span.roman { font-family:serif; font-weight:normal; } | |
44 span.sansserif { font-family:sans-serif; font-weight:normal; } | |
45 --></style> | |
46 </head> | |
47 <body> | |
48 <div class="node"> | |
49 <p> | |
50 <a name="Multi-Dimensional-DFTs-of-Real-Data"></a> | |
51 <a name="Multi_002dDimensional-DFTs-of-Real-Data"></a> | |
52 Next: <a rel="next" accesskey="n" href="More-DFTs-of-Real-Data.html#More-DFTs-of-Real-Data">More DFTs of Real Data</a>, | |
53 Previous: <a rel="previous" accesskey="p" href="One_002dDimensional-DFTs-of-Real-Data.html#One_002dDimensional-DFTs-of-Real-Data">One-Dimensional DFTs of Real Data</a>, | |
54 Up: <a rel="up" accesskey="u" href="Tutorial.html#Tutorial">Tutorial</a> | |
55 <hr> | |
56 </div> | |
57 | |
58 <h3 class="section">2.4 Multi-Dimensional DFTs of Real Data</h3> | |
59 | |
60 <p>Multi-dimensional DFTs of real data use the following planner routines: | |
61 | |
62 <pre class="example"> fftw_plan fftw_plan_dft_r2c_2d(int n0, int n1, | |
63 double *in, fftw_complex *out, | |
64 unsigned flags); | |
65 fftw_plan fftw_plan_dft_r2c_3d(int n0, int n1, int n2, | |
66 double *in, fftw_complex *out, | |
67 unsigned flags); | |
68 fftw_plan fftw_plan_dft_r2c(int rank, const int *n, | |
69 double *in, fftw_complex *out, | |
70 unsigned flags); | |
71 </pre> | |
72 <p><a name="index-fftw_005fplan_005fdft_005fr2c_005f2d-58"></a><a name="index-fftw_005fplan_005fdft_005fr2c_005f3d-59"></a><a name="index-fftw_005fplan_005fdft_005fr2c-60"></a> | |
73 as well as the corresponding <code>c2r</code> routines with the input/output | |
74 types swapped. These routines work similarly to their complex | |
75 analogues, except for the fact that here the complex output array is cut | |
76 roughly in half and the real array requires padding for in-place | |
77 transforms (as in 1d, above). | |
78 | |
79 <p>As before, <code>n</code> is the logical size of the array, and the | |
80 consequences of this on the the format of the complex arrays deserve | |
81 careful attention. | |
82 <a name="index-r2c_002fc2r-multi_002ddimensional-array-format-61"></a>Suppose that the real data has dimensions n<sub>0</sub> × n<sub>1</sub> × n<sub>2</sub> × … × n<sub>d-1</sub> (in row-major order). | |
83 Then, after an r2c transform, the output is an n<sub>0</sub> × n<sub>1</sub> × n<sub>2</sub> × … × (n<sub>d-1</sub>/2 + 1) array of | |
84 <code>fftw_complex</code> values in row-major order, corresponding to slightly | |
85 over half of the output of the corresponding complex DFT. (The division | |
86 is rounded down.) The ordering of the data is otherwise exactly the | |
87 same as in the complex-DFT case. | |
88 | |
89 <p>Since the complex data is slightly larger than the real data, some | |
90 complications arise for in-place transforms. In this case, the final | |
91 dimension of the real data must be padded with extra values to | |
92 accommodate the size of the complex data—two values if the last | |
93 dimension is even and one if it is odd. | |
94 <a name="index-padding-62"></a>That is, the last dimension of the real data must physically contain | |
95 2 * (n<sub>d-1</sub>/2+1)<code>double</code> values (exactly enough to hold the complex data). | |
96 This physical array size does not, however, change the <em>logical</em> | |
97 array size—only | |
98 n<sub>d-1</sub>values are actually stored in the last dimension, and | |
99 n<sub>d-1</sub>is the last dimension passed to the plan-creation routine. | |
100 | |
101 <p>For example, consider the transform of a two-dimensional real array of | |
102 size <code>n0</code> by <code>n1</code>. The output of the r2c transform is a | |
103 two-dimensional complex array of size <code>n0</code> by <code>n1/2+1</code>, where | |
104 the <code>y</code> dimension has been cut nearly in half because of | |
105 redundancies in the output. Because <code>fftw_complex</code> is twice the | |
106 size of <code>double</code>, the output array is slightly bigger than the | |
107 input array. Thus, if we want to compute the transform in place, we | |
108 must <em>pad</em> the input array so that it is of size <code>n0</code> by | |
109 <code>2*(n1/2+1)</code>. If <code>n1</code> is even, then there are two padding | |
110 elements at the end of each row (which need not be initialized, as they | |
111 are only used for output). | |
112 | |
113 <p>The following illustration depicts the input and output arrays just | |
114 described, for both the out-of-place and in-place transforms (with the | |
115 arrows indicating consecutive memory locations): | |
116 | |
117 <div class="block-image"><img src="rfftwnd.png" alt="rfftwnd.png"></div> | |
118 | |
119 <p>These transforms are unnormalized, so an r2c followed by a c2r | |
120 transform (or vice versa) will result in the original data scaled by | |
121 the number of real data elements—that is, the product of the | |
122 (logical) dimensions of the real data. | |
123 <a name="index-normalization-63"></a> | |
124 (Because the last dimension is treated specially, if it is equal to | |
125 <code>1</code> the transform is <em>not</em> equivalent to a lower-dimensional | |
126 r2c/c2r transform. In that case, the last complex dimension also has | |
127 size <code>1</code> (<code>=1/2+1</code>), and no advantage is gained over the | |
128 complex transforms.) | |
129 | |
130 <!-- --> | |
131 </body></html> | |
132 |