Update RSRP and RSRQ evaluation (RSRQ as average SINR)
This commit is contained in:
@@ -441,6 +441,9 @@ LteHelper::InstallSingleUeDevice (Ptr<Node> n)
|
||||
ulPhy->SetHarqPhyModule (harq);
|
||||
phy->SetHarqPhyModule (harq);
|
||||
|
||||
Ptr<LteRsReceivedPowerChunkProcessor> pRs = Create<LteRsReceivedPowerChunkProcessor> (phy->GetObject<LtePhy> ());
|
||||
dlPhy->AddRsPowerChunkProcessor (pRs);
|
||||
|
||||
Ptr<LteCtrlSinrChunkProcessor> pCtrl = Create<LteCtrlSinrChunkProcessor> (phy->GetObject<LtePhy> (), dlPhy);
|
||||
dlPhy->AddCtrlSinrChunkProcessor (pCtrl);
|
||||
|
||||
|
||||
@@ -651,6 +651,11 @@ LteEnbPhy::ReportInterference (const SpectrumValue& interf)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
LteEnbPhy::ReportRsReceivedPower (const SpectrumValue& power)
|
||||
{
|
||||
// not used by eNB
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -231,6 +231,8 @@ public:
|
||||
virtual void GenerateCtrlCqiReport (const SpectrumValue& sinr);
|
||||
virtual void GenerateDataCqiReport (const SpectrumValue& sinr);
|
||||
virtual void ReportInterference (const SpectrumValue& interf);
|
||||
virtual void ReportRsReceivedPower (const SpectrumValue& interf);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -46,7 +46,9 @@ void
|
||||
LteInterference::DoDispose ()
|
||||
{
|
||||
NS_LOG_FUNCTION (this);
|
||||
m_rsPowerChunkProcessorList.clear ();
|
||||
m_sinrChunkProcessorList.clear ();
|
||||
m_interfChunkProcessorList.clear ();
|
||||
m_rxSignal = 0;
|
||||
m_allSignals = 0;
|
||||
m_noise = 0;
|
||||
@@ -97,6 +99,10 @@ LteInterference::EndRx ()
|
||||
NS_LOG_FUNCTION (this);
|
||||
ConditionallyEvaluateChunk ();
|
||||
m_receiving = false;
|
||||
for (std::list<Ptr<LteSinrChunkProcessor> >::const_iterator it = m_rsPowerChunkProcessorList.begin (); it != m_rsPowerChunkProcessorList.end (); ++it)
|
||||
{
|
||||
(*it)->End ();
|
||||
}
|
||||
for (std::list<Ptr<LteSinrChunkProcessor> >::const_iterator it = m_sinrChunkProcessorList.begin (); it != m_sinrChunkProcessorList.end (); ++it)
|
||||
{
|
||||
(*it)->End ();
|
||||
@@ -162,6 +168,10 @@ LteInterference::ConditionallyEvaluateChunk ()
|
||||
{
|
||||
(*it)->EvaluateSinrChunk (sinr, duration);
|
||||
}
|
||||
for (std::list<Ptr<LteSinrChunkProcessor> >::const_iterator it = m_rsPowerChunkProcessorList.begin (); it != m_rsPowerChunkProcessorList.end (); ++it)
|
||||
{
|
||||
(*it)->EvaluateSinrChunk (*m_rxSignal, duration);
|
||||
}
|
||||
|
||||
for (std::list<Ptr<LteSinrChunkProcessor> >::const_iterator it = m_interfChunkProcessorList.begin (); it != m_interfChunkProcessorList.end (); ++it)
|
||||
{
|
||||
@@ -187,6 +197,13 @@ LteInterference::SetNoisePowerSpectralDensity (Ptr<const SpectrumValue> noisePsd
|
||||
m_allSignals = Create<SpectrumValue> (noisePsd->GetSpectrumModel ());
|
||||
}
|
||||
|
||||
void
|
||||
LteInterference::AddRsPowerChunkProcessor (Ptr<LteSinrChunkProcessor> p)
|
||||
{
|
||||
NS_LOG_FUNCTION (this << p);
|
||||
m_rsPowerChunkProcessorList.push_back (p);
|
||||
}
|
||||
|
||||
void
|
||||
LteInterference::AddSinrChunkProcessor (Ptr<LteSinrChunkProcessor> p)
|
||||
{
|
||||
|
||||
@@ -71,6 +71,15 @@ public:
|
||||
*/
|
||||
void AddInterferenceChunkProcessor (Ptr<LteSinrChunkProcessor> p);
|
||||
|
||||
/**
|
||||
* Add a LteSinrChunkProcessor that will use the time-vs-frequency
|
||||
* power calculated by this LteInterference instance. Note
|
||||
* that all the added LteSinrChunkProcessors will work in parallel.
|
||||
*
|
||||
* @param p
|
||||
*/
|
||||
void AddRsPowerChunkProcessor (Ptr<LteSinrChunkProcessor> p);
|
||||
|
||||
/**
|
||||
* notify that the PHY is starting a RX attempt
|
||||
*
|
||||
@@ -129,6 +138,10 @@ private:
|
||||
Time m_lastChangeTime; /**< the time of the last change in
|
||||
m_TotalPower */
|
||||
|
||||
/** all the processor instances that need to be notified whenever
|
||||
a new interference chunk is calculated */
|
||||
std::list<Ptr<LteSinrChunkProcessor> > m_rsPowerChunkProcessorList;
|
||||
|
||||
/** all the processor instances that need to be notified whenever
|
||||
a new SINR chunk is calculated */
|
||||
std::list<Ptr<LteSinrChunkProcessor> > m_sinrChunkProcessorList;
|
||||
|
||||
@@ -205,7 +205,16 @@ public:
|
||||
*
|
||||
* \param sinr the interference + noise power measured by the device
|
||||
*/
|
||||
virtual void ReportInterference (const SpectrumValue& interf) = 0;
|
||||
virtual void ReportInterference (const SpectrumValue& power) = 0;
|
||||
|
||||
/**
|
||||
* generate a report based on the linear RS power perceived during CTRL
|
||||
* frame
|
||||
* NOTE: used only by UE for evaluating RSRP
|
||||
*
|
||||
* \param sinr the RS power measured by the device
|
||||
*/
|
||||
virtual void ReportRsReceivedPower (const SpectrumValue& interf) = 0;
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -169,6 +169,62 @@ LteDataSinrChunkProcessor::End ()
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// ------------- LteRsReceivedPowerChunkProcessor ------------------------------
|
||||
|
||||
LteRsReceivedPowerChunkProcessor::LteRsReceivedPowerChunkProcessor (Ptr<LtePhy> p)
|
||||
: m_phy (p)
|
||||
{
|
||||
NS_LOG_FUNCTION (this << p);
|
||||
NS_ASSERT (m_phy);
|
||||
}
|
||||
|
||||
LteRsReceivedPowerChunkProcessor::~LteRsReceivedPowerChunkProcessor ()
|
||||
{
|
||||
NS_LOG_FUNCTION (this);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
LteRsReceivedPowerChunkProcessor::Start ()
|
||||
{
|
||||
NS_LOG_FUNCTION (this);
|
||||
m_sumSinr = 0;
|
||||
m_totDuration = MicroSeconds (0);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
LteRsReceivedPowerChunkProcessor::EvaluateSinrChunk (const SpectrumValue& sinr, Time duration)
|
||||
{
|
||||
NS_LOG_FUNCTION (this << sinr << duration);
|
||||
if (m_sumSinr == 0)
|
||||
{
|
||||
m_sumSinr = Create<SpectrumValue> (sinr.GetSpectrumModel ());
|
||||
}
|
||||
(*m_sumSinr) += sinr * duration.GetSeconds ();
|
||||
m_totDuration += duration;
|
||||
}
|
||||
|
||||
void
|
||||
LteRsReceivedPowerChunkProcessor::End ()
|
||||
{
|
||||
NS_LOG_FUNCTION (this);
|
||||
if (m_totDuration.GetSeconds () > 0)
|
||||
{
|
||||
m_phy->ReportRsReceivedPower ((*m_sumSinr) / m_totDuration.GetSeconds ());
|
||||
}
|
||||
else
|
||||
{
|
||||
NS_LOG_WARN ("m_numSinr == 0");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// ------------- LteInterferencePowerChunkProcessor ------------------------------
|
||||
|
||||
LteInterferencePowerChunkProcessor::LteInterferencePowerChunkProcessor (Ptr<LtePhy> p)
|
||||
|
||||
@@ -103,6 +103,29 @@ class LteDataSinrChunkProcessor : public LteSinrChunkProcessor
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* The LteRsReceivedPowerChunkProcessor averages the received signal power
|
||||
* over time for data frame and therefore in charge of generating the
|
||||
* power linear values for generating the RSRP tracing at eNB side
|
||||
*
|
||||
*/
|
||||
class LteRsReceivedPowerChunkProcessor : public LteSinrChunkProcessor
|
||||
{
|
||||
public:
|
||||
virtual ~LteRsReceivedPowerChunkProcessor ();
|
||||
LteRsReceivedPowerChunkProcessor (Ptr<LtePhy> p);
|
||||
virtual void Start ();
|
||||
virtual void EvaluateSinrChunk (const SpectrumValue& sinr, Time duration);
|
||||
virtual void End ();
|
||||
private:
|
||||
Ptr<SpectrumValue> m_sumSinr;
|
||||
Time m_totDuration;
|
||||
Ptr<LtePhy> m_phy;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* The LteInterferencePowerChunkProcessor averages the interference power
|
||||
* over time for data frame and therefore in charge of generating the
|
||||
|
||||
@@ -1029,6 +1029,13 @@ LteSpectrumPhy::SetCellId (uint16_t cellId)
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
LteSpectrumPhy::AddRsPowerChunkProcessor (Ptr<LteSinrChunkProcessor> p)
|
||||
{
|
||||
m_interferenceCtrl->AddRsPowerChunkProcessor (p);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
LteSpectrumPhy::AddDataSinrChunkProcessor (Ptr<LteSinrChunkProcessor> p)
|
||||
{
|
||||
|
||||
@@ -303,6 +303,14 @@ public:
|
||||
void SetCellId (uint16_t cellId);
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* \param p the new LteSinrChunkProcessor to be added to the RS power
|
||||
* \processing chain
|
||||
*/
|
||||
void AddRsPowerChunkProcessor (Ptr<LteSinrChunkProcessor> p);
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
|
||||
@@ -128,6 +128,7 @@ LteUePhy::LteUePhy (Ptr<LteSpectrumPhy> dlPhy, Ptr<LteSpectrumPhy> ulPhy)
|
||||
m_ueCphySapUser (0),
|
||||
m_rnti (0),
|
||||
m_srsPeriodicity (0),
|
||||
m_rsReceivedPowerUpdated (false),
|
||||
m_rsrpRsrqSampleCounter (0)
|
||||
{
|
||||
m_amc = CreateObject <LteAmc> ();
|
||||
@@ -403,6 +404,14 @@ LteUePhy::ReportInterference (const SpectrumValue& interf)
|
||||
// Currently not used by UE
|
||||
}
|
||||
|
||||
void
|
||||
LteUePhy::ReportRsReceivedPower (const SpectrumValue& power)
|
||||
{
|
||||
NS_LOG_FUNCTION (this << power);
|
||||
m_rsReceivedPowerUpdated = true;
|
||||
m_rsReceivedPower = power;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Ptr<DlCqiLteControlMessage>
|
||||
@@ -418,9 +427,26 @@ LteUePhy::CreateDlCqiFeedbackMessage (const SpectrumValue& sinr)
|
||||
m_rsrpRsrqSampleCounter++;
|
||||
if (m_rsrpRsrqSampleCounter==m_rsrpRsrqSamplePeriod)
|
||||
{
|
||||
// Generate RSRP and RSRQ traces (dummy values, real valeus TBD)
|
||||
double rsrp = 0.0;
|
||||
double rsrq = 0.0;
|
||||
NS_ASSERT_MSG (m_rsReceivedPowerUpdated, " RS received power info obsolete");
|
||||
// RSRP evaluated as averaged received power among RBs
|
||||
double sum = 0.0;
|
||||
uint8_t rbNum = 0;
|
||||
Values::const_iterator it;
|
||||
for (it = m_rsReceivedPower.ConstValuesBegin (); it != m_rsReceivedPower.ConstValuesEnd (); it++)
|
||||
{
|
||||
sum += (*it);
|
||||
rbNum++;
|
||||
}
|
||||
double rsrp = sum / (double)rbNum;
|
||||
// RSRQ evaluated as averaged SINR among RBs
|
||||
for (it = sinr.ConstValuesBegin (); it != sinr.ConstValuesEnd (); it++)
|
||||
{
|
||||
sum += (*it);
|
||||
rbNum++;
|
||||
}
|
||||
double rsrq = sum / (double)rbNum;
|
||||
NS_LOG_INFO (this << " cellId " << m_cellId << " rnti " << m_rnti << " RSRP " << rsrp << " RSRQ " << rsrq);
|
||||
|
||||
m_reportCurrentCellRsrpRsrqTrace (m_cellId, m_rnti, rsrp, rsrq);
|
||||
m_rsrpRsrqSampleCounter = 0;
|
||||
}
|
||||
@@ -625,7 +651,9 @@ void
|
||||
LteUePhy::SubframeIndication (uint32_t frameNo, uint32_t subframeNo)
|
||||
{
|
||||
NS_LOG_FUNCTION (this << frameNo << subframeNo);
|
||||
|
||||
|
||||
// refresh internal variables
|
||||
m_rsReceivedPowerUpdated = false;
|
||||
// update uplink transmission mask according to previous UL-CQIs
|
||||
SetSubChannelsForTransmission (m_subChannelsForTransmissionQueue.at (0));
|
||||
// shift the queue
|
||||
|
||||
@@ -169,6 +169,7 @@ public:
|
||||
virtual void GenerateCtrlCqiReport (const SpectrumValue& sinr);
|
||||
virtual void GenerateDataCqiReport (const SpectrumValue& sinr);
|
||||
virtual void ReportInterference (const SpectrumValue& interf);
|
||||
virtual void ReportRsReceivedPower (const SpectrumValue& power);
|
||||
|
||||
virtual void DoSendLteControlMessage (Ptr<LteControlMessage> msg);
|
||||
virtual void ReceiveLteControlMessageList (std::list<Ptr<LteControlMessage> >);
|
||||
@@ -266,6 +267,9 @@ private:
|
||||
uint16_t m_srsPeriodicity;
|
||||
uint16_t m_srsCounter;
|
||||
|
||||
bool m_rsReceivedPowerUpdated;
|
||||
SpectrumValue m_rsReceivedPower;
|
||||
|
||||
Ptr<LteHarqPhy> m_harqPhyModule;
|
||||
|
||||
/**
|
||||
|
||||
@@ -95,6 +95,13 @@ LteTestUePhy::GenerateDataCqiReport (const SpectrumValue& sinr)
|
||||
m_sinr = sinr;
|
||||
}
|
||||
|
||||
void
|
||||
LteTestUePhy::ReportRsReceivedPower (const SpectrumValue& power)
|
||||
{
|
||||
NS_LOG_FUNCTION (this);
|
||||
// Not used by the LteTestUePhy
|
||||
}
|
||||
|
||||
void
|
||||
LteTestUePhy::ReportInterference (const SpectrumValue& interf)
|
||||
{
|
||||
|
||||
@@ -64,6 +64,8 @@ public:
|
||||
|
||||
virtual void ReportInterference (const SpectrumValue& interf);
|
||||
|
||||
virtual void ReportRsReceivedPower (const SpectrumValue& power);
|
||||
|
||||
virtual void ReceiveLteControlMessage (Ptr<LteControlMessage> msg);
|
||||
|
||||
SpectrumValue GetSinr ();
|
||||
|
||||
Reference in New Issue
Block a user