Main Page | Class Hierarchy | Alphabetical List | Data Structures | File List | Data Fields | Globals

TDSPFunction.h

Go to the documentation of this file.
00001 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00018 #ifndef TDSPFUNCTION_H
00019 #define TDSPFUNCTION_H
00020 
00021 #include <TDSPOutput1.h>
00022 
00028 class TDSPFunction : public TDSPOutput1  {
00029 
00030  protected:
00031   
00032   Double_t fInputSamplingRate; // The Sampling Rate of the actual input signal
00033 
00034  public: 
00035   TDSPFunction(char *name = NULL);
00036   ~TDSPFunction();
00037 
00038   virtual TComplex F(TComplex);
00039   TDSPSignal* Apply(TDSPSignal*);
00040   TDSPSignal* Update(TDSPSignal*);
00041 
00042   ClassDef(TDSPFunction,1)
00043 
00044 };
00045 
00046 inline TDSPSignal* TDSPFunction::Apply(TDSPSignal *input) {
00047   TDSPSignal *output = GetSignal();
00048   Int_t len=input->GetLen();
00049   output->SetLen(len);
00050 
00051   // Configure the output signal on the base
00052   // of the input signal
00053   //
00054   output->Configure(input);
00055   
00056   // Some Child classes would need the sampling rate 
00057   // of the input signal (stochastic models for example ...)
00058   //
00059   fInputSamplingRate = input->GetSamplingRate();
00060 
00061   TComplex   *ivec   =  input->GetVec();
00062   TComplex   *ovec   = output->GetVec();
00063   for(register Int_t i=0;i<len;i++) 
00064     ovec[i] = F(ivec[i]);
00065   
00066   return output;
00067 }
00068 
00069 inline TDSPSignal* TDSPFunction::Update(TDSPSignal *input) {
00070 
00071   TDSPSignal *output = Apply(input);
00072   Emit(Signal_NewData,output);
00073   return output;
00074 }
00075 
00076 // In this Base Class we make a identity mapping
00077 //
00078 inline TComplex TDSPFunction::F(TComplex in) {
00079   return in;
00080 }
00081 #endif

Generated on Fri Apr 23 16:23:43 2004 by doxygen 1.3.2