![]() |
User Manual, Developers Guide and API Documentation |
![]() |
00001 /******************************************************************************* 00002 * This file is part of openWNS (open Wireless Network Simulator) 00003 * _____________________________________________________________________________ 00004 * 00005 * Copyright (C) 2004-2007 00006 * Chair of Communication Networks (ComNets) 00007 * Kopernikusstr. 5, D-52074 Aachen, Germany 00008 * phone: ++49-241-80-27910, 00009 * fax: ++49-241-80-22242 00010 * email: info@openwns.org 00011 * www: http://www.openwns.org 00012 * _____________________________________________________________________________ 00013 * 00014 * openWNS is free software; you can redistribute it and/or modify it under the 00015 * terms of the GNU Lesser General Public License version 2 as published by the 00016 * Free Software Foundation; 00017 * 00018 * openWNS is distributed in the hope that it will be useful, but WITHOUT ANY 00019 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 00020 * A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 00021 * details. 00022 * 00023 * You should have received a copy of the GNU Lesser General Public License 00024 * along with this program. If not, see <http://www.gnu.org/licenses/>. 00025 * 00026 ******************************************************************************/ 00027 00028 #ifndef _FTFADING_STRATEGY_HPP 00029 #define _FTFADING_STRATEGY_HPP 00030 00031 #include <RISE/scenario/ftfading/JakesFadingGenerator.hpp> 00032 00033 #include <WNS/PyConfigViewCreator.hpp> 00034 #include <WNS/logger/Logger.hpp> 00035 #include <WNS/pyconfig/View.hpp> 00036 #include <WNS/PowerRatio.hpp> 00037 #include <WNS/simulator/Time.hpp> 00038 00039 namespace rise { namespace scenario { namespace ftfading { 00040 namespace tests { class FTFadingTest; } // declaration for friend 00042 class FTFading 00043 { 00044 friend class rise::scenario::ftfading::tests::FTFadingTest; 00045 public: 00046 FTFading(const wns::pyconfig::View& config); 00047 virtual ~FTFading(){}; 00048 00050 virtual wns::Ratio getFTFading(int _subCarrier) = 0; 00051 00052 typedef wns::PyConfigViewCreator<FTFading> FTFadingCreator; 00053 typedef wns::StaticFactory<FTFadingCreator> FTFadingFactory; 00054 double getSamplingTime() { return samplingTime; } 00055 int getNumberOfSubChannels() { return numberOfSubChannels; } 00056 protected: 00057 wns::logger::Logger logger; 00058 double samplingTime; 00059 //simTimeType samplingTime; 00060 //double samplingFrequency; // = 1.0/samplingTime 00061 int numberOfSubChannels; 00062 }; 00063 00065 class FTFadingOff : 00066 public FTFading 00067 { 00068 public: 00069 FTFadingOff(const wns::pyconfig::View& config); 00070 virtual ~FTFadingOff(){}; 00071 virtual wns::Ratio getFTFading(int); 00072 }; 00073 00075 class FTFadingJakes : 00076 public FTFading 00077 { 00078 friend class rise::scenario::ftfading::tests::FTFadingTest; 00079 public: 00080 FTFadingJakes(const wns::pyconfig::View& config); 00081 virtual ~FTFadingJakes(){}; 00082 virtual wns::Ratio getFTFading(int _subCarrier) = 0; 00083 virtual wns::simulator::Time Now() { return scheduler->getTime(); }; 00084 protected: 00085 double _dopFreq; 00086 int _numWaves; 00087 int _maxSamples; 00088 std::vector<JakesFadingGenerator*> jakesVector; 00089 wns::events::scheduler::Interface* scheduler; 00090 }; 00091 00095 class FTFadingFflat : 00096 public FTFadingJakes 00097 { 00098 public: 00099 FTFadingFflat(const wns::pyconfig::View& config); 00100 virtual ~FTFadingFflat(); 00101 virtual wns::Ratio getFTFading(int _subCarrier); 00102 protected: 00103 double currentPeriodTime; 00104 double subCarrierFading; 00105 wns::Ratio CurrentFading; 00106 }; 00107 00111 class FTFadingFuncorrelated : 00112 public FTFadingJakes 00113 { 00114 public: 00115 FTFadingFuncorrelated(const wns::pyconfig::View& config); 00116 virtual ~FTFadingFuncorrelated(){}; 00117 00118 virtual wns::Ratio getFTFading(int _subCarrier); 00119 00120 protected: 00121 std::vector<double> sampleIndex; 00122 std::vector<double> subCarrierFading; 00123 std::vector<wns::Ratio> currentFading; 00124 }; 00125 00130 class FTFadingFneighbourCorrelation : 00131 public FTFadingJakes 00132 { 00133 public: 00134 FTFadingFneighbourCorrelation(const wns::pyconfig::View& config); 00135 virtual ~FTFadingFneighbourCorrelation(){}; 00136 00137 wns::Ratio getFTFading(int _subCarrier); 00138 00139 protected: 00140 std::vector<double> sampleIndex; 00141 double currentSampleIndex; 00143 std::vector<double> subCarrierFading; 00144 std::vector<wns::Ratio> currentFading; 00145 00148 double _neighbourCorrelationFactor; 00149 }; 00150 }}} 00151 00152 #endif 00153 00154
1.5.5