INET Framework for OMNeT++/OMNEST
inet::physicallayer::Ieee80211OfdmModulator Class Reference

#include <Ieee80211OfdmModulator.h>

Inheritance diagram for inet::physicallayer::Ieee80211OfdmModulator:
inet::physicallayer::IModulator inet::IPrintableObject

Public Member Functions

 Ieee80211OfdmModulator (const Ieee80211OfdmModulation *subcarrierModulation, unsigned int polarityVectorOffset)
 
virtual const ITransmissionSymbolModelmodulate (const ITransmissionBitModel *bitModel) const override
 
const Ieee80211OfdmModulationgetModulation () const override
 
virtual std::ostream & printToStream (std::ostream &stream, int level, int evFlags=0) const override
 Prints this object to the provided output stream. More...
 
- Public Member Functions inherited from inet::IPrintableObject
virtual ~IPrintableObject ()
 
virtual std::string printToString () const
 
virtual std::string printToString (int level, int evFlags=0) const
 
virtual std::string getInfoStringRepresentation (int evFlags=0) const
 
virtual std::string getDetailStringRepresentation (int evFlags=0) const
 
virtual std::string getDebugStringRepresentation (int evFlags=0) const
 
virtual std::string getTraceStringRepresentation (int evFlags=0) const
 
virtual std::string getCompleteStringRepresentation (int evFlags=0) const
 

Static Public Attributes

static const ApskSymbol negativePilotSubcarrier
 
static const ApskSymbol positivePilotSubcarrier
 

Protected Member Functions

int getSubcarrierIndex (int ofdmSymbolIndex) const
 
void insertPilotSubcarriers (Ieee80211OfdmSymbol *ofdmSymbol, int symbolID) const
 

Protected Attributes

const Ieee80211OfdmModulationsubcarrierModulation
 
unsigned int pilotSubcarrierPolarityVectorOffset
 

Static Protected Attributes

static const double pilotSubcarrierPolarityVector [127]
 

Additional Inherited Members

- Public Types inherited from inet::IPrintableObject
enum  PrintLevel {
  PRINT_LEVEL_TRACE, PRINT_LEVEL_DEBUG, PRINT_LEVEL_DETAIL, PRINT_LEVEL_INFO,
  PRINT_LEVEL_COMPLETE = INT_MIN
}
 
enum  PrintFlag { PRINT_FLAG_FORMATTED = (1 << 0), PRINT_FLAG_MULTILINE = (1 << 1) }
 

Constructor & Destructor Documentation

◆ Ieee80211OfdmModulator()

inet::physicallayer::Ieee80211OfdmModulator::Ieee80211OfdmModulator ( const Ieee80211OfdmModulation subcarrierModulation,
unsigned int  polarityVectorOffset 
)
34  :
36  pilotSubcarrierPolarityVectorOffset(polarityVectorOffset)
37 {
38 }

Member Function Documentation

◆ getModulation()

const Ieee80211OfdmModulation* inet::physicallayer::Ieee80211OfdmModulator::getModulation ( ) const
inlineoverridevirtual

◆ getSubcarrierIndex()

int inet::physicallayer::Ieee80211OfdmModulator::getSubcarrierIndex ( int  ofdmSymbolIndex) const
protected
49 {
50  // This is the translated version of the M(k) function defined in 18.3.5.10 OFDM modulation: (18-23) equation.
51  // We translate it by 26 since its range is [-26,26] and we use subcarrier indices as array indices.
52  if (ofdmSymbolIndex >= 0 && ofdmSymbolIndex <= 4)
53  return ofdmSymbolIndex;
54  else if (ofdmSymbolIndex >= 5 && ofdmSymbolIndex <= 17)
55  return ofdmSymbolIndex + 1;
56  else if (ofdmSymbolIndex >= 18 && ofdmSymbolIndex <= 23)
57  return ofdmSymbolIndex + 2;
58  else if (ofdmSymbolIndex >= 24 && ofdmSymbolIndex <= 29)
59  return ofdmSymbolIndex + 3;
60  else if (ofdmSymbolIndex >= 30 && ofdmSymbolIndex <= 42)
61  return ofdmSymbolIndex + 4;
62  else if (ofdmSymbolIndex >= 43 && ofdmSymbolIndex <= 47)
63  return ofdmSymbolIndex + 5;
64  else
65  throw cRuntimeError("The domain of the M(k) (k = %d) function is [0,47]", ofdmSymbolIndex);
66 }

Referenced by modulate().

◆ insertPilotSubcarriers()

