Logo Coherent WaveBurst  
Reference Guide
Logo
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
STFT.hh
Go to the documentation of this file.
1 /**********************************************************
2  * Package: STFT Class Library
3  * File name: STFT.hh
4  * Author: Gabriele Vedovato (vedovato@lnl.infn.it)
5  **********************************************************/
6 
7 
8 #ifndef STFT_HH
9 #define STFT_HH
10 
11 #include "TCanvas.h"
12 #include "TH2D.h"
13 #include "TPolyLine.h"
14 #include "TStyle.h"
15 #include "TColor.h"
16 #include "TObjString.h"
17 #include "TObjArray.h"
18 #include "TString.h"
19 #include "TMarker.h"
20 #include "TROOT.h"
21 #include "TMath.h"
22 #include "TPaveText.h"
23 #include "TSystem.h"
24 #include "TLatex.h"
25 
26 #include <string>
27 #include <iostream>
28 #include <fstream>
29 #include <stdlib.h>
30 #include <math.h>
31 #include <ctype.h>
32 
33 #include "wavecomplex.hh"
34 #include "wavearray.hh"
35 
36 #include "Window.hh"
37 
38 #define DUMMY_PALETTE_ID 1000000000
39 
40 using namespace std;
41 
42 namespace CWB {
43 
44 class STFT {
45 
46 public:
47 
48  STFT(wavearray<double> x, int nfft, int noverlap, TString ztype="amplitude",
49  TString fwindow="hann", double fparam=0.0, TString name="stft");
50  ~STFT();
51 
52  TCanvas* GetCanvas() {return canvas;}
53  TH2D* GetHistogram() {return h2;}
54 
55  void SetLogz(bool isLogz=true) {this->isLogz=isLogz;}
56  bool GetLogz() {return isLogz;}
57  TString GetZtype() {return ztype;}
58  void SetTitle(TString title) {h2->SetTitle(title);this->title=title;}
59  TString GetTitle() {return title;}
60  void SetPalette(int paletteId=1) {this->paletteId=paletteId;}
61  bool GetPaletteId() {return paletteId;}
62 
63  void Draw(double t1=0.0, double t2=0.0, double f1=0.0, double f2=0.0, double z1=0.0, double z2=0.0,
64  int dpaletteId = DUMMY_PALETTE_ID, Option_t* option = "colfz");
65  void Print(TString pname);
66 
67 private:
68 
69  void SetPlotStyle(int paletteId = 1);
70 
71  TCanvas* canvas;
72  TH2D* h2;
73 
74  bool isLogz;
77  int paletteId;
79 
80  double* window;
81 };
82 
83 } // end namespace
84 
85 #endif
#define DUMMY_PALETTE_ID
Definition: STFT.hh:38
int noverlap
Definition: TestDelta.C:20
void SetLogz(bool isLogz=true)
Definition: STFT.hh:55
TString ztype
Definition: STFT.hh:78
bool GetLogz()
Definition: STFT.hh:56
Definition: ced.hh:24
gx Draw(GWAT_TIME)
par[0] name
bool GetPaletteId()
Definition: STFT.hh:61
TString("c")
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
int nfft
Definition: TestDelta.C:19
return wmap canvas
int paletteId
Definition: STFT.hh:77
STL namespace.
TH2D * h2
Definition: STFT.hh:72
TString title
Definition: STFT.hh:75
TString GetZtype()
Definition: STFT.hh:57
MDC Print()
TCanvas * canvas
Definition: STFT.hh:71
TF1 * f2
Definition: cbc_plots.C:1710
TH2D * GetHistogram()
Definition: STFT.hh:53
TString GetTitle()
Definition: STFT.hh:59
char title[256]
Definition: SSeriesExample.C:1
bool isLogz
Definition: STFT.hh:74
double * window
Definition: STFT.hh:80
TCanvas * GetCanvas()
Definition: STFT.hh:52
TH1 * t1
void SetPalette(int paletteId=1)
Definition: STFT.hh:60
TString name
Definition: STFT.hh:76
void SetTitle(TString title)
Definition: STFT.hh:58