Logo Coherent WaveBurst  
Reference Guide
Logo
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
waverdc.hh
Go to the documentation of this file.
1 /*-------------------------------------------------------
2  * Package: Wavelet Analysis Tool
3  * File name: waverdc.hh
4  *-------------------------------------------------------
5 */
6 
7 #ifndef WAVERDC_HH
8 #define WAVERDC_HH
9 
10 #include <iostream>
11 #include "wavearray.hh"
12 using namespace std;
13 
17 
18 class WaveRDC : public wavearray<unsigned int>
19 {
20 public:
21 
22  int nSample; // number of samples in comressed data array
23  int nLayer; // number of layers in comressed data array
24  int optz; // current layer compression options
25 
26  WaveRDC();
27 
28  virtual ~WaveRDC();
29 
30  WaveRDC& operator =(const WaveRDC &); // assign
31  WaveRDC& operator+=(const WaveRDC &); // concatenate
32 // WaveRDC& operator<<(const WaveRDC &); // copy
33 
34  WaveRDC& operator-=(const WaveRDC &x){return *this;}; // no operation!
35  WaveRDC& operator*=(const WaveRDC &x){return *this;}; // no operation!
36  WaveRDC& operator =(const unsigned int x){return *this;}; // no operation!
37  WaveRDC& operator+=(const unsigned int x){return *this;}; // no operation!
38  WaveRDC& operator-=(const unsigned int x){return *this;}; // no operation!
39  WaveRDC& operator*=(const unsigned int x){return *this;}; // no operation!
40 
41  virtual int DumpRDC(const char*, int = 0);
42 
43  int Compress(const waveShort &);
44 // int Compress(const waveShort &, double);
45 // int Compress(const waveFloat &, double);
46  int Compress(const waveDouble &, double);
47 
48  int unCompress(waveFloat &, int level = 1);
49  int unCompress(waveDouble &, int level = 1);
50  int unCompress(wavearray<int> &, int level = 1);
51 
52  void Dir(int v = 1);
53 
54  float getScale(const waveDouble &, double);
55  void getShort(const waveDouble &, waveShort &);
56  void getSign(const waveDouble &, waveShort &);
57 
58 //private:
59 
60  int freebits; // free bits in the last word of current block
61  int kLong; // encoding bit length for large integers
62  int kShort; // encoding bit length of short word
63  int kBSW; // length of the Block Service Word
64  short Bias; // constant bias subtracted from the data
65  short Zero; // number that encodes 0;
66  float Scale; // coefficient to scale data
67  float rmsLimit; // limit on the data rms
68 
69  int Push(short *, int, unsigned int *, int &, int, int);
70  void Push(unsigned int &, unsigned int *, int &, int);
71 
72  int Pop(int *, int, int &, int, int);
73  void Pop(unsigned int &, int &, int);
74 
75 
76  inline int getOPTZ() {return optz;};
77  inline int wabs(int i) {return i>0 ? i : -i;}
78  inline short wabs(short i) {return i>0 ? i : -i;}
79  inline int wint(double a) {return int(2*a)-int(a);}
80 
81  inline size_t getLSW(size_t opt){ // get length of Layer Service Word (size_t)
82  size_t n = 2;
83  if(opt & 0x2 ) n++;
84  if((opt & 0x8) && (opt & 0x3)) n++;
85  if(opt & 0x10) n++;
86  return n;
87  }
88 
89  ClassDef(WaveRDC,1)
90 
91 };
92 
93 
94 #endif
95 
96 
97 
98 
99 
100 
101 
102 
WaveRDC & operator*=(const unsigned int x)
Definition: waverdc.hh:39
float rmsLimit
Definition: waverdc.hh:67
int optz
Definition: waverdc.hh:24
int kShort
Definition: waverdc.hh:62
wavearray< double > a(hp.size())
WSeries< float > v[nIFO]
Definition: cwb_net.C:62
int wint(double a)
Definition: waverdc.hh:79
int n
Definition: cwb_net.C:10
int getOPTZ()
Definition: waverdc.hh:76
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.
size_t getLSW(size_t opt)
Definition: waverdc.hh:81
int freebits
Definition: waverdc.hh:60
int unCompress(int *in, wavearray< float > &out)
Definition: lossy.cc:158
i drho i
short wabs(short i)
Definition: waverdc.hh:78
WaveRDC & operator+=(const unsigned int x)
Definition: waverdc.hh:37
wavearray< double > waveDouble
Definition: waverdc.hh:16
wavearray< short > waveShort
Definition: waverdc.hh:14
WaveRDC & operator-=(const unsigned int x)
Definition: waverdc.hh:38
WaveRDC & operator-=(const WaveRDC &x)
Definition: waverdc.hh:34
int nLayer
Definition: waverdc.hh:23
i() int(T_cor *100))
int kLong
Definition: waverdc.hh:61
short Bias
Definition: waverdc.hh:64
wavearray< float > waveFloat
Definition: waverdc.hh:15
int kBSW
Definition: waverdc.hh:63
int wabs(int i)
Definition: waverdc.hh:77
WaveRDC & operator*=(const WaveRDC &x)
Definition: waverdc.hh:35
short Zero
Definition: waverdc.hh:65
float Scale
Definition: waverdc.hh:66
int nSample
Definition: waverdc.hh:22
int Compress(wavearray< double > &in, int *&out, int Lwt, int Lbt, const double g1, const double g2, int np1, int np2)
Definition: lossy.cc:18