diff options
author | Mark Meserve <mark.meserve@ni.com> | 2018-08-28 15:57:38 -0500 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2018-10-17 18:08:26 -0700 |
commit | 1d5553317c39ddbb5af27b921dd94dc0d34532d2 (patch) | |
tree | 0b8e910f53784efe8133b0b94403171b4de8bf08 /host/lib | |
parent | 20f061689c9eb3024d8579331e5ba790320425f2 (diff) | |
download | uhd-1d5553317c39ddbb5af27b921dd94dc0d34532d2.tar.gz uhd-1d5553317c39ddbb5af27b921dd94dc0d34532d2.tar.bz2 uhd-1d5553317c39ddbb5af27b921dd94dc0d34532d2.zip |
twinrx: revise adf5356 frac2 register calculation
- If FRAC2 isn't exactly FRAC1 at certain frequencies, drifting spurs can
be seen in the spectrum
Diffstat (limited to 'host/lib')
-rw-r--r-- | host/lib/include/uhdlib/usrp/common/adf535x.hpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/host/lib/include/uhdlib/usrp/common/adf535x.hpp b/host/lib/include/uhdlib/usrp/common/adf535x.hpp index 8380c9d04..110c7e2dc 100644 --- a/host/lib/include/uhdlib/usrp/common/adf535x.hpp +++ b/host/lib/include/uhdlib/usrp/common/adf535x.hpp @@ -424,7 +424,7 @@ inline double adf535x_impl<adf5356_regs_t>::_set_frequency(double target_freq, d const double gcd = boost::math::gcd(static_cast<int>(_pfd_freq), static_cast<int>(freq_resolution)); const auto MOD2 = static_cast<uint16_t>(std::min(floor(_pfd_freq / gcd), static_cast<double>(ADF535X_MAX_MOD2))); - const auto FRAC2 = static_cast<uint16_t>(std::min(ceil(residue * MOD2), static_cast<double>(ADF535X_MAX_FRAC2))); + const auto FRAC2 = static_cast<uint16_t>(std::min(round(residue * MOD2), static_cast<double>(ADF535X_MAX_FRAC2))); const double coerced_vco_freq = _pfd_freq * ( double(INT) + ( |