transceiver: simplify transmit power control

UHD will internally accept floats with a range of +/-1.0,
which corresponds to a 16-bit signed integer range of
apporximately +/- 32000. Set the default amplitude to .3,
which is a safe value agaist saturation elsewhere in the
transmit chain.

The non-UHD maximum amplitude is unchanged at 13500.

Remove digital gain control because it's unnecessary and
causes extra load on enbedded systems.

Signed-off-by: Thomas Tsou <ttsou@vt.edu>

git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@2654 19bc5d8c-e614-43d4-8b26-e1612bc8e597
This commit is contained in:
Kurtis Heimerl
2011-11-26 03:17:49 +00:00
parent 9abb4b57b6
commit 71cec275e8
4 changed files with 10 additions and 25 deletions

View File

@@ -83,7 +83,6 @@ RadioInterface::RadioInterface(RadioDevice *wRadio,
receiveOffset = wReceiveOffset;
samplesPerSymbol = wRadioOversampling;
mClock.set(wStartTime);
powerScaling = 1.0;
loadTest = false;
}
@@ -103,19 +102,11 @@ double RadioInterface::fullScaleOutputValue(void) {
void RadioInterface::setPowerAttenuation(double atten)
{
double HWatten = mRadio->setTxGain(mRadio->maxTxGain() - atten);
atten -= HWatten;
if (atten < 1.0)
powerScaling = 1.0;
else
powerScaling = 1.0 / sqrt(pow(10, (atten / 10.0)));
mRadio->setTxGain(mRadio->maxTxGain() - atten);
}
short *RadioInterface::radioifyVector(signalVector &wVector, short *retVector, double scale, bool zeroOut)
short *RadioInterface::radioifyVector(signalVector &wVector, short *retVector, bool zeroOut)
{
signalVector::iterator itr = wVector.begin();
short *shortItr = retVector;
if (zeroOut) {
@@ -125,13 +116,6 @@ short *RadioInterface::radioifyVector(signalVector &wVector, short *retVector, d
itr++;
}
}
else if (scale != 1.0) {
while (itr < wVector.end()) {
*shortItr++ = (short) (itr->real()*scale);
*shortItr++ = (short) (itr->imag()*scale);
itr++;
}
}
else {
while (itr < wVector.end()) {
*shortItr++ = (short) (itr->real());
@@ -141,7 +125,6 @@ short *RadioInterface::radioifyVector(signalVector &wVector, short *retVector, d
}
return retVector;
}
void RadioInterface::unRadioifyVector(short *shortVector, signalVector& newVector)
@@ -254,7 +237,7 @@ void RadioInterface::driveTransmitRadio(signalVector &radioBurst, bool zeroBurst
if (!mOn) return;
radioifyVector(radioBurst, sendBuffer+sendCursor, powerScaling, zeroBurst);
radioifyVector(radioBurst, sendBuffer+sendCursor, zeroBurst);
sendCursor += (radioBurst.size()*2);