Logo Coherent WaveBurst  
Reference Guide
Logo
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
WaveDWT.hh
Go to the documentation of this file.
1 // Wavelet Analysis Tool
2 //$Id: WaveDWT.hh,v 1.3 2001/12/15 03:27:29 jzweizig Exp $
3 #ifndef WAVEDWT_HH
4 #define WAVEDWT_HH
5 
6 //#include "slice.h"
7 //#include <valarray>
8 #ifndef __CINT__
9 #include <valarray>
10 #else
11 namespace std {
12  class slice;
13 }
14 #endif
15 #include "Wavelet.hh"
16 #include "wavearray.hh"
17 #include "TNamed.h"
18 #include "TBuffer.h"
19 
20 //namespace datacondAPI {
21 //namespace wat {
22 
23 template<class DataType_t> class SSeries;
24 
25 template<class DataType_t>
26 class WaveDWT : public Wavelet
27 {
28  public:
29 
30  //: constructor
31  WaveDWT(int mH=1, int mL=1, int tree=0, enum BORDER border=B_CYCLE);
32 
33  //: construct from the base class
34  WaveDWT(const Wavelet &);
35 
36  //: copy constructor
38 
39  //: Destructor
40  virtual ~WaveDWT();
41 
42  //: duplicate on heap - uses copy constructor
43  virtual WaveDWT<DataType_t>* Clone() const;
44 
45  //: light-weight duplicate
46  virtual WaveDWT<DataType_t>* Init() const {return this->Clone();}
47 
48  //: get maximum possible level of wavelet decompostion
49  virtual int getMaxLevel();
50  virtual int getMaxLevel (int i) {return Wavelet::getMaxLevel(i);}
51 
52  //: make slice for layer with specified index
53  virtual std::slice getSlice(const double);
54 
55  //: make slice for (level,layer)
56  virtual std::slice getSlice(const int, const int);
57 
58  virtual float getTDamp(int j, int k, char c='p') {
59  // return time-delayed amplitude for delay index k
60  // should be implemented in the transformation class (see WDM.hh)
61  float x;
62  if(j>=0 && j<(int)nWWS) x = c=='a' || c=='A' ? pWWS[j] : pWWS[j]*pWWS[j];
63  return x;
64  }
65 
66  virtual wavearray<float> getTDvec(int j, int k, char c='p') {
67  //: return array of time-delayed amplitudes between -k : k
68  //: should be implemented in the transformation class (see WDM.hh)
70  if(j>=0 && j<(int)nWWS) x.data[0] = c=='a' || c=='A' ? pWWS[j] : pWWS[j]*pWWS[j];
71  return x;
72  }
73 
74  virtual wavearray<float> getTDvecSSE(int j, int k, char c, SSeries<double>* pss){
75  //: return array of time-delayed amplitudes between -k : k
76  //: should be implemented in the transformation class (see WDM.hh)
78  cout<<"I am getTDvecSSE in WaveDWT\n";
79  return x;
80  }
81 
82  //: fills r with amplitudes needed to compute time-delays (for both quadratures)
83  virtual void getTFvec(int j, wavearray<float>& r) {}
84 
85  //: returns size of time-delay filter
86  virtual size_t getTDFsize() { return 0; }
87 
88  //: Allocate data (set pWWS)
89  bool allocate(size_t, DataType_t *);
90 
91  //: return allocate status (true if allocated)
92  bool allocate();
93 
94  //: Release data
95  void release();
96 
97  //: forward wavelet transform
98  virtual void t2w(int=1);
99  //: inverse wavelet transform
100  virtual void w2t(int=1);
101 
102  //: makes one FWT decomposition step
103  virtual void forwardFWT(int, int,
104  const double*,
105  const double*);
106  //: makes one FWT reconstruction step
107  virtual void inverseFWT(int, int,
108  const double*,
109  const double*);
110 
111  //: makes one prediction step for Lifting Wavelet Transform
112  virtual void predict(int,int,const double*);
113  //: makes one update step for Lifting Wavelet Transform
114  virtual void update(int,int,const double*);
115 
116  //: virtual functions for derived wavelet classes
117 
118  //: makes one FWT decomposition step
119  virtual void forward(int,int){}
120  //: makes one FWT reconstruction step
121  virtual void inverse(int,int){}
122 
123  DataType_t *pWWS; //! pointer to wavelet work space
124  unsigned long nWWS; // size of the wavelet work space
125  unsigned long nSTS; // size of the original time series
126 
127  ClassDef(WaveDWT,1)
128 
129 }; // class WaveDWT
130 
131 
132 //}; // namespace wat
133 //}; // namespace datacondAPI
134 
135 #endif // WAVEDWT_HH
136 
TTree * tree
Definition: TimeSortTree.C:20
virtual ~WaveDWT()
Definition: WaveDWT.cc:40
virtual float getTDamp(int j, int k, char c='p')
Definition: WaveDWT.hh:58
WaveDWT(int mH=1, int mL=1, int tree=0, enum BORDER border=B_CYCLE)
Definition: WaveDWT.cc:20
virtual void t2w(int=1)
Definition: WaveDWT.cc:57
virtual void inverse(int, int)
Definition: WaveDWT.hh:121
BORDER
Definition: Wavelet.hh:18
cout<< endl;cout<< "ts size = "<< ts.size()<< " ts rate = "<< ts.rate()<< endl;tf.Forward(ts, wdm);int levels=tf.getLevel();cout<< "tf size = "<< tf.size()<< endl;double dF=tf.resolution();double dT=1./(2 *dF);cout<< "rate(hz) : "<< RATE<< "\t layers : "<< nLAYERS<< "\t dF(hz) : "<< dF<< "\t dT(ms) : "<< dT *1000.<< endl;int itime=TIME_PIXEL_INDEX;int ifreq=FREQ_PIXEL_INDEX;int index=(levels+1)*itime+ifreq;double time=itime *dT;double freq=(ifreq >0)?ifreq *dF:dF/4;cout<< endl;cout<< "PIXEL TIME = "<< time<< " sec "<< endl;cout<< "PIXEL FREQ = "<< freq<< " Hz "<< endl;cout<< endl;wavearray< double > x
STL namespace.
DataType_t * pWWS
Definition: WaveDWT.hh:123
virtual void inverseFWT(int, int, const double *, const double *)
Definition: WaveDWT.cc:415
int j
Definition: cwb_net.C:10
i drho i
virtual void getTFvec(int j, wavearray< float > &r)
Definition: WaveDWT.hh:83
void release()
Definition: WaveDWT.cc:205
virtual WaveDWT< DataType_t > * Clone() const
return: Wavelet* - duplicate of *this, allocated on heap
Definition: WaveDWT.cc:46
virtual void forwardFWT(int, int, const double *, const double *)
Definition: WaveDWT.cc:224
virtual void forward(int, int)
Definition: WaveDWT.hh:119
virtual int getMaxLevel(int i)
Definition: WaveDWT.hh:50
unsigned long nSTS
Definition: WaveDWT.hh:125
virtual wavearray< float > getTDvec(int j, int k, char c='p')
Definition: WaveDWT.hh:66
virtual WaveDWT< DataType_t > * Init() const
Definition: WaveDWT.hh:46
int k
bool allocate()
Definition: WaveDWT.cc:198
virtual size_t getTDFsize()
Definition: WaveDWT.hh:86
virtual wavearray< float > getTDvecSSE(int j, int k, char c, SSeries< double > *pss)
Definition: WaveDWT.hh:74
virtual void update(int, int, const double *)
Definition: WaveDWT.cc:813
regression r
Definition: Regression_H1.C:44
virtual void predict(int, int, const double *)
Definition: WaveDWT.cc:633
unsigned long nWWS
pointer to wavelet work space
Definition: WaveDWT.hh:124
virtual std::slice getSlice(const double)
Definition: WaveDWT.cc:111
virtual void w2t(int=1)
Definition: WaveDWT.cc:88
virtual int getMaxLevel()
Definition: WaveDWT.cc:176
DataType_t * data
Definition: wavearray.hh:301
virtual int getMaxLevel(int)
Definition: Wavelet.hh:116