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

vnl_fft1d.h

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

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