Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

noisegenerator.h

Go to the documentation of this file.
00001 /***************************************************************************
00002                           noisegenerator.h  -  description
00003                              -------------------
00004     begin                : Thu Jun 26 2003
00005     copyright            : (C) 2003 by Peter Haase
00006     email                : p.haase@tuhh.de
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This library is free software; you can redistribute it and/or         *
00012  *   modify it under the terms of the GNU Lesser General Public            *
00013  *   License as published by the Free Software Foundation; either          *
00014  *   version 2.1 of the License, or (at your option) any later version.    *
00015  *                                                                         *
00016  *   This library is distributed in the hope that it will be useful,       *
00017  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00018  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
00019  *   Lesser General Public License for more details.                       *
00020  *                                                                         *
00021  *   You should have received a copy of the GNU Lesser General Public      *
00022  *   License along with this library; if not, write to the Free Software   *
00023  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston,                 *
00024  *   MA  02111-1307  USA                                                   *
00025  *                                                                         *
00026  ***************************************************************************/
00027 
00028 #ifndef NOISEGENERATOR_H
00029 #define NOISEGENERATOR_H
00030 
00031 #include "basicdevice.h"
00032 
00033 //Forward declaration:
00034 namespace simth
00035 {
00036 class GaussRng;
00037 }
00038 
00039 
00040 namespace simthlib
00041 {
00042 
00051 class NoiseGenerator : public simth::Device
00052 {
00053 
00054   public:
00055 
00056     NoiseGenerator(int deviceID, simth::DeviceSystemIntf* system,
00057                    const simth::PropertyList& pl = simth::PropertyList());
00058 
00059     virtual ~NoiseGenerator();
00060 
00061     virtual void updateInputLengths();
00062     virtual void updateOutputLengths();
00063 
00067     virtual void setSNR(double snr) = 0;
00068 
00069     virtual void print(std::ostream &os) const ;
00070 
00071     static void init(const std::string fileName, simth::Device** dev,
00072                      simth::DeviceSystemIntf* sysPtr, int ID,
00073                      const std::string& regionQualifier = "");
00074 
00075 };
00076 
00077 
00083 template<class T>
00084 class BasebandAwgnGenerator : public NoiseGenerator
00085 {
00086   public:
00087 
00088     BasebandAwgnGenerator(int deviceID, simth::DeviceSystemIntf* system,
00089                           const simth::PropertyList& pl = simth::PropertyList());
00090 
00091     ~BasebandAwgnGenerator();
00092 
00093     virtual void process();
00094 
00101     virtual void setSNR(double snr);
00102 
00103     virtual void print(std::ostream &os) const ;
00104 
00105     static void init(const std::string fileName, simth::Device** dev,
00106                      simth::DeviceSystemIntf* sysPtr, int ID,
00107                      const std::string& regionQualifier = "");
00108 
00109   private:
00110 
00114     double getGauss() const;
00115 
00118     simth::GaussRng* gauss;
00119 
00120 };
00121 
00122 }
00123 
00124 #endif

Generated on Tue Aug 9 14:35:11 2005 for simtheticlib by  doxygen 1.4.1