aboutsummaryrefslogtreecommitdiffstats
path: root/Transceiver52M
diff options
context:
space:
mode:
authorkurtis.heimerl <kurtis.heimerl@19bc5d8c-e614-43d4-8b26-e1612bc8e597>2011-11-26 03:17:38 +0000
committerkurtis.heimerl <kurtis.heimerl@19bc5d8c-e614-43d4-8b26-e1612bc8e597>2011-11-26 03:17:38 +0000
commit58d6a01b50a1622af61b57ecd620d298879854d2 (patch)
tree2be0985a0af10599d1501c0f06c285a6901979b1 /Transceiver52M
parentd1ae0cd2b979683cf0b1d061d4298be2cb297a01 (diff)
transceiver: rework digital gain settings
The output of the modulator or resampler is scaled and converted from floating point to fixed point. The scaling factor is the leftover dB in RF attention (relative to max transmit power), which is handled prior to the integer conversion. This should work across all daughterboards and non-UHD installations. Signed-off-by: Thomas Tsou <ttsou@vt.edu> git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@2650 19bc5d8c-e614-43d4-8b26-e1612bc8e597
Diffstat (limited to 'Transceiver52M')
-rw-r--r--Transceiver52M/Transceiver.cpp2
-rw-r--r--Transceiver52M/radioInterface.cpp7
2 files changed, 4 insertions, 5 deletions
diff --git a/Transceiver52M/Transceiver.cpp b/Transceiver52M/Transceiver.cpp
index 07b2777..80e8aca 100644
--- a/Transceiver52M/Transceiver.cpp
+++ b/Transceiver52M/Transceiver.cpp
@@ -513,7 +513,7 @@ void Transceiver::driveControl()
sprintf(response,"RSP SETPOWER 1 %d",dbPwr);
else {
mPower = dbPwr;
- mRadioInterface->setPowerAttenuation(pow(10.0,dbPwr/10.0));
+ mRadioInterface->setPowerAttenuation(dbPwr);
sprintf(response,"RSP SETPOWER 0 %d",dbPwr);
}
}
diff --git a/Transceiver52M/radioInterface.cpp b/Transceiver52M/radioInterface.cpp
index e8eea6f..7e51fa4 100644
--- a/Transceiver52M/radioInterface.cpp
+++ b/Transceiver52M/radioInterface.cpp
@@ -101,15 +101,14 @@ double RadioInterface::fullScaleOutputValue(void) {
}
-void RadioInterface::setPowerAttenuation(double dBAtten)
+void RadioInterface::setPowerAttenuation(double atten)
{
double HWatten = mRadio->setTxGain(mRadio->maxTxGain() - atten);
- atten -= (-HWatten);
+ atten -= HWatten;
if (atten < 1.0)
powerScaling = 1.0;
else
- powerScaling = 1.0/sqrt(linearAtten);
- LOG(INFO) << "setting HW gain to " << HWdBAtten << " and power scaling to " << powerScaling;
+ powerScaling = 1.0 / sqrt(pow(10, (atten / 10.0)));
}