diff options
author | Ryan Marlow <ryan.marlow@ettus.com> | 2018-01-26 14:07:50 -0500 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2018-03-22 17:48:30 -0700 |
commit | d588005fd87dd2594adb29dbbdcf948bbb0ab0c1 (patch) | |
tree | 7307df1b7a62996c68f7d5bca430359218e9e3da /host/lib/usrp | |
parent | 93617aa25cc0ec62cbdbf9cdb41ec11fcc29f2b3 (diff) | |
download | uhd-d588005fd87dd2594adb29dbbdcf948bbb0ab0c1.tar.gz uhd-d588005fd87dd2594adb29dbbdcf948bbb0ab0c1.tar.bz2 uhd-d588005fd87dd2594adb29dbbdcf948bbb0ab0c1.zip |
DDC/DUC: switch CORDIC -> DDS for all relevant variable names
- Bump compat number for DDC/DUC to 2.0
Diffstat (limited to 'host/lib/usrp')
-rw-r--r-- | host/lib/usrp/cores/rx_dsp_core_3000.cpp | 14 | ||||
-rw-r--r-- | host/lib/usrp/cores/tx_dsp_core_3000.cpp | 10 |
2 files changed, 12 insertions, 12 deletions
diff --git a/host/lib/usrp/cores/rx_dsp_core_3000.cpp b/host/lib/usrp/cores/rx_dsp_core_3000.cpp index 27fc760af..c7d3c25c8 100644 --- a/host/lib/usrp/cores/rx_dsp_core_3000.cpp +++ b/host/lib/usrp/cores/rx_dsp_core_3000.cpp @@ -37,6 +37,7 @@ template <class T> T ceil_log2(T num){ using namespace uhd; const double rx_dsp_core_3000::DEFAULT_CORDIC_FREQ = 0.0; +const double rx_dsp_core_3000::DEFAULT_DDS_FREQ = 0.0; const double rx_dsp_core_3000::DEFAULT_RATE = 1e6; rx_dsp_core_3000::~rx_dsp_core_3000(void){ @@ -191,24 +192,23 @@ public: // Caclulate algorithmic gain of CIC for a given decimation. // For Ettus CIC R=decim, M=1, N=4. Gain = (R * M) ^ N const double rate_pow = std::pow(double(decim & 0xff), 4); - // Calculate compensation gain values for algorithmic gain of CORDIC and CIC taking into account + // Calculate compensation gain values for algorithmic gain of and CIC taking into account // gain compensation blocks already hardcoded in place in DDC (that provide simple 1/2^n gain compensation). - // CORDIC algorithmic gain limits asymptotically around 1.647 after many iterations. // // The polar rotation of [I,Q] = [1,1] by Pi/8 also yields max magnitude of SQRT(2) (~1.4142) however - // input to the CORDIC thats outside the unit circle can only be sourced from a saturated RF frontend. + // input to the DDS thats outside the unit circle can only be sourced from a saturated RF frontend. // To provide additional dynamic range head room accordingly using scale factor applied at egress from DDC would // cost us small signal performance, thus we do no provide compensation gain for a saturated front end and allow // the signal to clip in the H/W as needed. If we wished to avoid the signal clipping in these circumstances then adjust code to read: // _scaling_adjustment = std::pow(2, ceil_log2(rate_pow))/(1.648*rate_pow*1.415); - _scaling_adjustment = std::pow(2, ceil_log2(rate_pow))/(1.648*rate_pow); + _scaling_adjustment = std::pow(2, ceil_log2(rate_pow))/(2.0*rate_pow); this->update_scalar(); return _tick_rate/decim_rate; } - // Calculate compensation gain values for algorithmic gain of CORDIC and CIC taking into account + // Calculate compensation gain values for algorithmic gain of DDS and CIC taking into account // gain compensation blocks already hardcoded in place in DDC (that provide simple 1/2^n gain compensation). // Further more factor in OTW format which adds further gain factor to weight output samples correctly. void update_scalar(void){ @@ -216,7 +216,7 @@ public: const int32_t actual_scalar = boost::math::iround(target_scalar); // Calculate the error introduced by using integer representation for the scalar, can be corrected in host later. _fxpt_scalar_correction = target_scalar/actual_scalar; - // Write DDC with scaling correction for CIC and CORDIC that maximizes dynamic range in 32/16/12/8bits. + // Write DDC with scaling correction for CIC and DDS that maximizes dynamic range in 32/16/12/8bits. _iface->poke32(REG_DSP_RX_SCALE_IQ, actual_scalar); } @@ -277,7 +277,7 @@ public: .set_coercer(boost::bind(&rx_dsp_core_3000::set_host_rate, this, _1)) ; subtree->create<double>("freq/value") - .set(DEFAULT_CORDIC_FREQ) + .set(DEFAULT_DDS_FREQ) .set_coercer(boost::bind(&rx_dsp_core_3000::set_freq, this, _1)) ; subtree->create<meta_range_t>("freq/range") diff --git a/host/lib/usrp/cores/tx_dsp_core_3000.cpp b/host/lib/usrp/cores/tx_dsp_core_3000.cpp index b04a20497..cc4d23393 100644 --- a/host/lib/usrp/cores/tx_dsp_core_3000.cpp +++ b/host/lib/usrp/cores/tx_dsp_core_3000.cpp @@ -28,6 +28,7 @@ template <class T> T ceil_log2(T num){ using namespace uhd; const double tx_dsp_core_3000::DEFAULT_CORDIC_FREQ = 0.0; +const double tx_dsp_core_3000::DEFAULT_DDS_FREQ = 0.0; const double tx_dsp_core_3000::DEFAULT_RATE = 1e6; tx_dsp_core_3000::~tx_dsp_core_3000(void){ @@ -103,16 +104,15 @@ public: // Caclulate algorithmic gain of CIC for a given interpolation // For Ettus CIC R=decim, M=1, N=3. Gain = (R * M) ^ N const double rate_pow = std::pow(double(interp & 0xff), 3); - // Calculate compensation gain values for algorithmic gain of CORDIC and CIC taking into account + // Calculate compensation gain values for algorithmic gain of DDS and CIC taking into account // gain compensation blocks already hardcoded in place in DDC (that provide simple 1/2^n gain compensation). - // CORDIC algorithmic gain limits asymptotically around 1.647 after many iterations. - _scaling_adjustment = std::pow(2, ceil_log2(rate_pow))/(1.648*rate_pow); + _scaling_adjustment = std::pow(2, ceil_log2(rate_pow))/(rate_pow); this->update_scalar(); return _tick_rate/interp_rate; } - // Calculate compensation gain values for algorithmic gain of CORDIC and CIC taking into account + // Calculate compensation gain values for algorithmic gain of DDS and CIC taking into account // gain compensation blocks already hardcoded in place in DDC (that provide simple 1/2^n gain compensation). // Further more factor in OTW format which adds further gain factor to weight output samples correctly. void update_scalar(void){ @@ -177,7 +177,7 @@ public: .set_coercer(boost::bind(&tx_dsp_core_3000::set_host_rate, this, _1)) ; subtree->create<double>("freq/value") - .set(DEFAULT_CORDIC_FREQ) + .set(DEFAULT_DDS_FREQ) .set_coercer(boost::bind(&tx_dsp_core_3000::set_freq, this, _1)) ; subtree->create<meta_range_t>("freq/range") |