31 NS_LOG_COMPONENT_DEFINE(
"SatChannelEstimationError");
36 NS_OBJECT_ENSURE_REGISTERED(SatChannelEstimationError);
39 : m_lastSampleIndex(0),
40 m_normalRandomVariable(),
49 : m_lastSampleIndex(0),
50 m_normalRandomVariable(),
66 static TypeId tid = TypeId(
"ns3::SatMeasurementError")
68 .AddConstructor<SatChannelEstimationError>();
75 NS_LOG_FUNCTION(
this);
84 NS_LOG_FUNCTION(
this << filePathName);
87 std::ifstream* ifs =
new std::ifstream(filePathName.c_str(), std::ifstream::in);
93 filePathName =
"../../" + filePathName;
94 ifs =
new std::ifstream(filePathName.c_str(), std::ifstream::in);
98 NS_FATAL_ERROR(
"The file " << filePathName <<
" is not found.");
103 double sinrDb, mueCe, stdCe;
106 *ifs >> sinrDb >> mueCe >> stdCe;
115 *ifs >> sinrDb >> mueCe >> stdCe;
130 NS_LOG_FUNCTION(
this << sinrInDb);
157 for (uint32_t i = 0; i <
m_sinrsDb.size(); ++i)
181 double varCe = pow(stdCe, 2);
183 NS_LOG_INFO(
"mueCe: " << mueCe <<
", stdCe: " << stdCe <<
", varCe: " << varCe);
189 double sinrOutDb = sinrInDb + error - mueCe;
191 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.