TSpectrumTransform.h

Go to the documentation of this file.
00001 // @(#)root/spectrum:$Id: TSpectrumTransform.h 20882 2007-11-19 11:31:26Z rdm $
00002 // Author: Miroslav Morhac   25/09/06
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2006, Rene Brun and Fons Rademakers.               *
00006  * All rights reserved.                                                  *
00007  *                                                                       *
00008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00010  *************************************************************************/
00011 #ifndef ROOT_TSpectrumTransform
00012 #define ROOT_TSpectrumTransform
00013 
00014 //////////////////////////////////////////////////////////////////////////
00015 //                                                                      //
00016 // TSpectrumTransform                                                   //
00017 //                                                                      //
00018 // Class to carry out transforms of 1D spectra, its filtering and       //
00019 // enhancement. It allows to calculate classic Fourier, Cosine, Sin,    //
00020 // Hartley, Walsh, Haar transforms as well as mixed transforms (Fourier-//
00021 // Walsh, Fourier-Haar, Walsh-Haar, Cosine-Walsh, Cosine-Haar, Sin-Walsh//
00022 // and Sin-Haar). All the transforms are fast.                          //
00023 //                                                                      //
00024 //////////////////////////////////////////////////////////////////////////
00025 
00026 #ifndef ROOT_TNamed
00027 #include "TNamed.h"
00028 #endif
00029 
00030 class TH1;
00031 
00032 class TSpectrumTransform :  public TNamed {
00033 
00034 protected:
00035    Int_t     fSize;                      //length of transformed data
00036    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)
00037    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
00038    Int_t     fDirection;                 //forward or inverse transform
00039    Int_t     fXmin;                      //first channel of filtered or enhanced region
00040    Int_t     fXmax;                      //last channel of filtered or enhanced region
00041    Float_t   fFilterCoeff;               //value set in the filtered region
00042    Float_t   fEnhanceCoeff;              //multiplication coefficient applied in enhanced region;
00043 
00044 public:
00045    enum {
00046        kTransformHaar =0,
00047        kTransformWalsh =1,
00048        kTransformCos =2,
00049        kTransformSin =3,
00050        kTransformFourier =4,
00051        kTransformHartley =5,
00052        kTransformFourierWalsh =6,
00053        kTransformFourierHaar =7,
00054        kTransformWalshHaar =8,
00055        kTransformCosWalsh =9,
00056        kTransformCosHaar =10,
00057        kTransformSinWalsh =11,
00058        kTransformSinHaar =12,
00059        kTransformForward =0,
00060        kTransformInverse =1
00061    };
00062    TSpectrumTransform();
00063    TSpectrumTransform(Int_t size);
00064    virtual ~TSpectrumTransform();
00065 
00066 protected:
00067    void                BitReverse(float *working_space,Int_t num);
00068    void                BitReverseHaar(float *working_space,Int_t shift,Int_t num,Int_t start);
00069    void                Fourier(float *working_space,Int_t num,Int_t hartley,Int_t direction,Int_t zt_clear);
00070    Int_t               GeneralExe(float *working_space,Int_t zt_clear,Int_t num,Int_t degree,Int_t type);
00071    Int_t               GeneralInv(float *working_space,Int_t num,Int_t degree,Int_t type);
00072    void                Haar(float *working_space,Int_t num,Int_t direction);
00073    void                Walsh(float *working_space,Int_t num);
00074 
00075 public:
00076    void                Enhance(const float *source, float *destVector);
00077    void                FilterZonal(const float *source, float *destVector);
00078    void                SetDirection(Int_t direction);
00079    void                SetEnhanceCoeff(Float_t enhanceCoeff);
00080    void                SetFilterCoeff(Float_t filterCoeff);
00081    void                SetRegion(Int_t xmin, Int_t xmax);
00082    void                SetTransformType(Int_t transType, Int_t degree);
00083    void                Transform(const float *source, float *destVector);
00084 
00085    ClassDef(TSpectrumTransform,1)  //Spectrum Transformer, it calculates classic orthogonal 1D transforms
00086 };
00087 
00088 
00089 #endif
00090 

Generated on Tue Jul 5 14:24:33 2011 for ROOT_528-00b_version by  doxygen 1.5.1