d@0
|
1 <html lang="en">
|
d@0
|
2 <head>
|
d@0
|
3 <title>The Halfcomplex-format DFT - FFTW 3.2.1</title>
|
d@0
|
4 <meta http-equiv="Content-Type" content="text/html">
|
d@0
|
5 <meta name="description" content="FFTW 3.2.1">
|
d@0
|
6 <meta name="generator" content="makeinfo 4.8">
|
d@0
|
7 <link title="Top" rel="start" href="index.html#Top">
|
d@0
|
8 <link rel="up" href="More-DFTs-of-Real-Data.html#More-DFTs-of-Real-Data" title="More DFTs of Real Data">
|
d@0
|
9 <link rel="prev" href="More-DFTs-of-Real-Data.html#More-DFTs-of-Real-Data" title="More DFTs of Real Data">
|
d@0
|
10 <link rel="next" href="Real-even_002fodd-DFTs-_0028cosine_002fsine-transforms_0029.html#Real-even_002fodd-DFTs-_0028cosine_002fsine-transforms_0029" title="Real even/odd DFTs (cosine/sine transforms)">
|
d@0
|
11 <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
|
d@0
|
12 <!--
|
d@0
|
13 This manual is for FFTW
|
d@0
|
14 (version 3.2.1, 5 February 2009).
|
d@0
|
15
|
d@0
|
16 Copyright (C) 2003 Matteo Frigo.
|
d@0
|
17
|
d@0
|
18 Copyright (C) 2003 Massachusetts Institute of Technology.
|
d@0
|
19
|
d@0
|
20 Permission is granted to make and distribute verbatim copies of
|
d@0
|
21 this manual provided the copyright notice and this permission
|
d@0
|
22 notice are preserved on all copies.
|
d@0
|
23
|
d@0
|
24 Permission is granted to copy and distribute modified versions of
|
d@0
|
25 this manual under the conditions for verbatim copying, provided
|
d@0
|
26 that the entire resulting derived work is distributed under the
|
d@0
|
27 terms of a permission notice identical to this one.
|
d@0
|
28
|
d@0
|
29 Permission is granted to copy and distribute translations of this
|
d@0
|
30 manual into another language, under the above conditions for
|
d@0
|
31 modified versions, except that this permission notice may be
|
d@0
|
32 stated in a translation approved by the Free Software Foundation.
|
d@0
|
33 -->
|
d@0
|
34 <meta http-equiv="Content-Style-Type" content="text/css">
|
d@0
|
35 <style type="text/css"><!--
|
d@0
|
36 pre.display { font-family:inherit }
|
d@0
|
37 pre.format { font-family:inherit }
|
d@0
|
38 pre.smalldisplay { font-family:inherit; font-size:smaller }
|
d@0
|
39 pre.smallformat { font-family:inherit; font-size:smaller }
|
d@0
|
40 pre.smallexample { font-size:smaller }
|
d@0
|
41 pre.smalllisp { font-size:smaller }
|
d@0
|
42 span.sc { font-variant:small-caps }
|
d@0
|
43 span.roman { font-family:serif; font-weight:normal; }
|
d@0
|
44 span.sansserif { font-family:sans-serif; font-weight:normal; }
|
d@0
|
45 --></style>
|
d@0
|
46 </head>
|
d@0
|
47 <body>
|
d@0
|
48 <div class="node">
|
d@0
|
49 <p>
|
d@0
|
50 <a name="The-Halfcomplex-format-DFT"></a>
|
d@0
|
51 <a name="The-Halfcomplex_002dformat-DFT"></a>
|
d@0
|
52 Next: <a rel="next" accesskey="n" href="Real-even_002fodd-DFTs-_0028cosine_002fsine-transforms_0029.html#Real-even_002fodd-DFTs-_0028cosine_002fsine-transforms_0029">Real even/odd DFTs (cosine/sine transforms)</a>,
|
d@0
|
53 Previous: <a rel="previous" accesskey="p" href="More-DFTs-of-Real-Data.html#More-DFTs-of-Real-Data">More DFTs of Real Data</a>,
|
d@0
|
54 Up: <a rel="up" accesskey="u" href="More-DFTs-of-Real-Data.html#More-DFTs-of-Real-Data">More DFTs of Real Data</a>
|
d@0
|
55 <hr>
|
d@0
|
56 </div>
|
d@0
|
57
|
d@0
|
58 <h4 class="subsection">2.5.1 The Halfcomplex-format DFT</h4>
|
d@0
|
59
|
d@0
|
60 <p>An r2r kind of <code>FFTW_R2HC</code> (<dfn>r2hc</dfn>) corresponds to an r2c DFT
|
d@0
|
61 <a name="index-FFTW_005fR2HC-71"></a><a name="index-r2c-72"></a><a name="index-r2hc-73"></a>(see <a href="One_002dDimensional-DFTs-of-Real-Data.html#One_002dDimensional-DFTs-of-Real-Data">One-Dimensional DFTs of Real Data</a>) but with “halfcomplex”
|
d@0
|
62 format output, and may sometimes be faster and/or more convenient than
|
d@0
|
63 the latter.
|
d@0
|
64 <a name="index-halfcomplex-format-74"></a>The inverse <dfn>hc2r</dfn> transform is of kind <code>FFTW_HC2R</code>.
|
d@0
|
65 <a name="index-FFTW_005fHC2R-75"></a><a name="index-hc2r-76"></a>This consists of the non-redundant half of the complex output for a 1d
|
d@0
|
66 real-input DFT of size <code>n</code>, stored as a sequence of <code>n</code> real
|
d@0
|
67 numbers (<code>double</code>) in the format:
|
d@0
|
68
|
d@0
|
69 <p><p align=center>
|
d@0
|
70 r<sub>0</sub>, r<sub>1</sub>, r<sub>2</sub>, ..., r<sub>n/2</sub>, i<sub>(n+1)/2-1</sub>, ..., i<sub>2</sub>, i<sub>1</sub>
|
d@0
|
71 </p>
|
d@0
|
72
|
d@0
|
73 <p>Here,
|
d@0
|
74 r<sub>k</sub>is the real part of the kth output, and
|
d@0
|
75 i<sub>k</sub>is the imaginary part. (Division by 2 is rounded down.) For a
|
d@0
|
76 halfcomplex array <code>hc[n]</code>, the kth component thus has its
|
d@0
|
77 real part in <code>hc[k]</code> and its imaginary part in <code>hc[n-k]</code>, with
|
d@0
|
78 the exception of <code>k</code> <code>==</code> <code>0</code> or <code>n/2</code> (the latter
|
d@0
|
79 only if <code>n</code> is even)—in these two cases, the imaginary part is
|
d@0
|
80 zero due to symmetries of the real-input DFT, and is not stored.
|
d@0
|
81 Thus, the r2hc transform of <code>n</code> real values is a halfcomplex array of
|
d@0
|
82 length <code>n</code>, and vice versa for hc2r.
|
d@0
|
83 <a name="index-normalization-77"></a>
|
d@0
|
84 Aside from the differing format, the output of
|
d@0
|
85 <code>FFTW_R2HC</code>/<code>FFTW_HC2R</code> is otherwise exactly the same as for
|
d@0
|
86 the corresponding 1d r2c/c2r transform
|
d@0
|
87 (i.e. <code>FFTW_FORWARD</code>/<code>FFTW_BACKWARD</code> transforms, respectively).
|
d@0
|
88 Recall that these transforms are unnormalized, so r2hc followed by hc2r
|
d@0
|
89 will result in the original data multiplied by <code>n</code>. Furthermore,
|
d@0
|
90 like the c2r transform, an out-of-place hc2r transform will
|
d@0
|
91 <em>destroy its input</em> array.
|
d@0
|
92
|
d@0
|
93 <p>Although these halfcomplex transforms can be used with the
|
d@0
|
94 multi-dimensional r2r interface, the interpretation of such a separable
|
d@0
|
95 product of transforms along each dimension is problematic. For example,
|
d@0
|
96 consider a two-dimensional <code>n0</code> by <code>n1</code>, r2hc by r2hc
|
d@0
|
97 transform planned by <code>fftw_plan_r2r_2d(n0, n1, in, out, FFTW_R2HC,
|
d@0
|
98 FFTW_R2HC, FFTW_MEASURE)</code>. Conceptually, FFTW first transforms the rows
|
d@0
|
99 (of size <code>n1</code>) to produce halfcomplex rows, and then transforms the
|
d@0
|
100 columns (of size <code>n0</code>). Half of these column transforms, however,
|
d@0
|
101 are of imaginary parts, and should therefore be multiplied by i
|
d@0
|
102 and combined with the r2hc transforms of the real columns to produce the
|
d@0
|
103 2d DFT amplitudes; FFTW's r2r transform does <em>not</em> perform this
|
d@0
|
104 combination for you. Thus, if a multi-dimensional real-input/output DFT
|
d@0
|
105 is required, we recommend using the ordinary r2c/c2r
|
d@0
|
106 interface (see <a href="Multi_002dDimensional-DFTs-of-Real-Data.html#Multi_002dDimensional-DFTs-of-Real-Data">Multi-Dimensional DFTs of Real Data</a>).
|
d@0
|
107
|
d@0
|
108 <!-- =========> -->
|
d@0
|
109 </body></html>
|
d@0
|
110
|