diff options
author | kurtis.heimerl <kurtis.heimerl@19bc5d8c-e614-43d4-8b26-e1612bc8e597> | 2011-11-26 03:17:49 +0000 |
---|---|---|
committer | kurtis.heimerl <kurtis.heimerl@19bc5d8c-e614-43d4-8b26-e1612bc8e597> | 2011-11-26 03:17:49 +0000 |
commit | 7ac54b10d3373865cddd0f2e3821b0346cb9dd7c (patch) | |
tree | 7546c2d4fd35f10a4ca534714057bd1269d397aa /Transceiver52M | |
parent | d4be074ea62342a5f27ce60c04d686c3977ceba1 (diff) |
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
Diffstat (limited to 'Transceiver52M')
-rw-r--r-- | Transceiver52M/Transceiver.cpp | 1 | ||||
-rw-r--r-- | Transceiver52M/UHDDevice.cpp | 9 | ||||
-rw-r--r-- | Transceiver52M/radioInterface.cpp | 23 | ||||
-rw-r--r-- | Transceiver52M/radioInterface.h | 2 |
4 files changed, 10 insertions, 25 deletions
diff --git a/Transceiver52M/Transceiver.cpp b/Transceiver52M/Transceiver.cpp index 80e8aca..44cc86a 100644 --- a/Transceiver52M/Transceiver.cpp +++ b/Transceiver52M/Transceiver.cpp @@ -401,7 +401,6 @@ SoftVector *Transceiver::pullRadioVector(GSM::Time &wTime, *DFEFeedback[timeslot]); } wTime = rxBurst->time(); - // FIXME: what is full scale for the USRP? we get more that 12 bits of resolution... RSSI = (int) floor(20.0*log10(rxFullScale/amplitude.abs())); LOG(DEBUG) << "RSSI: " << RSSI; timingOffset = (int) round(TOA*256.0/mSamplesPerSymbol); diff --git a/Transceiver52M/UHDDevice.cpp b/Transceiver52M/UHDDevice.cpp index be07a9e..6c55260 100644 --- a/Transceiver52M/UHDDevice.cpp +++ b/Transceiver52M/UHDDevice.cpp @@ -38,12 +38,15 @@ on the RF side of the timestamping point of the device. This value is generally empirically measured. - smpl_buf_sz - The receive sample buffer size in bytes. + smpl_buf_sz - The receive sample buffer size in bytes. + + tx_ampl - Transmit amplitude must be between 0 and 1.0 */ const bool use_ext_ref = false; const double master_clk_rt = 52e6; const double rx_smpl_offset = .0000869; const size_t smpl_buf_sz = (1 << 20); +const float tx_ampl = .3; /** Timestamp conversion @param timestamp a UHD or OpenBTS timestamp @@ -158,8 +161,8 @@ public: inline TIMESTAMP initialWriteTimestamp() { return 0; } inline TIMESTAMP initialReadTimestamp() { return 0; } - inline double fullScaleInputValue() { return 13500.0; } - inline double fullScaleOutputValue() { return 9450.0; } + inline double fullScaleInputValue() { return 32000 * tx_ampl; } + inline double fullScaleOutputValue() { return 32000; } double setRxGain(double db); double getRxGain(void) { return rx_gain; } diff --git a/Transceiver52M/radioInterface.cpp b/Transceiver52M/radioInterface.cpp index 7e51fa4..3e654b1 100644 --- a/Transceiver52M/radioInterface.cpp +++ b/Transceiver52M/radioInterface.cpp @@ -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); diff --git a/Transceiver52M/radioInterface.h b/Transceiver52M/radioInterface.h index 090b296..d19f88d 100644 --- a/Transceiver52M/radioInterface.h +++ b/Transceiver52M/radioInterface.h @@ -157,7 +157,7 @@ private: signalVector *finalVec, *finalVec9; /** format samples to USRP */ - short *radioifyVector(signalVector &wVector, short *shortVector, double scale, bool zeroOut); + short *radioifyVector(signalVector &wVector, short *shortVector, bool zeroOut); /** format samples from USRP */ void unRadioifyVector(short *shortVector, signalVector &wVector); |