aboutsummaryrefslogtreecommitdiffstats
path: root/Transceiver52M
diff options
context:
space:
mode:
authorkurtis.heimerl <kurtis.heimerl@19bc5d8c-e614-43d4-8b26-e1612bc8e597>2011-11-26 03:17:35 +0000
committerkurtis.heimerl <kurtis.heimerl@19bc5d8c-e614-43d4-8b26-e1612bc8e597>2011-11-26 03:17:35 +0000
commitd1ae0cd2b979683cf0b1d061d4298be2cb297a01 (patch)
tree0fae1968759ed0b8233973d23822bee77f83334c /Transceiver52M
parent41f708b9a0e93dff8098ecdf3b8c51285d6f9acf (diff)
uhd: set attenuation relative to max RF gain
Previously this was referenced off the the ad9862 PGA with a range from 0 to -20 dB. Instead base the attenuation factor on the maximum total RF gain returned by the device. Signed-off-by: Thomas Tsou <ttsou@vt.edu> git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@2649 19bc5d8c-e614-43d4-8b26-e1612bc8e597
Diffstat (limited to 'Transceiver52M')
-rw-r--r--Transceiver52M/radioInterface.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/Transceiver52M/radioInterface.cpp b/Transceiver52M/radioInterface.cpp
index 8fd2ec3..e8eea6f 100644
--- a/Transceiver52M/radioInterface.cpp
+++ b/Transceiver52M/radioInterface.cpp
@@ -103,10 +103,9 @@ double RadioInterface::fullScaleOutputValue(void) {
void RadioInterface::setPowerAttenuation(double dBAtten)
{
- float HWdBAtten = mRadio->setTxGain(-dBAtten);
- dBAtten -= (-HWdBAtten);
- float linearAtten = powf(10.0F,0.1F*dBAtten);
- if (linearAtten < 1.0)
+ double HWatten = mRadio->setTxGain(mRadio->maxTxGain() - atten);
+ atten -= (-HWatten);
+ if (atten < 1.0)
powerScaling = 1.0;
else
powerScaling = 1.0/sqrt(linearAtten);