Logo coherent WaveBurst  
Library Reference Guide
Logo
gwseries.hh
Go to the documentation of this file.
1 /*
2 # Copyright (C) 2019 Gabriele Vedovato
3 #
4 # This program is free software: you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation, either version 3 of the License, or
7 # (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <https://www.gnu.org/licenses/>.
16 */
17 
18 
19 /**********************************************************
20  * Package: graphic wat Class Library
21  * File name: gwseries.hh
22  * Author: Gabriele Vedovato (vedovato@lnl.infn.it)
23  **********************************************************/
24 
25 #ifndef GWSERIES_HH
26 #define GWSERIES_HH
27 
28 #ifndef WSERIES_HH
29 #include "wseries.hh"
30 #endif
31 
32 #include "gwavearray.hh"
33 
34 template<class DataType_t>
35 class gWSeries : public WSeries<DataType_t>
36 {
37 public:
38 
39  gWSeries() : WSeries<DataType_t>() {this->Init();wsextern=false;} // Default constructor
40  gWSeries(const WSeries<DataType_t>&); // copy Constructor
42 
43  void Forward(int n = -1)
45  void Forward(wavearray<DataType_t> &w, int n = -1)
46  {WSeries<DataType_t>::Forward(w,n);this->Init();}
47  void Forward(wavearray<DataType_t> &w, Wavelet &s, int n = -1)
48  {WSeries<DataType_t>::Forward(w,s,n);this->Init();}
49 
50  virtual ~gWSeries(); // Destructor
51 
52  void Draw(GWAT_DRAW type=GWAT_TIME, TString options="ALP", Color_t color=kBlack)
53  {if(type==GWAT_SG) {DrawSG(NULL,options);return;}
54  if(this->getLevel()) return; else return gw->Draw(type,options,color);}
55 
56  watplot* DrawTime(TString options="ALP", Color_t color=kBlack) // *MENU*
57  {if(this->getLevel()) return NULL; else return gw->DrawTime(options,color);}
58  watplot* DrawFFT(TString options="ALP", Color_t color=kBlack) // *MENU*
59  {if(this->getLevel()) return NULL; else return gw->DrawFFT(options,color);}
61  {if(this->getLevel()) return NULL; else return gw->DrawTF(options);}
62  watplot* DrawSG(TString options="") // *MENU*
63  {return DrawSG(NULL,options);}
64 
66  TString options="ALP", Color_t color=kBlack)
67  {if(this->getLevel()) return; else return gw->Draw(x,type,options,color);}
68 
70  {DrawSG(x,options);return;}
71 
72  watplot* DrawTime(wavearray<DataType_t>* x, TString options="ALP", Color_t color=kBlack)
73  {if(this->getLevel()) return NULL; else return gw->DrawTime(x,options,color);}
74  watplot* DrawFFT(wavearray<DataType_t>* x, TString options="ALP", Color_t color=kBlack)
75  {if(this->getLevel()) return NULL; else return gw->DrawFFT(x,options,color);}
77  {if(this->getLevel()) return NULL; else return gw->DrawTF(x,options);}
79 
80  double GetTimeRange(double& tMin, double& tMax) {return gw->GetTimeRange(tMin,tMax);}
81  double GetCentralTime() {return gw->GetCentralTime();}
82  void TimeShift(double tShift=0.) {return gw->TimeShift(tShift);}
83  void PhaseShift(double pShift=0.) {return gw->PhaseShift(pShift);}
84 
85  CWB::STFT* GetSTFT() {return gw->GetSTFT();}
86  watplot* GetWATPLOT() {return gw->GetWATPLOT();}
87 
88  // print wseries parameters
89  virtual void Browse(TBrowser *b) {Draw();}
90 
91 private:
92 
93 // watplot* wts; //!
94 
96 
97  void Init();
98 
99  int rnID;
100  bool wsextern; // external WSeries
101 
102  ClassDef(gWSeries,1)
103 };
104 
105 #endif
void Draw(WSeries< DataType_t > *x, TString options="")
Definition: gwseries.hh:69
int rnID
Definition: gwseries.hh:99
void Forward(wavearray< DataType_t > &w, Wavelet &s, int n=-1)
Definition: gwseries.hh:47
int n
Definition: cwb_net.C:28
TString("c")
void TimeShift(double tShift=0.)
Definition: gwseries.hh:82
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<< "\ layers : "<< nLAYERS<< "\ dF(hz) : "<< dF<< "\ 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
watplot * DrawTime(TString options="ALP", Color_t color=kBlack)
Definition: gwseries.hh:56
double GetCentralTime()
Definition: gwseries.hh:81
void Forward(int n=-1)
Definition: gwseries.hh:43
CWB::STFT * DrawTF(TString options="")
Definition: gwseries.hh:60
wavearray< double > w
Definition: Test1.C:27
int getLevel()
Definition: wseries.hh:109
double GetTimeRange(double &tMin, double &tMax)
Definition: gwseries.hh:80
void Init()
Definition: gwseries.cc:92
void Draw(GWAT_DRAW type=GWAT_TIME, TString options="ALP", Color_t color=kBlack)
Definition: gwseries.hh:52
virtual ~gWSeries()
Definition: gwseries.cc:50
GWAT_DRAW
Definition: gwat.hh:28
void Forward(wavearray< DataType_t > &w, int n=-1)
Definition: gwseries.hh:45
Definition: gwat.hh:32
CWB::STFT * DrawTF(wavearray< DataType_t > *x, TString options="")
Definition: gwseries.hh:76
void Draw(wavearray< DataType_t > *x, GWAT_DRAW type=GWAT_TIME, TString options="ALP", Color_t color=kBlack)
Definition: gwseries.hh:65
watplot * GetWATPLOT()
Definition: gwseries.hh:86
s s
Definition: cwb_net.C:155
char options[256]
watplot * DrawSG(TString options="")
Definition: gwseries.hh:62
gwavearray< DataType_t > * gw
Definition: gwseries.hh:95
CWB::STFT * GetSTFT()
Definition: gwseries.hh:85
virtual void Browse(TBrowser *b)
Definition: gwseries.hh:89
void Forward(int n=-1)
param: wavelet - n is number of steps (-1 means full decomposition)
Definition: wseries.cc:246
watplot * DrawFFT(wavearray< DataType_t > *x, TString options="ALP", Color_t color=kBlack)
Definition: gwseries.hh:74
void PhaseShift(double pShift=0.)
Definition: gwseries.hh:83
bool wsextern
Definition: gwseries.hh:100
watplot * DrawTime(wavearray< DataType_t > *x, TString options="ALP", Color_t color=kBlack)
Definition: gwseries.hh:72
watplot * DrawFFT(TString options="ALP", Color_t color=kBlack)
Definition: gwseries.hh:58
gWSeries()
Definition: gwseries.hh:39