diff options
author | Josh Blum <josh@joshknows.com> | 2012-10-05 12:59:32 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2012-10-05 12:59:32 -0700 |
commit | 20553ccba27d5102ef8b8938dea172f054782831 (patch) | |
tree | 00286221c29962c1b45b90c4d77cb99c89b1ae16 /host/lib/usrp | |
parent | d14ff607b2b475dfd249fb99d7071ed367521a98 (diff) | |
parent | 3673ffd0921a3b6bf2cc9985ead0e337c001baf3 (diff) | |
download | uhd-20553ccba27d5102ef8b8938dea172f054782831.tar.gz uhd-20553ccba27d5102ef8b8938dea172f054782831.tar.bz2 uhd-20553ccba27d5102ef8b8938dea172f054782831.zip |
Merge branch 'maint'
Diffstat (limited to 'host/lib/usrp')
-rw-r--r-- | host/lib/usrp/cores/rx_dsp_core_200.cpp | 5 | ||||
-rw-r--r-- | host/lib/usrp/cores/tx_dsp_core_200.cpp | 5 |
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 7af4923c8..ef6b85de9 100644 --- a/host/lib/usrp/cores/rx_dsp_core_200.cpp +++ b/host/lib/usrp/cores/rx_dsp_core_200.cpp @@ -203,9 +203,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 c37868b26..808f13028 100644 --- a/host/lib/usrp/cores/tx_dsp_core_200.cpp +++ b/host/lib/usrp/cores/tx_dsp_core_200.cpp @@ -145,9 +145,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); } |