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

#include <APSKLayeredErrorModel.h>

Inheritance diagram for inet::physicallayer::APSKLayeredErrorModel:
inet::physicallayer::LayeredErrorModelBase inet::physicallayer::ILayeredErrorModel inet::physicallayer::IPrintableObject

Public Member Functions

 APSKLayeredErrorModel ()
 
virtual std::ostream & printToStream (std::ostream &stream, int level) const override
 Prints this object to the provided output stream. More...
 
virtual const IReceptionPacketModelcomputePacketModel (const LayeredTransmission *transmission, const ISNIR *snir) const override
 Computes the packet domain representation at the receiver using a simplified model for the underlying domains. More...
 
virtual const IReceptionBitModelcomputeBitModel (const LayeredTransmission *transmission, const ISNIR *snir) const override
 Computes the bit domain representation at the receiver using a simplified model for the underlying domains. More...
 
virtual const IReceptionSymbolModelcomputeSymbolModel (const LayeredTransmission *transmission, const ISNIR *snir) const override
 Computes the symbol domain representation at the receiver using a simplified model for the underlying domains. More...
 
virtual const IReceptionSampleModelcomputeSampleModel (const LayeredTransmission *transmission, const ISNIR *snir) const override
 Computes the sample domain representation at the receiver using a simplified model for the underlying domains. More...
 
- Public Member Functions inherited from inet::physicallayer::IPrintableObject
virtual ~IPrintableObject ()
 
virtual std::string getInfoStringRepresentation () const
 
virtual std::string getDetailStringRepresentation () const
 
virtual std::string getDebugStringRepresentation () const
 
virtual std::string getTraceStringRepresentation () const
 
virtual std::string getCompleteStringRepresentation () const
 

Additional Inherited Members

- Public Types inherited from inet::physicallayer::IPrintableObject
enum  PrintLevel {
  PRINT_LEVEL_TRACE, PRINT_LEVEL_DEBUG, PRINT_LEVEL_DETAIL, PRINT_LEVEL_INFO,
  PRINT_LEVEL_COMPLETE = INT_MIN
}
 
- Protected Member Functions inherited from inet::physicallayer::LayeredErrorModelBase
virtual const IReceptionPacketModelcomputePacketModel (const LayeredTransmission *transmission, double packetErrorRate) const
 
virtual const IReceptionBitModelcomputeBitModel (const LayeredTransmission *transmission, double bitErrorRate) const
 
virtual const IReceptionSymbolModelcomputeSymbolModel (const LayeredTransmission *transmission, double symbolErrorRate) const
 

Constructor & Destructor Documentation

inet::physicallayer::APSKLayeredErrorModel::APSKLayeredErrorModel ( )
36 {
37 }

Member Function Documentation

const IReceptionBitModel * inet::physicallayer::APSKLayeredErrorModel::computeBitModel ( const LayeredTransmission transmission,
const ISNIR snir 
) const
overridevirtual

Computes the bit domain representation at the receiver using a simplified model for the underlying domains.

This result includes all potential errors that were not corrected by the underlying domains.

Implements inet::physicallayer::ILayeredErrorModel.

63 {
64  const ITransmissionBitModel* bitModel = transmission->getBitModel();
65  const ScalarTransmissionSignalAnalogModel *analogModel = check_and_cast<const ScalarTransmissionSignalAnalogModel *>(transmission->getAnalogModel());
66  const IModulation* modulation = transmission->getSymbolModel()->getPayloadModulation();
67  double bitErrorRate = modulation->calculateBER(snir->getMin(), analogModel->getBandwidth(), bitModel->getPayloadBitRate());
68  return LayeredErrorModelBase::computeBitModel(transmission, bitErrorRate);
69 }
virtual const IReceptionBitModel * computeBitModel(const LayeredTransmission *transmission, double bitErrorRate) const
Definition: LayeredErrorModelBase.cc:44
const IReceptionPacketModel * inet::physicallayer::APSKLayeredErrorModel::computePacketModel ( const LayeredTransmission transmission,
const ISNIR snir 
) const
overridevirtual

Computes the packet domain representation at the receiver using a simplified model for the underlying domains.

This result includes all potential errors that were not corrected by the underlying domains.

Implements inet::physicallayer::ILayeredErrorModel.

45 {
46  const ITransmissionBitModel* bitModel = transmission->getBitModel();
47  const ScalarTransmissionSignalAnalogModel *analogModel = check_and_cast<const ScalarTransmissionSignalAnalogModel *>(transmission->getAnalogModel());
48  const IModulation* modulation = transmission->getSymbolModel()->getPayloadModulation();
49  double grossBitErrorRate = modulation->calculateBER(snir->getMin(), analogModel->getBandwidth(), bitModel->getPayloadBitRate());
50  int bitLength = transmission->getPacketModel()->getPacket()->getBitLength();
51  double packetErrorRate;
52  const IForwardErrorCorrection *forwardErrorCorrection = transmission->getBitModel()->getForwardErrorCorrection();
53  if (forwardErrorCorrection == nullptr)
54  packetErrorRate = 1.0 - pow(1.0 - grossBitErrorRate, bitLength);
55  else {
56  double netBitErrorRate = forwardErrorCorrection->computeNetBitErrorRate(grossBitErrorRate);
57  packetErrorRate = 1.0 - pow(1.0 - netBitErrorRate, bitLength);
58  }
59  return LayeredErrorModelBase::computePacketModel(transmission, packetErrorRate);
60 }
virtual const IReceptionPacketModel * computePacketModel(const LayeredTransmission *transmission, double packetErrorRate) const
Definition: LayeredErrorModelBase.cc:30
const IReceptionSampleModel * inet::physicallayer::APSKLayeredErrorModel::computeSampleModel ( const LayeredTransmission transmission,
const ISNIR snir 
) const
overridevirtual

Computes the sample domain representation at the receiver using a simplified model for the underlying domains.

This result includes all potential errors that were not corrected by the underlying domains.

Implements inet::physicallayer::ILayeredErrorModel.

81 {
82  throw cRuntimeError("Not yet implemented");
83 }
const IReceptionSymbolModel * inet::physicallayer::APSKLayeredErrorModel::computeSymbolModel ( const LayeredTransmission transmission,
const ISNIR snir 
) const
overridevirtual

Computes the symbol domain representation at the receiver using a simplified model for the underlying domains.

This result includes all potential errors that were not corrected by the underlying domains.

Implements inet::physicallayer::ILayeredErrorModel.

72 {
73  const IModulation* modulation = transmission->getSymbolModel()->getPayloadModulation();
74  const ScalarTransmissionSignalAnalogModel *analogModel = check_and_cast<const ScalarTransmissionSignalAnalogModel *>(transmission->getAnalogModel());
75  const ITransmissionBitModel* bitModel = transmission->getBitModel();
76  double symbolErrorRate = modulation->calculateSER(snir->getMin(), analogModel->getBandwidth(), bitModel->getPayloadBitRate());
77  return LayeredErrorModelBase::computeSymbolModel(transmission, symbolErrorRate);
78 }
virtual const IReceptionSymbolModel * computeSymbolModel(const LayeredTransmission *transmission, double symbolErrorRate) const
Definition: LayeredErrorModelBase.cc:59
std::ostream & inet::physicallayer::APSKLayeredErrorModel::printToStream ( std::ostream &  stream,
int  level 
) const
overridevirtual

Prints this object to the provided output stream.

Function calls to operator<< with pointers or references either const or not are all forwarded to this function.

Reimplemented from inet::physicallayer::IPrintableObject.

40 {
41  return stream << "LayeredAPSKErrorModel";
42 }

The documentation for this class was generated from the following files: