30 NS_LOG_COMPONENT_DEFINE(
"SatChannelEstimationError");
35 NS_OBJECT_ENSURE_REGISTERED(SatChannelEstimationError);
38 : m_lastSampleIndex(0),
39 m_normalRandomVariable(),
48 : m_lastSampleIndex(0),
49 m_normalRandomVariable(),
65 static TypeId tid = TypeId(
"ns3::SatMeasurementError")
67 .AddConstructor<SatChannelEstimationError>();
74 NS_LOG_FUNCTION(
this);
83 NS_LOG_FUNCTION(
this << filePathName);
86 std::ifstream* ifs =
new std::ifstream(filePathName.c_str(), std::ifstream::in);
92 filePathName =
"../../" + filePathName;
93 ifs =
new std::ifstream(filePathName.c_str(), std::ifstream::in);
97 NS_FATAL_ERROR(
"The file " << filePathName <<
" is not found.");
102 double sinrDb, mueCe, stdCe;
105 *ifs >> sinrDb >> mueCe >> stdCe;
114 *ifs >> sinrDb >> mueCe >> stdCe;
129 NS_LOG_FUNCTION(
this << sinrInDb);
156 for (uint32_t i = 0; i <
m_sinrsDb.size(); ++i)
180 double varCe = pow(stdCe, 2);
182 NS_LOG_INFO(
"mueCe: " << mueCe <<
", stdCe: " << stdCe <<
", varCe: " << varCe);
188 double sinrOutDb = sinrInDb + error - mueCe;
190 NS_LOG_INFO(
"sinrIn: " << sinrInDb <<
", sinrOut: " << sinrOutDb);
std::vector< double > m_sinrsDb
SINR values.
uint32_t m_lastSampleIndex
Last sample index of the containers.
Ptr< NormalRandomVariable > m_normalRandomVariable
Normal random variable used to calculate the channel estimation error.
SatChannelEstimationError()
Default constructor.
virtual ~SatChannelEstimationError()
Destructor for SatChannelEstimationError.
std::vector< double > m_stdCesDb
Standard deviation values.
double AddError(double sinrInDb) const
Add channel estimation error to SINR.
virtual void DoDispose()
Dispose of this class instance.
std::vector< double > m_mueCesDb
Mean values.
void ReadFile(std::string filePathName)
Read the distribution mean and STD values from file.
static TypeId GetTypeId(void)
inherited from Object
static double Interpolate(double x, double x0, double x1, double y0, double y1)
Simple linear interpolation.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.