| 1 | //   FFT (Fast Fourier Transform) Server based on FFTPack
 | 
|---|
| 2 | //        R. Ansari     1999-2000
 | 
|---|
| 3 | // DAPNIA/SPP (Saclay) / CEA    LAL - IN2P3/CNRS  (Orsay)
 | 
|---|
| 4 | 
 | 
|---|
| 5 | #ifndef  FFTPServer_H_SEEN
 | 
|---|
| 6 | #define  FFTPServer_H_SEEN
 | 
|---|
| 7 | 
 | 
|---|
| 8 | #include "fftservintf.h"
 | 
|---|
| 9 | 
 | 
|---|
| 10 | // implementation de FFTServerInterface en utilisant FFTPack 
 | 
|---|
| 11 | 
 | 
|---|
| 12 | namespace SOPHYA {
 | 
|---|
| 13 | 
 | 
|---|
| 14 | //! An FFT server based on fftpack.
 | 
|---|
| 15 | class FFTPackServer : public FFTServerInterface {
 | 
|---|
| 16 |  public:
 | 
|---|
| 17 |   FFTPackServer(bool preserve_input=true);
 | 
|---|
| 18 |   virtual ~FFTPackServer();
 | 
|---|
| 19 | 
 | 
|---|
| 20 |   // Implementation de l'interface FFTServerInterface
 | 
|---|
| 21 | 
 | 
|---|
| 22 |   virtual FFTServerInterface * Clone();
 | 
|---|
| 23 | 
 | 
|---|
| 24 |   // Transforme unidimensionnel sur des double
 | 
|---|
| 25 |   virtual void FFTForward(TArray< complex<r_8> > & in, TArray< complex<r_8> > & out);
 | 
|---|
| 26 |   virtual void FFTBackward(TArray< complex<r_8> > & in, TArray< complex<r_8> > & out);
 | 
|---|
| 27 |   virtual void FFTForward(TArray< r_8 > & in, TArray< complex<r_8> > & out);
 | 
|---|
| 28 |   virtual void FFTBackward(TArray< complex<r_8> > & in, TArray< r_8 > & out, 
 | 
|---|
| 29 |                            bool usoutsz=false);
 | 
|---|
| 30 | 
 | 
|---|
| 31 |   // Transforme unidimensionnel sur des float
 | 
|---|
| 32 |   virtual void FFTForward(TArray< complex<r_4> > & in, TArray< complex<r_4> > & out);
 | 
|---|
| 33 |   virtual void FFTBackward(TArray< complex<r_4> > & in, TArray< complex<r_4> > & out);
 | 
|---|
| 34 |   virtual void FFTForward(TArray< r_4 > & in, TArray< complex<r_4> > & out);
 | 
|---|
| 35 |   virtual void FFTBackward(TArray< complex<r_4> > & in, TArray< r_4 > & out,
 | 
|---|
| 36 |                            bool usoutsz=false);
 | 
|---|
| 37 | 
 | 
|---|
| 38 | // Methodes statiques pour reordonner les donnees
 | 
|---|
| 39 |   static void ReShapetoReal(TArray< complex<r_8> > const & in, TArray< r_8 >  & out, bool usz);
 | 
|---|
| 40 |   static void ReShapetoCompl(TArray< r_8 > const & in, TArray< complex<r_8> > & out); 
 | 
|---|
| 41 |   static void ReShapetoReal(TArray< complex<r_4> > const & in, TArray< r_4 >  & out, bool usz);
 | 
|---|
| 42 |   static void ReShapetoCompl(TArray< r_4 > const & in, TArray< complex<r_4> > & out); 
 | 
|---|
| 43 | 
 | 
|---|
| 44 |   //  Methodes propres a cette classe
 | 
|---|
| 45 |   virtual void fftf(int_4 l, float* inout);
 | 
|---|
| 46 |   virtual void fftb(int_4 l, float* inout);
 | 
|---|
| 47 |   virtual void fftf(int_4 l, double* inout);
 | 
|---|
| 48 |   virtual void fftb(int_4 l, double* inout);
 | 
|---|
| 49 |   virtual void fftf(int_4 l, complex<float>* inout);
 | 
|---|
| 50 |   virtual void fftb(int_4 l, complex<float>* inout);
 | 
|---|
| 51 |   virtual void fftf(int_4 l, complex<double>* inout);
 | 
|---|
| 52 |   virtual void fftb(int_4 l, complex<double>* inout);
 | 
|---|
| 53 | 
 | 
|---|
| 54 |  protected:
 | 
|---|
| 55 |   virtual void checkint_rfft(int_4 l);
 | 
|---|
| 56 |   virtual void checkint_dfft(int_4 l);
 | 
|---|
| 57 |   virtual void checkint_cfft(int_4 l);
 | 
|---|
| 58 |   virtual void checkint_cdfft(int_4 l);
 | 
|---|
| 59 | 
 | 
|---|
| 60 |   int sz_rfft;
 | 
|---|
| 61 |   r_4* ws_rfft;
 | 
|---|
| 62 | 
 | 
|---|
| 63 |   int sz_cfft;
 | 
|---|
| 64 |   r_4* ws_cfft;
 | 
|---|
| 65 | 
 | 
|---|
| 66 |   int sz_dfft;
 | 
|---|
| 67 |   r_8* ws_dfft;
 | 
|---|
| 68 | 
 | 
|---|
| 69 |   int sz_cdfft;
 | 
|---|
| 70 |   r_8* ws_cdfft;
 | 
|---|
| 71 | 
 | 
|---|
| 72 |   FFTArrayChecker<r_4> ckR4;
 | 
|---|
| 73 |   FFTArrayChecker<r_8> ckR8;
 | 
|---|
| 74 |   bool _preserve_input; // if true, input arrays not overwritten
 | 
|---|
| 75 | 
 | 
|---|
| 76 | };
 | 
|---|
| 77 | 
 | 
|---|
| 78 | } // Fin du namespace
 | 
|---|
| 79 | 
 | 
|---|
| 80 | 
 | 
|---|
| 81 | #endif
 | 
|---|