JakesFading.h

00001 //
00002 // This program is free software: you can redistribute it and/or modify
00003 // it under the terms of the GNU Lesser General Public License as published by
00004 // the Free Software Foundation, either version 3 of the License, or
00005 // (at your option) any later version.
00006 //
00007 // This program is distributed in the hope that it will be useful,
00008 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 // GNU Lesser General Public License for more details.
00011 //
00012 // You should have received a copy of the GNU Lesser General Public License
00013 // along with this program.  If not, see http://www.gnu.org/licenses/.
00014 //
00015 
00016 #ifndef JAKESFADING_H_
00017 #define JAKESFADING_H_
00018 
00019 #include "AnalogueModel.h"
00020 
00021 class JakesFading;
00022 
00029 class JakesFadingMapping: public SimpleConstMapping {
00030 protected:
00031   static DimensionSet dimensions;
00032 
00034   JakesFading* model;
00035 
00037   double relSpeed;
00038 
00039 public:
00044   JakesFadingMapping(JakesFading* model, double relSpeed,
00045              const Argument& start,
00046              const Argument& interval,
00047              const Argument& end):
00048     SimpleConstMapping(dimensions, start, end, interval),
00049     model(model), relSpeed(relSpeed)
00050   {}
00051 
00052   virtual double getValue(const Argument& pos) const;
00053 
00061   ConstMapping* constClone() const
00062   {
00063     return new JakesFadingMapping(*this);
00064   }
00065 };
00066 
00093 class JakesFading: public AnalogueModel {
00094 protected:
00095   friend class JakesFadingMapping;
00096 
00098   int fadingPaths;
00099 
00103   double* angleOfArrival;
00104 
00106   simtime_t* delay;
00107 
00109   Move* hostMove;
00110 
00112   double carrierFrequency;
00113 
00115   Argument interval;
00116 
00117 public:
00123   JakesFading(int fadingPaths, simtime_t delayRMS,
00124         Move* hostMove, double carrierFrequency,
00125         simtime_t interval);
00126   virtual ~JakesFading();
00127 
00128   virtual void filterSignal(Signal& s);
00129 };
00130 
00131 #endif /* JAKESFADING_H_ */