VAPoR  0.1
MatWaveBase.h
Go to the documentation of this file.
1 #ifndef _MatWaveBase_h_
2 #define _MatWaveBase_h_
3 
4 #include <string>
5 #include "WaveFiltBase.h"
6 
7 using namespace std;
8 
9 namespace VAPoR {
10 
11 //
23 class MatWaveBase : public VetsUtil::MyBase {
24 
25 public:
29  enum dwtmode_t {
30  INVALID = -1,
31  ZPD,
32  SYMH,
36  SP0,
37  SP1,
38  PPD,
39  PER
40  };
41 
49  MatWaveBase(const string &wname, const string &mode);
50  MatWaveBase(const string &wname);
51  virtual ~MatWaveBase();
52 
61  int dwtmode(const string &mode);
62 
70  int dwtmode(dwtmode_t mode);
71 
78  const string dwtmode() const;
79 
84  dwtmode_t dwtmodeenum() const { return(_mode); };
85 
94  int wavelet(const string &wname);
95 
100  string wavelet_name() const {return(_wname); };
101 
106  const WaveFiltBase *wavelet() const {return(_wf); };
107 
108 
121  //
122  size_t approxlength(size_t sigInLen) const;
123 
135  //
136  size_t detaillength(size_t sigInLen) const;
137 
138 
149  //
150  size_t coefflength(size_t sigInLen) const {
151  return(approxlength(sigInLen) + detaillength(sigInLen));
152  };
153 
154  size_t coefflength2(size_t sigInX, size_t sigInY) const {
155  return(coefflength(sigInX) * coefflength(sigInY));
156  };
157 
158  size_t coefflength3( size_t sigInX, size_t sigInY, size_t sigInZ) const {
159  return(coefflength(sigInX) * coefflength(sigInY) * coefflength(sigInZ));
160  };
161 
162 
163 
176  //
177  size_t wmaxlev(size_t s) const;
178 
179 
188  //
189  bool &InvalidFloatAbortOnOff() {return(_InvalidFloatAbort);};
190 
191 protected:
192 
193 private:
194  bool _InvalidFloatAbort;
195  dwtmode_t _mode;
196  WaveFiltBase *_wf;
197  string _wname;
198 
199  WaveFiltBase *_create_wf(const string &wname) const;
200 
201  void _wave_len_validate(
202  size_t sigInLen, int waveLength, size_t *lev, size_t *val
203  ) const;
204 
205  dwtmode_t _dwtmodestr2enum(const string &mode) const;
206  string _dwtmodeenum2str(dwtmode_t mode) const;
207 
208 
209 };
210 
211 }
212 
213 #endif
size_t coefflength(size_t sigInLen) const
Definition: MatWaveBase.h:150
dwtmode_t dwtmodeenum() const
Definition: MatWaveBase.h:84
bool & InvalidFloatAbortOnOff()
Definition: MatWaveBase.h:189
string wavelet_name() const
Definition: MatWaveBase.h:100
A base class for a Matlab-like wavelet bank.
Definition: MatWaveBase.h:23
size_t coefflength3(size_t sigInX, size_t sigInY, size_t sigInZ) const
Definition: MatWaveBase.h:158
VetsUtil base class.
Definition: MyBase.h:68
A base class for wavelet family filters.
Definition: WaveFiltBase.h:21
size_t coefflength2(size_t sigInX, size_t sigInY) const
Definition: MatWaveBase.h:154
const WaveFiltBase * wavelet() const
Definition: MatWaveBase.h:106