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

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