diff src/fftw-3.3.3/doc/html/Multi_002dDimensional-DFTs-of-Real-Data.html @ 95:89f5e221ed7b

Add FFTW3
author Chris Cannam <cannam@all-day-breakfast.com>
date Wed, 20 Mar 2013 15:35:50 +0000
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/fftw-3.3.3/doc/html/Multi_002dDimensional-DFTs-of-Real-Data.html	Wed Mar 20 15:35:50 2013 +0000
@@ -0,0 +1,137 @@
+<html lang="en">
+<head>
+<title>Multi-Dimensional DFTs of Real Data - FFTW 3.3.3</title>
+<meta http-equiv="Content-Type" content="text/html">
+<meta name="description" content="FFTW 3.3.3">
+<meta name="generator" content="makeinfo 4.13">
+<link title="Top" rel="start" href="index.html#Top">
+<link rel="up" href="Tutorial.html#Tutorial" title="Tutorial">
+<link rel="prev" href="One_002dDimensional-DFTs-of-Real-Data.html#One_002dDimensional-DFTs-of-Real-Data" title="One-Dimensional DFTs of Real Data">
+<link rel="next" href="More-DFTs-of-Real-Data.html#More-DFTs-of-Real-Data" title="More DFTs of Real Data">
+<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
+<!--
+This manual is for FFTW
+(version 3.3.3, 25 November 2012).
+
+Copyright (C) 2003 Matteo Frigo.
+
+Copyright (C) 2003 Massachusetts Institute of Technology.
+
+     Permission is granted to make and distribute verbatim copies of
+     this manual provided the copyright notice and this permission
+     notice are preserved on all copies.
+
+     Permission is granted to copy and distribute modified versions of
+     this manual under the conditions for verbatim copying, provided
+     that the entire resulting derived work is distributed under the
+     terms of a permission notice identical to this one.
+
+     Permission is granted to copy and distribute translations of this
+     manual into another language, under the above conditions for
+     modified versions, except that this permission notice may be
+     stated in a translation approved by the Free Software Foundation.
+   -->
+<meta http-equiv="Content-Style-Type" content="text/css">
+<style type="text/css"><!--
+  pre.display { font-family:inherit }
+  pre.format  { font-family:inherit }
+  pre.smalldisplay { font-family:inherit; font-size:smaller }
+  pre.smallformat  { font-family:inherit; font-size:smaller }
+  pre.smallexample { font-size:smaller }
+  pre.smalllisp    { font-size:smaller }
+  span.sc    { font-variant:small-caps }
+  span.roman { font-family:serif; font-weight:normal; } 
+  span.sansserif { font-family:sans-serif; font-weight:normal; } 
+--></style>
+</head>
+<body>
+<div class="node">
+<a name="Multi-Dimensional-DFTs-of-Real-Data"></a>
+<a name="Multi_002dDimensional-DFTs-of-Real-Data"></a>
+<p>
+Next:&nbsp;<a rel="next" accesskey="n" href="More-DFTs-of-Real-Data.html#More-DFTs-of-Real-Data">More DFTs of Real Data</a>,
+Previous:&nbsp;<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>,
+Up:&nbsp;<a rel="up" accesskey="u" href="Tutorial.html#Tutorial">Tutorial</a>
+<hr>
+</div>
+
+<h3 class="section">2.4 Multi-Dimensional DFTs of Real Data</h3>
+
+<p>Multi-dimensional DFTs of real data use the following planner routines:
+
+<pre class="example">     fftw_plan fftw_plan_dft_r2c_2d(int n0, int n1,
+                                    double *in, fftw_complex *out,
+                                    unsigned flags);
+     fftw_plan fftw_plan_dft_r2c_3d(int n0, int n1, int n2,
+                                    double *in, fftw_complex *out,
+                                    unsigned flags);
+     fftw_plan fftw_plan_dft_r2c(int rank, const int *n,
+                                 double *in, fftw_complex *out,
+                                 unsigned flags);
+</pre>
+   <p><a name="index-fftw_005fplan_005fdft_005fr2c_005f2d-59"></a><a name="index-fftw_005fplan_005fdft_005fr2c_005f3d-60"></a><a name="index-fftw_005fplan_005fdft_005fr2c-61"></a>
+as well as the corresponding <code>c2r</code> routines with the input/output
+types swapped.  These routines work similarly to their complex
+analogues, except for the fact that here the complex output array is cut
+roughly in half and the real array requires padding for in-place
+transforms (as in 1d, above).
+
+   <p>As before, <code>n</code> is the logical size of the array, and the
+consequences of this on the the format of the complex arrays deserve
+careful attention. 
+<a name="index-r2c_002fc2r-multi_002ddimensional-array-format-62"></a>Suppose that the real data has dimensions n<sub>0</sub>&nbsp;&times;&nbsp;n<sub>1</sub>&nbsp;&times;&nbsp;n<sub>2</sub>&nbsp;&times;&nbsp;&hellip;&nbsp;&times;&nbsp;n<sub>d-1</sub> (in row-major order). 
+Then, after an r2c transform, the output is an n<sub>0</sub>&nbsp;&times;&nbsp;n<sub>1</sub>&nbsp;&times;&nbsp;n<sub>2</sub>&nbsp;&times;&nbsp;&hellip;&nbsp;&times;&nbsp;(n<sub>d-1</sub>/2 + 1) array of
+<code>fftw_complex</code> values in row-major order, corresponding to slightly
+over half of the output of the corresponding complex DFT.  (The division
+is rounded down.)  The ordering of the data is otherwise exactly the
+same as in the complex-DFT case.
+
+   <p>For out-of-place transforms, this is the end of the story: the real
+data is stored as a row-major array of size n<sub>0</sub>&nbsp;&times;&nbsp;n<sub>1</sub>&nbsp;&times;&nbsp;n<sub>2</sub>&nbsp;&times;&nbsp;&hellip;&nbsp;&times;&nbsp;n<sub>d-1</sub> and the complex
+data is stored as a row-major array of size n<sub>0</sub>&nbsp;&times;&nbsp;n<sub>1</sub>&nbsp;&times;&nbsp;n<sub>2</sub>&nbsp;&times;&nbsp;&hellip;&nbsp;&times;&nbsp;(n<sub>d-1</sub>/2 + 1).
+
+   <p>For in-place transforms, however, extra padding of the real-data array
+is necessary because the complex array is larger than the real array,
+and the two arrays share the same memory locations.  Thus, for
+in-place transforms, the final dimension of the real-data array must
+be padded with extra values to accommodate the size of the complex
+data&mdash;two values if the last dimension is even and one if it is odd. 
+<a name="index-padding-63"></a>That is, the last dimension of the real data must physically contain
+2 * (n<sub>d-1</sub>/2+1)<code>double</code> values (exactly enough to hold the complex data). 
+This physical array size does not, however, change the <em>logical</em>
+array size&mdash;only
+n<sub>d-1</sub>values are actually stored in the last dimension, and
+n<sub>d-1</sub>is the last dimension passed to the plan-creation routine.
+
+   <p>For example, consider the transform of a two-dimensional real array of
+size <code>n0</code> by <code>n1</code>.  The output of the r2c transform is a
+two-dimensional complex array of size <code>n0</code> by <code>n1/2+1</code>, where
+the <code>y</code> dimension has been cut nearly in half because of
+redundancies in the output.  Because <code>fftw_complex</code> is twice the
+size of <code>double</code>, the output array is slightly bigger than the
+input array.  Thus, if we want to compute the transform in place, we
+must <em>pad</em> the input array so that it is of size <code>n0</code> by
+<code>2*(n1/2+1)</code>.  If <code>n1</code> is even, then there are two padding
+elements at the end of each row (which need not be initialized, as they
+are only used for output).
+
+   <p>The following illustration depicts the input and output arrays just
+described, for both the out-of-place and in-place transforms (with the
+arrows indicating consecutive memory locations):
+<img src="rfftwnd-for-html.png" alt="rfftwnd-for-html.png">
+
+   <p>These transforms are unnormalized, so an r2c followed by a c2r
+transform (or vice versa) will result in the original data scaled by
+the number of real data elements&mdash;that is, the product of the
+(logical) dimensions of the real data. 
+<a name="index-normalization-64"></a>
+
+   <p>(Because the last dimension is treated specially, if it is equal to
+<code>1</code> the transform is <em>not</em> equivalent to a lower-dimensional
+r2c/c2r transform.  In that case, the last complex dimension also has
+size <code>1</code> (<code>=1/2+1</code>), and no advantage is gained over the
+complex transforms.)
+
+<!--  -->
+   </body></html>
+