void inet::physicallayer::Ieee80211OfdmModulator::insertPilotSubcarriers ( Ieee80211OfdmSymbol ofdmSymbol,
int  symbolID 
) const
protected
69 {
70  ofdmSymbol->pushApskSymbol(pilotSubcarrierPolarityVector[symbolID % 127] == 1 ? &positivePilotSubcarrier : &negativePilotSubcarrier, 5);
71  ofdmSymbol->pushApskSymbol(pilotSubcarrierPolarityVector[symbolID % 127] == 1 ? &positivePilotSubcarrier : &negativePilotSubcarrier, 19);
72  ofdmSymbol->pushApskSymbol(pilotSubcarrierPolarityVector[symbolID % 127] == 1 ? &positivePilotSubcarrier : &negativePilotSubcarrier, 33);
73  ofdmSymbol->pushApskSymbol(pilotSubcarrierPolarityVector[symbolID % 127] == 1 ? &negativePilotSubcarrier : &positivePilotSubcarrier, 47);
74 }

Referenced by modulate().

◆ modulate()

const ITransmissionSymbolModel * inet::physicallayer::Ieee80211OfdmModulator::modulate ( const ITransmissionBitModel bitModel) const
overridevirtual

Implements inet::physicallayer::IModulator.

77 {
78  std::vector<const ISymbol *> *ofdmSymbols = new std::vector<const ISymbol *>();
79  const ApskModulationBase *modulationScheme = subcarrierModulation->getSubcarrierModulation();
80  const BitVector *bits = bitModel->getBits();
81  // Divide the resulting coded and interleaved data string into groups of N_BPSC bits.
82  unsigned int nBPSC = modulationScheme->getCodeWordSize();
83  ShortBitVector bitGroup;
84  std::vector<const ApskSymbol *> apskSymbols;
85  for (unsigned int i = 0; i < bits->getSize(); i++) {
86  // For each of the bit groups, convert the bit group into a complex number according
87  // to the modulation encoding tables
88  bitGroup.setBit(i % nBPSC, bits->getBit(i));
89  if (i % nBPSC == nBPSC - 1) {
90  const ApskSymbol *apskSymbol = modulationScheme->mapToConstellationDiagram(bitGroup);
91  apskSymbols.push_back(apskSymbol);
92  }
93  }
94  // Divide the complex number string into groups of 48 complex numbers.
95  // Each such group is associated with one OFDM symbol.
96  for (unsigned int i = 0; i < apskSymbols.size(); i += NUMBER_OF_OFDM_DATA_SUBCARRIERS) {
97  Ieee80211OfdmSymbol *ofdmSymbol = new Ieee80211OfdmSymbol();
98  // In each group, the complex numbers are numbered 0 to 47 and mapped hereafter into OFDM
99  // subcarriers numbered -26 to -22, -20 to -8, -6 to -1, 1 to 6, 8 to 20, and 22 to 26.
100  // The 0 subcarrier, associated with center frequency, is omitted and filled with the value 0.
101  for (unsigned int j = 0; j < NUMBER_OF_OFDM_DATA_SUBCARRIERS; j++) {
102  int subcarrierIndex = getSubcarrierIndex(j);
103  ofdmSymbol->pushApskSymbol(apskSymbols.at(j + i), subcarrierIndex);
104  }
106  EV_DEBUG << "Modulated OFDM symbol: " << *ofdmSymbol << endl;
107  ofdmSymbols->push_back(ofdmSymbol);
108  }
109  return new Ieee80211OfdmTransmissionSymbolModel(1, NaN, ofdmSymbols->size() - 1, NaN, ofdmSymbols, modulationScheme, modulationScheme);
110 }

Referenced by inet::physicallayer::Ieee80211LayeredOfdmTransmitter::encodeAndModulate(), and inet::physicallayer::Ieee80211OfdmModulatorModule::modulate().

◆ printToStream()

std::ostream & inet::physicallayer::Ieee80211OfdmModulator::printToStream ( std::ostream &  stream,
int  level,
int  evFlags = 0 
) const
overridevirtual

Prints this object to the provided output stream.

Reimplemented from inet::IPrintableObject.

41 {
42  stream << "Ieee80211OfdmModulator";
43  if (level <= PRINT_LEVEL_TRACE)
45  return stream;
46 }

Referenced by inet::physicallayer::Ieee80211OfdmModulatorModule::printToStream().

Member Data Documentation

◆ negativePilotSubcarrier

const ApskSymbol inet::physicallayer::Ieee80211OfdmModulator::negativePilotSubcarrier
static

