From c67b06fd6541bbcd59de459e82735974cbdb3d88 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Fri, 3 Dec 2010 11:46:47 -0500 Subject: usrp: move dsp tuning wrap-around into the dsp utils (allows the dsp handler to get the full value) --- host/lib/usrp/tune_helper.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'host/lib/usrp/tune_helper.cpp') diff --git a/host/lib/usrp/tune_helper.cpp b/host/lib/usrp/tune_helper.cpp index fa40a8a26..eccee7f4b 100644 --- a/host/lib/usrp/tune_helper.cpp +++ b/host/lib/usrp/tune_helper.cpp @@ -20,7 +20,6 @@ #include #include //unit_t #include -#include #include using namespace uhd; @@ -37,7 +36,6 @@ static tune_result_t tune_xx_subdev_and_dsp( wax::obj subdev_freq_proxy = subdev[SUBDEV_PROP_FREQ]; std::string freq_name = dsp[DSP_PROP_FREQ_SHIFT_NAMES].as().at(chan); wax::obj dsp_freq_proxy = dsp[named_prop_t(DSP_PROP_FREQ_SHIFT, freq_name)]; - double dsp_sample_rate = dsp[DSP_PROP_CODEC_RATE].as(); //------------------------------------------------------------------ //-- calculate the LO offset, only used with automatic policy @@ -73,10 +71,7 @@ static tune_result_t tune_xx_subdev_and_dsp( //------------------------------------------------------------------ //-- calculate the dsp freq, only used with automatic policy //------------------------------------------------------------------ - double delta_freq = std::fmod(tune_request.target_freq - actual_inter_freq, dsp_sample_rate); - bool outside_of_nyquist = std::abs(delta_freq) > dsp_sample_rate/2.0; - double target_dsp_freq = (outside_of_nyquist)? - boost::math::sign(delta_freq)*dsp_sample_rate - delta_freq : -delta_freq; + double target_dsp_freq = actual_inter_freq - tune_request.target_freq; //invert the sign on the dsp freq given the following conditions if (unit == dboard_iface::UNIT_TX) target_dsp_freq *= -1.0; -- cgit v1.2.3