OpendTect-6_4  6.4
fourier.h
Go to the documentation of this file.
1 #ifndef fourier_h
2 #define fourier_h
3 
4 /*
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: K. Tingdahl/Y. Liu
9  Date: August 2001
10  RCS: $Id$
11 ________________________________________________________________________
12 
13 */
14 
15 #include "algomod.h"
16 #include "transform.h"
17 #include "paralleltask.h"
18 #include "factory.h"
19 
20 
21 namespace Fourier
22 {
23 
24 class FFTCC1D;
25 
32 public:
34  mDefaultFactoryInstanciationBase( "PFAFFT", tr("FFT") );
35  static ::Factory<CC>& factory();
36 
37  static CC* createDefault();
38 
39  CC();
40  void setNormalization(bool yn);
41  static float getNyqvist(float samplespacing);
42  static float getDf(float samplespacing,int nrsamples);
43  static void getFrequencies(float samplespacing,int nrsamples,
45  bool isFast(int sz) const;
46  virtual int getFastSize(int sz) const;
50  static void pfarc(int isign,int n,const float* rz,float_complex* cz);
51  static void pfacr(int isign,int n,const float_complex*,float* rz);
52  static int npfaro(int nmin, int nmax);
53  static int npfao(int nmin, int nmax);
54 
55 protected:
56  static uiString* legalInfo();
57  static void pfacc(char dir,int sz,int step,float_complex* signal);
65  static void pfacc(char dir,int sz,int step,int nr,const int* starts,
66  float_complex* signal);
67  static void pfacc(char dir,int sz,int step,int nr,int batchstep,
68  float_complex* signal);
69  static void pfacc(char dir,int sz,float_complex*);
70 
71  bool setup();
72  bool normalize_;
73 
74  Transform1D* createTransform() const;
75  mClass(Algo) CC1D : public GenericTransformND::Transform1D,
76  public ParallelTask
77  {
78  public:
79  CC1D();
80  ~CC1D();
81  bool init();
82  bool run(bool parallel)
83  { return executeParallel( parallel ); }
84  od_int64 nrIterations() const { return nr_; }
85  bool doPrepare(int);
86  bool doWork(od_int64 start, od_int64 stop, int );
87  void setNormalization(bool yn) { normalize_ = yn; }
88 
89  static int getFastSize(int sz);
92  protected:
93 
94  bool dopfa_;
95  char direction_;
97  bool normalize_;
99  };
100 };
101 
102 
109 {
110 public:
111  FFTCC1D();
112  FFTCC1D(const FFTCC1D&);
114 
115  ~FFTCC1D() { cleanUp(); }
116  bool setSize(int);
118  void setSample(int smp) { sample_ = smp; }
120  void setDir(bool forward) { forward_ = forward; }
121  void setNormalization(bool yn) { normalize_ = yn; }
122  bool run(float_complex* data);
123 
124  static int getFastSize(int sz);
125 
126 protected:
127 
128  void cleanUp();
129  bool getSizeFactors();
130  bool doFactor2() const;
132  bool doFactor4() const;
133  void doFactor3() const;
134  void doFactor5() const;
135  void doOtherFactor(int factor,int psz);
136  void doRotation(int psz) const;
137  bool doFinish();
138  bool setupPermutation();
139 
140  bool forward_;
142  int size_;
143  int sample_;
145  int extsz_;
146  int curf_;
147  int rmfid_;
148  int cycleid_;
149  float exp_;
150  float sin2_;
151 
153  float* rdata_;
154  float* idata_;
155  float* rtmp_;
156  float* itmp_;
157  float* cosv_;
158  float* sinv_;
163 };
164 
165 } // namespace Fourier
166 
167 #endif
#define mExpClass(module)
Definition: commondefs.h:160
Does Fourier Transforms of any size.
Definition: fourier.h:30
int size_
Definition: fourier.h:142
int * permutation1_
Definition: fourier.h:160
float * itmp_
Definition: fourier.h:156
void setSample(int smp)
step of the data from input
Definition: fourier.h:118
void setDir(bool forward)
Definition: fourier.h:120
Definition: fourier.h:75
float * rtmp_
Definition: fourier.h:155
#define mODTextTranslationClass(clss)
Definition: uistring.h:38
float * cosv_
Definition: fourier.h:157
#define mDefaultFactoryCreatorImpl(baseclss, clss)
Definition: factory.h:286
bool forward_
Definition: fourier.h:140
#define od_int64
Definition: plftypes.h:36
bool init()
char direction_
Definition: fourier.h:95
bool normalize_
Definition: fourier.h:141
int * permutation0_
Definition: fourier.h:159
Lets any 1D orthogonal transform (GenericTransformND::GenericTransform1D) be extended to ND...
Definition: transform.h:31
Computes 1D FFT for any size of data. This function is used internally by the ND computation.
Definition: fourier.h:108
~FFTCC1D()
Definition: fourier.h:115
Definition: uistring.h:89
Generalization of a task that can be run in parallel.
Definition: paralleltask.h:66
bool dopfa_
Definition: fourier.h:94
od_int64 nrIterations() const
Definition: fourier.h:84
int extsz_
Definition: fourier.h:145
Set of pointers to objects.
Definition: commontypes.h:32
bool run(bool parallel)
Definition: fourier.h:82
#define mDefaultFactoryInstanciationBase(keywrd, usernm)
Definition: factory.h:280
int sample_
Definition: fourier.h:143
float * rdata_
Definition: fourier.h:153
float_complex * data_
Definition: fourier.h:152
std::complex< float > float_complex
Definition: odcomplex.h:18
TypeSet< int > permutfactors_
Definition: fourier.h:161
Definition: convolve2d.h:27
bool normalize_
Definition: fourier.h:72
int curf_
Definition: fourier.h:146
Definition: transform.h:86
float * sinv_
Definition: fourier.h:158
int cycleid_
Definition: fourier.h:148
int rmfid_
Definition: fourier.h:147
int higheststart_
Definition: fourier.h:96
int totalsmp_
Definition: fourier.h:144
float exp_
Definition: fourier.h:149
void setNormalization(bool yn)
Definition: fourier.h:121
ObjectSet< FFTCC1D > ffts_
Definition: fourier.h:98
bool normalize_
Definition: fourier.h:97
#define mClass(module)
Definition: commondefs.h:164
float * idata_
Definition: fourier.h:154
float sin2_
Definition: fourier.h:150
void setNormalization(bool yn)
Definition: fourier.h:87
TypeSet< int > factors_
Definition: fourier.h:162

Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B. V. 2019