Referenced by insertPilotSubcarriers().

◆ pilotSubcarrierPolarityVector

const double inet::physicallayer::Ieee80211OfdmModulator::pilotSubcarrierPolarityVector
staticprotected
Initial value:
= {
1, 1, 1, 1, -1, -1, -1, 1, -1, -1, -1, -1, 1, 1, -1, 1, -1, -1, 1, 1, -1, 1, 1, -1, 1, 1, 1, 1, 1, 1, -1, 1,
1, 1, -1, 1, 1, -1, -1, 1, 1, 1, -1, 1, -1, -1, -1, 1, -1, 1, -1, -1, 1, -1, -1, 1, 1, 1, 1, 1, -1, -1, 1, 1,
-1, -1, 1, -1, 1, -1, 1, 1, -1, -1, -1, 1, 1, -1, -1, -1, -1, 1, -1, -1, 1, -1, 1, 1, 1, 1, -1, 1, -1, 1, -1, 1,
-1, -1, -1, -1, -1, 1, -1, 1, 1, -1, 1, -1, 1, 1, 1, -1, -1, 1, -1, -1, -1, 1, 1, 1, -1, -1, -1, -1, -1, -1, -1
}

Referenced by insertPilotSubcarriers().

◆ pilotSubcarrierPolarityVectorOffset

unsigned int inet::physicallayer::Ieee80211OfdmModulator::pilotSubcarrierPolarityVectorOffset
protected

Referenced by modulate().

◆ positivePilotSubcarrier

const ApskSymbol inet::physicallayer::Ieee80211OfdmModulator::positivePilotSubcarrier
static

Referenced by insertPilotSubcarriers().

◆ subcarrierModulation

const Ieee80211OfdmModulation* inet::physicallayer::Ieee80211OfdmModulator::subcarrierModulation
protected

Referenced by modulate(), and printToStream().


The documentation for this class was generated from the following files:
inet::physicallayer::ApskModulationBase::getCodeWordSize
virtual unsigned int getCodeWordSize() const override
Definition: ApskModulationBase.h:37
inet::physicallayer::Ieee80211OfdmModulator::pilotSubcarrierPolarityVectorOffset
unsigned int pilotSubcarrierPolarityVectorOffset
Definition: Ieee80211OfdmModulator.h:30
inet::physicallayer::Ieee80211OfdmModulator::subcarrierModulation
const Ieee80211OfdmModulation * subcarrierModulation
Definition: Ieee80211OfdmModulator.h:28
NUMBER_OF_OFDM_DATA_SUBCARRIERS
#define NUMBER_OF_OFDM_DATA_SUBCARRIERS
Definition: Ieee80211OfdmDefs.h:15
inet::physicallayer::Ieee80211OfdmModulator::positivePilotSubcarrier
static const ApskSymbol positivePilotSubcarrier
Definition: Ieee80211OfdmModulator.h:25
inet::physicallayer::Ieee80211OfdmModulator::insertPilotSubcarriers
void insertPilotSubcarriers(Ieee80211OfdmSymbol *ofdmSymbol, int symbolID) const
Definition: Ieee80211OfdmModulator.cc:68
inet::printFieldToString
std::string printFieldToString(const IPrintableObject *object, int level, int evFlags=0)
Definition: IPrintableObject.h:98
inet::physicallayer::Ieee80211OfdmModulator::pilotSubcarrierPolarityVector
static const double pilotSubcarrierPolarityVector[127]
Definition: Ieee80211OfdmModulator.h:29
EV_FIELD
#define EV_FIELD(...)
Definition: INETDefs.h:112
NaN
#define NaN
Definition: INETMath.h:91
inet::physicallayer::Ieee80211OfdmModulation::getSubcarrierModulation
const ApskModulationBase * getSubcarrierModulation() const
Definition: Ieee80211OfdmModulation.h:24
inet::IPrintableObject::PRINT_LEVEL_TRACE
@ PRINT_LEVEL_TRACE
Definition: IPrintableObject.h:22
inet::evFlags
int evFlags
Definition: INETDefs.cc:12
inet::physicallayer::Ieee80211OfdmModulator::negativePilotSubcarrier
static const ApskSymbol negativePilotSubcarrier
Definition: Ieee80211OfdmModulator.h:24
inet::physicallayer::Ieee80211OfdmModulator::getSubcarrierIndex
int getSubcarrierIndex(int ofdmSymbolIndex) const
Definition: Ieee80211OfdmModulator.cc:48