TSpectrum2Transform.h

Go to the documentation of this file.
00001 // @(#)root/spectrum:$Id: TSpectrum2Transform.h 20882 2007-11-19 11:31:26Z rdm $
00002 // Author: Miroslav Morhac   25/09/06
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2000, 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_TSpectrum2Transform
00012 #define ROOT_TSpectrum2Transform
00013 
00014 //////////////////////////////////////////////////////////////////////////
00015 //                                                                      //
00016 // TSpectrum2Transform                                                  //
00017 //                                                                      //
00018 // Class to carry out transforms of 2D 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 TSpectrum2Transform : public TObject {
00031 protected:
00032    Int_t     fSizeX;                      //x length of transformed data
00033    Int_t     fSizeY;                      //y length of transformed data   
00034    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)
00035    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
00036    Int_t     fDirection;                  //forward or inverse transform
00037    Int_t     fXmin;                       //first channel x of filtered or enhanced region
00038    Int_t     fXmax;                       //last channel x of filtered or enhanced region
00039    Int_t     fYmin;                       //first channel y of filtered or enhanced region
00040    Int_t     fYmax;                       //last channel y 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 public:
00044    enum {
00045        kTransformHaar =0,
00046        kTransformWalsh =1,
00047        kTransformCos =2,
00048        kTransformSin =3,
00049        kTransformFourier =4,
00050        kTransformHartley =5,
00051        kTransformFourierWalsh =6,
00052        kTransformFourierHaar =7,
00053        kTransformWalshHaar =8,
00054        kTransformCosWalsh =9,
00055        kTransformCosHaar =10,
00056        kTransformSinWalsh =11,
00057        kTransformSinHaar =12,
00058        kTransformForward =0,
00059        kTransformInverse =1
00060    };
00061    TSpectrum2Transform();
00062    TSpectrum2Transform(Int_t sizeX, Int_t sizeY);
00063    virtual ~TSpectrum2Transform();
00064    
00065 protected:   
00066    void                BitReverse(Float_t *working_space,Int_t num);
00067    void                BitReverseHaar(Float_t *working_space,Int_t shift,Int_t num,Int_t start);
00068    void                FourCos2(Float_t **working_matrix,Float_t *working_vector,Int_t numx,Int_t numy,Int_t direction,Int_t type);   
00069    void                Fourier(Float_t *working_space,Int_t num,Int_t hartley,Int_t direction,Int_t zt_clear);
00070    void                General2(Float_t **working_matrix,Float_t *working_vector,Int_t numx,Int_t numy,Int_t direction,Int_t type,Int_t degree);   
00071    Int_t               GeneralExe(Float_t *working_space,Int_t zt_clear,Int_t num,Int_t degree,Int_t type);
00072    Int_t               GeneralInv(Float_t *working_space,Int_t num,Int_t degree,Int_t type);
00073    void                Haar(Float_t *working_space,Int_t num,Int_t direction);
00074    void                HaarWalsh2(Float_t **working_matrix,Float_t *working_vector,Int_t numx,Int_t numy,Int_t direction,Int_t type);
00075    void                Walsh(Float_t *working_space,Int_t num);   
00076 
00077 public:
00078    void                Enhance(const Float_t **fSource, Float_t **fDest);
00079    void                FilterZonal(const Float_t **fSource, Float_t **fDest);
00080    void                SetDirection(Int_t direction);
00081    void                SetEnhanceCoeff(Float_t enhanceCoeff);
00082    void                SetFilterCoeff(Float_t filterCoeff);
00083    void                SetRegion(Int_t xmin, Int_t xmax, Int_t ymin, Int_t ymax);
00084    void                SetTransformType(Int_t transType, Int_t degree);
00085    void                Transform(const Float_t **fSource, Float_t **fDest);
00086 
00087    ClassDef(TSpectrum2Transform,1)  //Spectrum2 Transformer, it calculates classic orthogonal 2D transforms
00088 };
00089 
00090 #endif

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