aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp
diff options
context:
space:
mode:
Diffstat (limited to 'host/lib/usrp')
-rw-r--r--host/lib/usrp/cores/rx_dsp_core_200.cpp5
-rw-r--r--host/lib/usrp/cores/tx_dsp_core_200.cpp5
2 files changed, 6 insertions, 4 deletions
diff --git a/host/lib/usrp/cores/rx_dsp_core_200.cpp b/host/lib/usrp/cores/rx_dsp_core_200.cpp
index a9b7d8672..b73baa81e 100644
--- a/host/lib/usrp/cores/rx_dsp_core_200.cpp
+++ b/host/lib/usrp/cores/rx_dsp_core_200.cpp
@@ -184,9 +184,10 @@ public:
}
void update_scalar(void){
- const double target_scalar = (1 << 17)*_scaling_adjustment/_dsp_extra_scaling;
+ const double factor = 1.0 + std::max(ceil_log2(_scaling_adjustment), 0.0);
+ const double target_scalar = (1 << 17)*_scaling_adjustment/_dsp_extra_scaling/factor;
const boost::int32_t actual_scalar = boost::math::iround(target_scalar);
- _fxpt_scalar_correction = target_scalar/actual_scalar; //should be small
+ _fxpt_scalar_correction = target_scalar/actual_scalar*factor; //should be small
_iface->poke32(REG_DSP_RX_SCALE_IQ, actual_scalar);
}
diff --git a/host/lib/usrp/cores/tx_dsp_core_200.cpp b/host/lib/usrp/cores/tx_dsp_core_200.cpp
index 2faf7c28b..f905a7551 100644
--- a/host/lib/usrp/cores/tx_dsp_core_200.cpp
+++ b/host/lib/usrp/cores/tx_dsp_core_200.cpp
@@ -136,9 +136,10 @@ public:
}
void update_scalar(void){
- const double target_scalar = (1 << 17)*_scaling_adjustment/_dsp_extra_scaling;
+ const double factor = 1.0 + std::max(ceil_log2(_scaling_adjustment), 0.0);
+ const double target_scalar = (1 << 17)*_scaling_adjustment/_dsp_extra_scaling/factor;
const boost::int32_t actual_scalar = boost::math::iround(target_scalar);
- _fxpt_scalar_correction = target_scalar/actual_scalar; //should be small
+ _fxpt_scalar_correction = target_scalar/actual_scalar*factor; //should be small
_iface->poke32(REG_DSP_TX_SCALE_IQ, actual_scalar);
}