Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
TSpectrumTransform.h
Go to the documentation of this file.
1 // @(#)root/spectrum:$Id$
2 // Author: Miroslav Morhac 25/09/06
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2006, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 #ifndef ROOT_TSpectrumTransform
12 #define ROOT_TSpectrumTransform
13 
14 #include "TNamed.h"
15 
16 class TH1;
17 
18 class TSpectrumTransform : public TNamed {
19 
20 protected:
21  Int_t fSize; ///< length of transformed data
22  Int_t fTransformType; ///< type of transformation (Haar, Walsh, Cosine, Sine, Fourier, Hartley, Fourier-Walsh, Fourier-Haar, Walsh-Haar, Cosine-Walsh, Cosine-Haar, Sine-Walsh, Sine-Haar)
23  Int_t fDegree; ///< degree of mixed transform, applies only for Fourier-Walsh, Fourier-Haar, Walsh-Haar, Cosine-Walsh, Cosine-Haar, Sine-Walsh, Sine-Haar transforms
24  Int_t fDirection; ///< forward or inverse transform
25  Int_t fXmin; ///< first channel of filtered or enhanced region
26  Int_t fXmax; ///< last channel of filtered or enhanced region
27  Double_t fFilterCoeff; ///< value set in the filtered region
28  Double_t fEnhanceCoeff; ///< multiplication coefficient applied in enhanced region;
29 
30 public:
31  enum {
32  kTransformHaar =0,
33  kTransformWalsh =1,
34  kTransformCos =2,
35  kTransformSin =3,
36  kTransformFourier =4,
37  kTransformHartley =5,
38  kTransformFourierWalsh =6,
39  kTransformFourierHaar =7,
40  kTransformWalshHaar =8,
41  kTransformCosWalsh =9,
42  kTransformCosHaar =10,
43  kTransformSinWalsh =11,
44  kTransformSinHaar =12,
45  kTransformForward =0,
46  kTransformInverse =1
47  };
48  TSpectrumTransform();
49  TSpectrumTransform(Int_t size);
50  virtual ~TSpectrumTransform();
51 
52 protected:
53  void BitReverse(Double_t *working_space,Int_t num);
54  void BitReverseHaar(Double_t *working_space,Int_t shift,Int_t num,Int_t start);
55  void Fourier(Double_t *working_space,Int_t num,Int_t hartley,Int_t direction,Int_t zt_clear);
56  Int_t GeneralExe(Double_t *working_space,Int_t zt_clear,Int_t num,Int_t degree,Int_t type);
57  Int_t GeneralInv(Double_t *working_space,Int_t num,Int_t degree,Int_t type);
58  void Haar(Double_t *working_space,Int_t num,Int_t direction);
59  void Walsh(Double_t *working_space,Int_t num);
60 
61 public:
62  void Enhance(const Double_t *source, Double_t *destVector);
63  void FilterZonal(const Double_t *source, Double_t *destVector);
64  void SetDirection(Int_t direction);
65  void SetEnhanceCoeff(Double_t enhanceCoeff);
66  void SetFilterCoeff(Double_t filterCoeff);
67  void SetRegion(Int_t xmin, Int_t xmax);
68  void SetTransformType(Int_t transType, Int_t degree);
69  void Transform(const Double_t *source, Double_t *destVector);
70 
71  ClassDef(TSpectrumTransform,1) //Spectrum Transformer, it calculates classic orthogonal 1D transforms
72 };
73 
74 
75 #endif
76