diff options
author | Josh Blum <josh@joshknows.com> | 2012-09-28 16:30:01 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2012-09-28 16:30:01 -0700 |
commit | ce51fa3c1c4c8b670acd7b4606b631d6bb91dd29 (patch) | |
tree | 689f4562253243aa1889f58fd8c3d4052afd00dd | |
parent | 8edd3a724934310bf9545f272420b43035e65882 (diff) | |
download | uhd-ce51fa3c1c4c8b670acd7b4606b631d6bb91dd29.tar.gz uhd-ce51fa3c1c4c8b670acd7b4606b631d6bb91dd29.tar.bz2 uhd-ce51fa3c1c4c8b670acd7b4606b631d6bb91dd29.zip |
usrp: added CIC warning to DSP rx and tx
-rw-r--r-- | host/lib/usrp/cores/rx_dsp_core_200.cpp | 9 | ||||
-rw-r--r-- | host/lib/usrp/cores/tx_dsp_core_200.cpp | 9 |
2 files changed, 18 insertions, 0 deletions
diff --git a/host/lib/usrp/cores/rx_dsp_core_200.cpp b/host/lib/usrp/cores/rx_dsp_core_200.cpp index ae67c46ef..7af4923c8 100644 --- a/host/lib/usrp/cores/rx_dsp_core_200.cpp +++ b/host/lib/usrp/cores/rx_dsp_core_200.cpp @@ -184,6 +184,15 @@ public: _iface->poke32(REG_DSP_RX_DECIM, (hb1 << 9) | (hb0 << 8) | (decim & 0xff)); + if (decim > 1 and hb0 == 0 and hb1 == 0) + { + UHD_MSG(warning) << boost::format( + "The requested decimation is odd; the user should expect CIC rolloff.\n" + "Select an even decimation to ensure that a halfband filter is enabled.\n" + "decimation = dsp_rate/samp_rate -> %d = (%f MHz)/(%f MHz)\n" + ) % decim_rate % (_tick_rate/1e6) % (rate/1e6); + } + // Calculate CIC decimation (i.e., without halfband decimators) // Calculate closest multiplier constant to reverse gain absent scale multipliers const double rate_pow = std::pow(double(decim & 0xff), 4); diff --git a/host/lib/usrp/cores/tx_dsp_core_200.cpp b/host/lib/usrp/cores/tx_dsp_core_200.cpp index 2faf7c28b..c37868b26 100644 --- a/host/lib/usrp/cores/tx_dsp_core_200.cpp +++ b/host/lib/usrp/cores/tx_dsp_core_200.cpp @@ -126,6 +126,15 @@ public: _iface->poke32(REG_DSP_TX_INTERP, (hb1 << 9) | (hb0 << 8) | (interp & 0xff)); + if (interp > 1 and hb0 == 0 and hb1 == 0) + { + UHD_MSG(warning) << boost::format( + "The requested interpolation is odd; the user should expect CIC rolloff.\n" + "Select an even interpolation to ensure that a halfband filter is enabled.\n" + "interpolation = dsp_rate/samp_rate -> %d = (%f MHz)/(%f MHz)\n" + ) % interp_rate % (_tick_rate/1e6) % (rate/1e6); + } + // Calculate CIC interpolation (i.e., without halfband interpolators) // Calculate closest multiplier constant to reverse gain absent scale multipliers const double rate_pow = std::pow(double(interp & 0xff), 3); |