diff options
author | Josh Blum <josh@joshknows.com> | 2011-10-04 14:30:53 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2011-10-04 14:54:57 -0700 |
commit | 0347d9c15e47401238e814b7dc28aa9c27e38bcc (patch) | |
tree | 8c5b62cadf154878a3d4807a865fc3cdea15a2a9 | |
parent | 1614884af40e7c4c577db2d8bb3e27876650aed3 (diff) | |
download | uhd-0347d9c15e47401238e814b7dc28aa9c27e38bcc.tar.gz uhd-0347d9c15e47401238e814b7dc28aa9c27e38bcc.tar.bz2 uhd-0347d9c15e47401238e814b7dc28aa9c27e38bcc.zip |
gen2: fixed rate calculation when > 128
-rw-r--r-- | host/lib/usrp/cores/rx_dsp_core_200.cpp | 4 | ||||
-rw-r--r-- | host/lib/usrp/cores/tx_dsp_core_200.cpp | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/host/lib/usrp/cores/rx_dsp_core_200.cpp b/host/lib/usrp/cores/rx_dsp_core_200.cpp index a83a93d24..d562c64db 100644 --- a/host/lib/usrp/cores/rx_dsp_core_200.cpp +++ b/host/lib/usrp/cores/rx_dsp_core_200.cpp @@ -133,9 +133,11 @@ public: } double set_host_rate(const double rate){ - const size_t decim_rate = uhd::clip<size_t>( + size_t decim_rate = uhd::clip<size_t>( boost::math::iround(_tick_rate/rate), size_t(std::ceil(_tick_rate/_link_rate)), 512 ); + if (decim_rate > 128) decim_rate &= ~0x1; //CIC up to 128, have to use 1 HB + if (decim_rate > 256) decim_rate &= ~0x3; //CIC up to 128, have to use 2 HB size_t decim = decim_rate; //determine which half-band filters are activated diff --git a/host/lib/usrp/cores/tx_dsp_core_200.cpp b/host/lib/usrp/cores/tx_dsp_core_200.cpp index 222ba589a..04e9f5da4 100644 --- a/host/lib/usrp/cores/tx_dsp_core_200.cpp +++ b/host/lib/usrp/cores/tx_dsp_core_200.cpp @@ -74,9 +74,11 @@ public: } double set_host_rate(const double rate){ - const size_t interp_rate = uhd::clip<size_t>( + size_t interp_rate = uhd::clip<size_t>( boost::math::iround(_tick_rate/rate), size_t(std::ceil(_tick_rate/_link_rate)), 512 ); + if (interp_rate > 128) interp_rate &= ~0x1; //CIC up to 128, have to use 1 HB + if (interp_rate > 256) interp_rate &= ~0x3; //CIC up to 128, have to use 2 HB size_t interp = interp_rate; //determine which half-band filters are activated |