![]() |
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 RISE_ANTENNA_BEAMFORMING_HPP 00029 #define RISE_ANTENNA_BEAMFORMING_HPP 00030 00031 #include <map> 00032 #include <vector> 00033 #include <boost/numeric/ublas/vector.hpp> 00034 #include <boost/numeric/ublas/matrix.hpp> 00035 #include <complex> 00036 00037 #include <WNS/distribution/Norm.hpp> 00038 #include <WNS/CandI.hpp> 00039 #include <RISE/antenna/Antenna.hpp> 00040 #include <RISE/misc/pointer.hpp> 00041 00042 namespace rise { namespace antenna { 00051 typedef std::vector<PatternPtr> PatternContainer; 00052 typedef std::map<TransmissionObjectPtr, PatternPtr> TO2PatternMap; 00053 class Beamforming : 00054 public Antenna 00055 { 00056 public: 00057 Beamforming(const wns::pyconfig::View& pyConfigView, 00058 Station* const station); 00059 00060 virtual ~Beamforming(); 00061 00062 virtual wns::Ratio getGain(const wns::Position& pos, 00063 const PatternPtr pattern) const; 00064 00065 virtual wns::Ratio getGain(const wns::Position& pos, 00066 const TransmissionObjectPtr& TO) const; 00067 00068 virtual std::map<rise::Station*, wns::CandI > 00069 calculateCandIsRx(const std::vector<Station*>& combination, 00070 wns::Power iInterPlusNoise); 00071 00072 virtual std::map<rise::Station*, wns::CandI> 00073 calculateCandIsTx(const std::map<Station*, wns::Power>& station2iIntercellPlusNoise, 00074 wns::Power xFriendlyness, 00075 wns::Power txPower, 00076 bool eirpLimited); 00077 00078 virtual double 00079 estimateDoA(Station* id); 00080 00081 virtual PatternPtr calculateAndSetBeam(Station* id, 00082 const std::vector<Station*>& undesired, 00083 wns::Power IinterPlusNoise); 00084 00094 virtual void setPowerReceivedForStation(Station* const id, 00095 const wns::Power power); 00105 virtual void setTxPowerForStation(Station* const id, 00106 const wns::Power power); 00107 00108 virtual void startReceiving(const TransmissionObjectPtr& TO, 00109 PatternPtr pattern); 00110 00111 virtual void stopReceiving(const TransmissionObjectPtr& TO); 00112 00113 enum layoutType 00114 { 00115 linear = 0, 00116 circular 00117 }; 00118 00119 virtual void drawRadiationPattern(std::string file, 00120 PatternPtr pattern); 00121 00122 protected: 00123 virtual wns::Ratio pd_getGainEntry(unsigned long int index, 00124 PatternPtr patternId) const; 00125 unsigned long int pd_noAntennaElements; 00126 std::map <Station*, wns::Power> pd_lastPowerReceived; 00127 std::map <Station*, wns::Power> pd_lastTxPower; 00128 std::map <Station*, double> pd_azimuthAngles; 00129 TO2PatternMap pd_receivedTO2PatternMap; 00130 layoutType arrayLayout; 00131 00132 virtual void drawRadiationPattern() const; 00133 00134 private: 00135 00136 std::vector<boost::numeric::ublas::vector<std::complex<double> >*> steervectors; 00137 void p_herm_rest(boost::numeric::ublas::matrix<std::complex<double> >& c, const unsigned long int m) const; 00138 00139 PatternPtr p_calculateBeam(Station* id, 00140 const std::vector<Station*>& undesired, 00141 wns::Power IinterPlusNoise); 00142 double calculatePhaseDelta(int antennaNo, double stationPhi) const; 00143 00147 double positionErrorVariance; 00148 00152 wns::distribution::Norm dis; 00153 }; 00154 }} 00155 #endif // NOT defined RISE_ANTENNA_BEAMFORMING_HPP 00156 00157
1.5.5