OpendTect-6_4  6.4
fftfilter.h
Go to the documentation of this file.
1 #ifndef fftfilter_h
2 #define fftfilter_h
3 
4 /*
5 ________________________________________________________________________
6 
7 (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8 Author: Bruno
9 Date: 6-10-2009
10 RCS: $Id$
11 ________________________________________________________________________
12 
13 */
14 
15 
16 #include "algomod.h"
17 #include "arrayndalgo.h"
18 #include "enums.h"
19 #include "odcomplex.h"
20 
21 namespace Fourier { class CC; }
22 
23 template <class T> class Array1DImpl;
24 
25 
33 {
34 
35 public:
36  FFTFilter(int sz, float step);
37  ~FFTFilter();
38 
39  enum Type { LowPass, HighPass, BandPass };
41 
42  void setLowPass(float cutf3,float cutf4);
43  void setHighPass(float cutf1,float cutf2);
44  void setBandPass(float cutf1,float cutf2,
45  float cutf3,float cutf4);
46  // The following will auto taper 5% of the filter size
47  void setLowPass(float cutf4);
48  void setHighPass(float cutf1);
49  void setBandPass(float cutf1,float cutf4);
50 
51  //will taper the array before apply
52  //do not use for strictly positive/negative signal
53  bool setTimeTaperWindow(int sz, BufferString wintype,
54  float var=0.95);
55 
56  bool apply(Array1DImpl<float>&);
57  bool apply(Array1DImpl<float_complex>&,bool dopreproc=true);
58 
59  Array1DImpl<float_complex>* getFreqDomainArr() const
60  { return freqdomain_; }
62  {stayinfreq_ = true; }
63 
64  Type getFilterType() const;
65  bool isLowPass() const;
66  bool isHighPass() const;
67 
68 
69 protected:
70 
71  int fftsz_;
72  int sz_;
73  float df_;
74  float step_;
75  float cutfreq_[4];
76 
86 
87  void buildFreqTaperWin();
88 
89  // will store the position of undef points
90  bool interpUdf(Array1DImpl<float>&,bool isimag=false);
92  void restoreUdf(Array1DImpl<float>&,bool isimag=false) const;
93  void restoreUdf(Array1DImpl<float_complex>&) const;
94  // will store the removed trend
95  bool deTrend(Array1DImpl<float>& outp,bool isimag=false);
96  bool deTrend(Array1DImpl<float_complex>&);
97  bool restoreTrend(Array1DImpl<float>& outp,
98  bool isimag=false) const;
99  bool restoreTrend(Array1DImpl<float_complex>&) const;
100  void reSize(const Array1DImpl<float_complex>& inp,
101  Array1DImpl<float_complex>& outp) const;
102  void reSize(const Array1DImpl<float>& inp,
103  Array1DImpl<float>& outp) const;
104  void restoreSize(const Array1DImpl<float_complex>& inp,
105  Array1DImpl<float_complex>& outp) const;
106  void restoreSize(const Array1DImpl<float>& inp,
107  Array1DImpl<float>& outp) const;
108 };
109 
110 #endif
#define mExpClass(module)
Definition: commondefs.h:160
Does Fourier Transforms of any size.
Definition: fourier.h:30
Fourier::CC * fft_
Definition: fftfilter.h:77
void requestStayInFreqDomain()
Definition: fftfilter.h:61
Array1DImpl< float_complex > * freqdomain_
Definition: fftfilter.h:84
Tapers the N-dimentional ArrayND with a windowFunction.
Definition: arrayndalgo.h:309
int fftsz_
Definition: fftfilter.h:71
ArrayNDWindow * freqwindow_
Definition: fftfilter.h:79
BoolTypeSet isudfreal_
Definition: fftfilter.h:82
#define mDeclareEnumUtils(enm)
Some utilities surrounding the often needed enum <-> string table.
Definition: enums.h:258
float step_
Definition: fftfilter.h:74
Array1DImpl< float > * trendimag_
Definition: fftfilter.h:81
float df_
Definition: fftfilter.h:73
BoolTypeSet isudfimag_
Definition: fftfilter.h:83
ArrayNDWindow * timewindow_
Definition: fftfilter.h:78
std::complex< float > float_complex
Definition: odcomplex.h:18
Definition: convolve2d.h:27
bool stayinfreq_
Definition: fftfilter.h:85
bool interpUdf(Array1D< fT > &in, typename BendPointBasedMathFunction< fT, fT >::InterpolType ipoltyp=BendPointBasedMathFunction< fT, fT >::Poly)
Definition: arrayndalgo.h:272
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size...
Definition: bufstring.h:40
Classical FFT filter, use set to set up data step, min and max frequency and type of the filter (minf...
Definition: fftfilter.h:32
Array1DImpl< float > * trendreal_
Definition: fftfilter.h:80
Implementation of Array1D.
Definition: arrayndimpl.h:52
int sz_
Definition: fftfilter.h:72
Type
Definition: fftfilter.h:39

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