mirror of
https://github.com/PentHertz/OpenBTS.git
synced 2026-04-30 04:19:28 +00:00
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
This commit is contained in:
parent
e1beaa7745
commit
8a5781f7fa
2 changed files with 4 additions and 5 deletions
|
|
@ -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)));
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue