fixed TX and noise PSD calculations

This commit is contained in:
Nicola Baldo
2011-05-12 15:29:43 +02:00
parent 12f071866d
commit 8a69ba3c6d

View File

@@ -237,7 +237,7 @@ LteSpectrumValueHelper::CreateTxPowerSpectralDensity (uint16_t earfcn, uint8_t t
// powerTx is expressed in dBm. We must convert it into natural unit.
double powerTxW = pow (10., (powerTx - 30) / 10);
double txPowerDensity = (powerTxW / GetChannelBandwidth (txBandwidthConfiguration));
double txPowerDensity = (powerTxW / (txBandwidthConfiguration * 180000));
for (std::vector <int>::iterator it = activeRbs.begin (); it != activeRbs.end (); it++)
{
@@ -263,10 +263,14 @@ Ptr<SpectrumValue>
LteSpectrumValueHelper::CreateNoisePowerSpectralDensity (double noiseFigureDb, Ptr<SpectrumModel> spectrumModel)
{
NS_LOG_FUNCTION (noiseFigureDb << spectrumModel);
double noiseFigureLinear = pow (10.0, noiseFigureDb / 10.0);
static const double BOLTZMANN = 1.3803e-23;
static const double ROOM_TEMPERATURE = 290.0;
double noisePowerSpectralDensity = noiseFigureLinear * BOLTZMANN * ROOM_TEMPERATURE; // W/Hz
// see "LTE - From theory to practice"
// Section 22.4.4.2 Thermal Noise and Receiver Noise Figure
const double kT_dBm_Hz = -174.0; // dBm/Hz
double kT_W_Hz = pow (10.0, (kT_dBm_Hz - 30)/10.0);
double noiseFigureLinear = pow (10.0, noiseFigureDb / 10.0);
double noisePowerSpectralDensity = kT_W_Hz * noiseFigureLinear;
Ptr<SpectrumValue> noisePsd = Create <SpectrumValue> (spectrumModel);
(*noisePsd) = noisePowerSpectralDensity;