annotate fft/fftw/fftw-3.3.4/doc/html/The-Halfcomplex_002dformat-DFT.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>The Halfcomplex-format DFT - 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="More-DFTs-of-Real-Data.html#More-DFTs-of-Real-Data" title="More DFTs of Real Data">
Chris@19 9 <link rel="prev" href="More-DFTs-of-Real-Data.html#More-DFTs-of-Real-Data" title="More DFTs of Real Data">
Chris@19 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)">
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="The-Halfcomplex-format-DFT"></a>
Chris@19 50 <a name="The-Halfcomplex_002dformat-DFT"></a>
Chris@19 51 <p>
Chris@19 52 Next:&nbsp;<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>,
Chris@19 53 Previous:&nbsp;<a rel="previous" accesskey="p" href="More-DFTs-of-Real-Data.html#More-DFTs-of-Real-Data">More DFTs of Real Data</a>,
Chris@19 54 Up:&nbsp;<a rel="up" accesskey="u" href="More-DFTs-of-Real-Data.html#More-DFTs-of-Real-Data">More DFTs of Real Data</a>
Chris@19 55 <hr>
Chris@19 56 </div>
Chris@19 57
Chris@19 58 <h4 class="subsection">2.5.1 The Halfcomplex-format DFT</h4>
Chris@19 59
Chris@19 60 <p>An r2r kind of <code>FFTW_R2HC</code> (<dfn>r2hc</dfn>) corresponds to an r2c DFT
Chris@19 61 <a name="index-FFTW_005fR2HC-72"></a><a name="index-r2c-73"></a><a name="index-r2hc-74"></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 &ldquo;halfcomplex&rdquo;
Chris@19 62 format output, and may sometimes be faster and/or more convenient than
Chris@19 63 the latter.
Chris@19 64 <a name="index-halfcomplex-format-75"></a>The inverse <dfn>hc2r</dfn> transform is of kind <code>FFTW_HC2R</code>.
Chris@19 65 <a name="index-FFTW_005fHC2R-76"></a><a name="index-hc2r-77"></a>This consists of the non-redundant half of the complex output for a 1d
Chris@19 66 real-input DFT of size <code>n</code>, stored as a sequence of <code>n</code> real
Chris@19 67 numbers (<code>double</code>) in the format:
Chris@19 68
Chris@19 69 <p><p align=center>
Chris@19 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>
Chris@19 71 </p>
Chris@19 72
Chris@19 73 <p>Here,
Chris@19 74 r<sub>k</sub>is the real part of the kth output, and
Chris@19 75 i<sub>k</sub>is the imaginary part. (Division by 2 is rounded down.) For a
Chris@19 76 halfcomplex array <code>hc[n]</code>, the kth component thus has its
Chris@19 77 real part in <code>hc[k]</code> and its imaginary part in <code>hc[n-k]</code>, with
Chris@19 78 the exception of <code>k</code> <code>==</code> <code>0</code> or <code>n/2</code> (the latter
Chris@19 79 only if <code>n</code> is even)&mdash;in these two cases, the imaginary part is
Chris@19 80 zero due to symmetries of the real-input DFT, and is not stored.
Chris@19 81 Thus, the r2hc transform of <code>n</code> real values is a halfcomplex array of
Chris@19 82 length <code>n</code>, and vice versa for hc2r.
Chris@19 83 <a name="index-normalization-78"></a>
Chris@19 84
Chris@19 85 <p>Aside from the differing format, the output of
Chris@19 86 <code>FFTW_R2HC</code>/<code>FFTW_HC2R</code> is otherwise exactly the same as for
Chris@19 87 the corresponding 1d r2c/c2r transform
Chris@19 88 (i.e. <code>FFTW_FORWARD</code>/<code>FFTW_BACKWARD</code> transforms, respectively).
Chris@19 89 Recall that these transforms are unnormalized, so r2hc followed by hc2r
Chris@19 90 will result in the original data multiplied by <code>n</code>. Furthermore,
Chris@19 91 like the c2r transform, an out-of-place hc2r transform will
Chris@19 92 <em>destroy its input</em> array.
Chris@19 93
Chris@19 94 <p>Although these halfcomplex transforms can be used with the
Chris@19 95 multi-dimensional r2r interface, the interpretation of such a separable
Chris@19 96 product of transforms along each dimension is problematic. For example,
Chris@19 97 consider a two-dimensional <code>n0</code> by <code>n1</code>, r2hc by r2hc
Chris@19 98 transform planned by <code>fftw_plan_r2r_2d(n0, n1, in, out, FFTW_R2HC,
Chris@19 99 FFTW_R2HC, FFTW_MEASURE)</code>. Conceptually, FFTW first transforms the rows
Chris@19 100 (of size <code>n1</code>) to produce halfcomplex rows, and then transforms the
Chris@19 101 columns (of size <code>n0</code>). Half of these column transforms, however,
Chris@19 102 are of imaginary parts, and should therefore be multiplied by i
Chris@19 103 and combined with the r2hc transforms of the real columns to produce the
Chris@19 104 2d DFT amplitudes; FFTW's r2r transform does <em>not</em> perform this
Chris@19 105 combination for you. Thus, if a multi-dimensional real-input/output DFT
Chris@19 106 is required, we recommend using the ordinary r2c/c2r
Chris@19 107 interface (see <a href="Multi_002dDimensional-DFTs-of-Real-Data.html#Multi_002dDimensional-DFTs-of-Real-Data">Multi-Dimensional DFTs of Real Data</a>).
Chris@19 108
Chris@19 109 <!-- =========> -->
Chris@19 110 </body></html>
Chris@19 111