Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

vnl_fft2d.h

Go to the documentation of this file.
00001 #ifndef vnl_fft2d_h_
00002 #define vnl_fft2d_h_
00003 
00004 //:
00005 //  \file
00006 //  \brief Templated 2D FFT class based on Temperton FFT routines
00007 //  \author Veit U.B. Schenk, Oxford RRG, 19 Mar 98
00008 //
00009 //  Modifications
00010 //  dac (Manchester) 28/03/2001: tidied up documentation
00011 
00012 #include <vcl_complex.h>
00013 #include <vnl/vnl_matrix.h>
00014 #include "vnl_fftxd_prime_factors.h"
00015 
00016 //: Templated 2D FFT class based on Temperton FFT routines
00017 //
00018 //  C TEMPERTON
00019 //  A GENERALIZED PRIME FACTOR FFT ALGORITHM FOR ANY $N = 2^P 3^Q 5^R$
00020 //  SIAM J. SCI. STAT. COMP., MAY 1992.)
00021 //
00022 //  original temperton-code (fortran) converted using f2c with -C++
00023 //  option. Two versions created: float and double.
00024 //
00025 //  subclassed from vnl_matrix<vnl_complex>, i.e. internally uses
00026 //  vnl_matrix<vnl_complex> for storing the data
00027 //
00028 //  one super-simple constructor, all it takes as input is an vnl_matrix<float>
00029 //  for which it will compute  the FFT.
00030 //  For efficiency, all other constructors take as an argument two
00031 //  PrimeFactors<T>-objects  which have to be initialised before the
00032 //  call do doFFT. These PrimeFactors<T> objects contain the prime-factors
00033 //  of the 'number' (the size of the array) to be FFT'd.
00034 //  (integral part of Temperton's algorithm)
00035 
00036 template<class T>
00037 class vnl_fft2d : public vnl_matrix<vcl_complex<T> > {
00038 public:
00039   typedef vnl_matrix<vcl_complex<T> > base;
00040 
00041   vnl_fft2d (const vnl_matrix<T> &real); // always forward
00042   vnl_fft2d (const vnl_matrix<vcl_complex<T> > &z, int dir); // both forw and backw
00043 
00044   //: (real,imag)-constructors
00045   vnl_fft2d (const vnl_matrix<T> &r, const vnl_matrix<T> &i,
00046              const vnl_fftxd_prime_factors<T> &oPFx,
00047              const vnl_fftxd_prime_factors<T> &oPFy, int dir); // vnl_matrixs r,i
00048   vnl_fft2d (const vnl_matrix<T> &r,
00049              const vnl_fftxd_prime_factors<T> &oPFx,
00050              const vnl_fftxd_prime_factors<T> &oPFy, int dir);  // Imag defaults to 0.0
00051   vnl_fft2d (const T *realdata, const T *imagdata, unsigned int iRows, unsigned int iCols,
00052              const vnl_fftxd_prime_factors<T> &oPFx,
00053              const vnl_fftxd_prime_factors<T> &oPFy, int dir);  // 'raw' r,i
00054   vnl_fft2d (const T *data, unsigned int iRows, unsigned int iCols,
00055              const vnl_fftxd_prime_factors<T> &oPFx,
00056              const vnl_fftxd_prime_factors<T> &oPFy, int dir);         // 'raw' r. I defaults to 0.0
00057 
00058 #ifndef VCL_VC60
00059   //: complex-constructor
00060   vnl_fft2d (const vnl_matrix<vcl_complex<T> > &c,
00061              const vnl_fftxd_prime_factors<T> &oPFx,
00062              const vnl_fftxd_prime_factors<T> &oPFy, int dir);          //  complex vnl_matrix
00063   //: complex-constructor
00064   vnl_fft2d (const vcl_complex<T> *cdata, unsigned int iRows, unsigned int iCols,
00065              const vnl_fftxd_prime_factors<T> &oPFx,
00066              const vnl_fftxd_prime_factors<T> &oPFy, int dir);  // 'raw' complex data
00067 #endif
00068 
00069   //: static member function: avoid copy-overhead
00070   static int doFFT_IP (vcl_complex<T> *cdata, unsigned int rows, unsigned int cols,
00071                        const vnl_fftxd_prime_factors<T> &oPFx,
00072                        const vnl_fftxd_prime_factors<T> &oPFy, int dir);
00073 
00074 private:
00075   int doFFT (const vnl_fftxd_prime_factors<T> &oPFx,
00076              const vnl_fftxd_prime_factors<T> &oPFy, int dir);
00077 };
00078 
00079 #endif // vnl_fft2d_h_

Generated at Wed Mar 12 01:13:15 2003 for ITK by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2000