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 TDSPAWGN_H 00019 #define TDSPAWGN_H 00020 00021 #include <TRandom.h> 00022 #include <TDSPOutput1.h> 00023 00028 class TDSPAwgn : public TDSPOutput1 { 00029 00030 private: 00031 00032 Double_t fTime; // number entries in the cumulated Input Signal Energy (depents on the sampling rate !) 00033 Double_t fInEnergy; // cumulated Input Signal Energy 00034 Double_t fEnergy; // cumulated Output Signal Energy 00035 Double_t fNoiseLevel; // sigma of the random gaussian noise 00036 00037 public: 00038 TDSPAwgn(char *s=NULL); 00039 ~TDSPAwgn(); 00040 00041 void SetNoiseLevel(Double_t n) { fNoiseLevel = n;}; // Set the Noise Level 00042 void SetNoisePower(Double_t n) { SetNoiseLevel(TMath::Sqrt(n));}; // Set the Noise Power 00043 Double_t GetNoiseLevel() { return fNoiseLevel;}; // Get the Noise Level 00044 Double_t GetNoisePower() { return fNoiseLevel*fNoiseLevel;}; // Get the Noise Power 00045 00046 Double_t GetInputSignalEnergy() { return fInEnergy;}; 00047 Double_t GetTime() const { return fTime;}; 00048 Double_t GetInputSignalPower() { return fInEnergy/fTime;}; 00049 Double_t GetOutputSignalEnergy() { return fEnergy; }; 00050 Double_t GetOutputSignalPower() { return fEnergy/fTime;}; 00051 Double_t GetSNR() { return GetInputSignalPower()/GetNoisePower();}; 00052 00053 00054 // Slots 00055 TDSPSignal* Update(TDSPSignal*); // Update-Slot 00056 void Reset(); // Reset-Slot 00057 00058 ClassDef(TDSPAwgn,1) 00059 00060 }; 00061 00062 #endif
1.3.2