aboutsummaryrefslogtreecommitdiffhomepage
path: root/unsupported/Eigen/FFT
diff options
context:
space:
mode:
authorGravatar Thomas Capricelli <orzel@freehackers.org>2009-11-30 16:21:21 +0100
committerGravatar Thomas Capricelli <orzel@freehackers.org>2009-11-30 16:21:21 +0100
commit21ff296652c1be066e93c1196e9d7b8e868683f1 (patch)
tree5e6abc4b7d441c834bdbb6854ac813125470d94e /unsupported/Eigen/FFT
parenta255336e4fa3e01f71db96b72f5ced4c200c341c (diff)
Adapted a mail from Mark about some design and add it as documentation for
the FFT module.
Diffstat (limited to 'unsupported/Eigen/FFT')
-rw-r--r--unsupported/Eigen/FFT35
1 files changed, 33 insertions, 2 deletions
diff --git a/unsupported/Eigen/FFT b/unsupported/Eigen/FFT
index c8521bbf0..fc2efc1d6 100644
--- a/unsupported/Eigen/FFT
+++ b/unsupported/Eigen/FFT
@@ -44,11 +44,42 @@
* The build-in implementation is based on kissfft. It is a small, free, and
* reasonably efficient default.
*
- * Frontends are
+ * There are currently two frontends:
*
* - fftw (http://www.fftw.org) : faster, GPL -- incompatible with Eigen in LGPL form, bigger code size.
- * - MLK (http://en.wikipedia.org/wiki/Math_Kernel_Library) : fastest, commercial -- may be incompatible with Eigen in GPL form
+ * - MLK (http://en.wikipedia.org/wiki/Math_Kernel_Library) : fastest, commercial -- may be incompatible with Eigen in GPL form.
*
+ * \section FFTDesign Design
+ *
+ * The following design decisions were made concerning scaling and
+ * half-spectrum for real FFT.
+ *
+ * The intent is to facilitate generic programming and ease migrating code
+ * from Matlab/octave.
+ * We think the default behavior of Eigen/FFT should favor correctness and
+ * generality over speed. Of course, the caller should be able to "opt-out" from this
+ * behavior and get the speed increase if they want it.
+ *
+ * 1) %Scaling:
+ * Other libraries (FFTW,IMKL,KISSFFT) do not perform scaling, so there
+ * is a constant gain incurred after the forward&inverse transforms , so
+ * IFFT(FFT(x)) = Kx; this is done to avoid a vector-by-value multiply.
+ * The downside is that algorithms that worked correctly in Matlab/octave
+ * don't behave the same way once implemented in C++.
+ *
+ * How Eigen/FFT differs: invertible scaling is performed so IFFT( FFT(x) ) = x.
+ *
+ * 2) Real FFT half-spectrum
+ * Other libraries use only half the frequency spectrum (plus one extra
+ * sample for the Nyquist bin) for a real FFT, the other half is the
+ * conjugate-symmetric of the first half. This saves them a copy and some
+ * memory. The downside is the caller needs to have special logic for the
+ * number of bins in complex vs real.
+ *
+ * How Eigen/FFT differs: The full spectrum is returned from the forward
+ * transform. This facilitates generic template programming by obviating
+ * separate specializations for real vs complex. On the inverse
+ * transform, only half the spectrum is actually used if the output type is real.
*/