From 4b18ab84921a88f0448632355e8165ecaff4ed6f Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Sun, 1 May 2011 09:38:30 -0700 Subject: uhd: fixed typo in tune request/result inter_freq -> rf_freq For some reason, the code said intermediate frequency, however, it was used and treated as RF frequency. It was always intended to be the RF frequency, but was misnamed due to a cognitive distortion. --- host/include/uhd/types/tune_request.hpp | 12 ++++++------ host/include/uhd/types/tune_result.hpp | 10 +++------- host/lib/types/tune.cpp | 18 +++++++++--------- host/lib/usrp/tune_helper.cpp | 26 +++++++++++++------------- host/tests/tune_helper_test.cpp | 12 ++++++------ 5 files changed, 37 insertions(+), 41 deletions(-) (limited to 'host') diff --git a/host/include/uhd/types/tune_request.hpp b/host/include/uhd/types/tune_request.hpp index b59f37c2e..9c498bfe9 100644 --- a/host/include/uhd/types/tune_request.hpp +++ b/host/include/uhd/types/tune_request.hpp @@ -32,7 +32,7 @@ namespace uhd{ struct UHD_API tune_request_t{ /*! * Make a new tune request for a particular center frequency. - * Use an automatic policy for the intermediate and DSP frequency + * Use an automatic policy for the RF and DSP frequency * to tune the chain as close as possible to the target frequency. * \param target_freq the target frequency in Hz */ @@ -40,7 +40,7 @@ namespace uhd{ /*! * Make a new tune request for a particular center frequency. - * Use a manual policy for the intermediate frequency, + * Use a manual policy for the RF frequency, * and an automatic policy for the DSP frequency, * to tune the chain as close as possible to the target frequency. * \param target_freq the target frequency in Hz @@ -65,16 +65,16 @@ namespace uhd{ double target_freq; /*! - * The policy for the intermediate frequency. + * The policy for the RF frequency. * Automatic behavior: the target frequency + default LO offset. */ - policy_t inter_freq_policy; + policy_t rf_freq_policy; /*! - * The intermediate frequency in Hz. + * The RF frequency in Hz. * Set when the policy is set to manual. */ - double inter_freq; + double rf_freq; /*! * The policy for the DSP frequency. diff --git a/host/include/uhd/types/tune_result.hpp b/host/include/uhd/types/tune_result.hpp index 9eebc161a..e51473085 100644 --- a/host/include/uhd/types/tune_result.hpp +++ b/host/include/uhd/types/tune_result.hpp @@ -24,15 +24,11 @@ namespace uhd{ /*! - * The tune result struct holds result of a 2-phase tuning: - * The struct hold the result of tuning the dboard as - * the target and actual intermediate frequency. - * The struct hold the result of tuning the DSP as - * the target and actual digital converter frequency. + * The tune result struct holds result of a 2-phase tuning. */ struct UHD_API tune_result_t{ - double target_inter_freq; - double actual_inter_freq; + double target_rf_freq; + double actual_rf_freq; double target_dsp_freq; double actual_dsp_freq; diff --git a/host/lib/types/tune.cpp b/host/lib/types/tune.cpp index 601bc20e8..154f0990f 100644 --- a/host/lib/types/tune.cpp +++ b/host/lib/types/tune.cpp @@ -23,7 +23,7 @@ using namespace uhd; tune_request_t::tune_request_t(double target_freq): target_freq(target_freq), - inter_freq_policy(POLICY_AUTO), + rf_freq_policy(POLICY_AUTO), dsp_freq_policy(POLICY_AUTO) { /* NOP */ @@ -31,8 +31,8 @@ tune_request_t::tune_request_t(double target_freq): tune_request_t::tune_request_t(double target_freq, double lo_off): target_freq(target_freq), - inter_freq_policy(POLICY_MANUAL), - inter_freq(target_freq + lo_off), + rf_freq_policy(POLICY_MANUAL), + rf_freq(target_freq + lo_off), dsp_freq_policy(POLICY_AUTO) { /* NOP */ @@ -41,12 +41,12 @@ tune_request_t::tune_request_t(double target_freq, double lo_off): std::string tune_result_t::to_pp_string(void) const{ return str(boost::format( "Tune Result:\n" - " Target Intermediate Freq: %f (MHz)\n" - " Actual Intermediate Freq: %f (MHz)\n" - " Target DSP Freq Shift: %f (MHz)\n" - " Actual DSP Freq Shift: %f (MHz)\n" + " Target RF Freq: %f (MHz)\n" + " Actual RF Freq: %f (MHz)\n" + " Target DSP Freq: %f (MHz)\n" + " Actual DSP Freq: %f (MHz)\n" ) - % (target_inter_freq/1e6) % (actual_inter_freq/1e6) - % (target_dsp_freq/1e6) % (actual_dsp_freq/1e6) + % (target_rf_freq/1e6) % (actual_rf_freq/1e6) + % (target_dsp_freq/1e6) % (actual_dsp_freq/1e6) ); } diff --git a/host/lib/usrp/tune_helper.cpp b/host/lib/usrp/tune_helper.cpp index 9637301ad..264e6c04b 100644 --- a/host/lib/usrp/tune_helper.cpp +++ b/host/lib/usrp/tune_helper.cpp @@ -49,28 +49,28 @@ static tune_result_t tune_xx_subdev_and_dsp( } //------------------------------------------------------------------ - //-- set the intermediate frequency depending upon the IF policy + //-- set the RF frequency depending upon the policy //------------------------------------------------------------------ - double target_inter_freq = 0.0; - switch (tune_request.inter_freq_policy){ + double target_rf_freq = 0.0; + switch (tune_request.rf_freq_policy){ case tune_request_t::POLICY_AUTO: - target_inter_freq = tune_request.target_freq + lo_offset; - subdev_freq_proxy = target_inter_freq; + target_rf_freq = tune_request.target_freq + lo_offset; + subdev_freq_proxy = target_rf_freq; break; case tune_request_t::POLICY_MANUAL: - target_inter_freq = tune_request.inter_freq; - subdev_freq_proxy = target_inter_freq; + target_rf_freq = tune_request.rf_freq; + subdev_freq_proxy = target_rf_freq; break; case tune_request_t::POLICY_NONE: break; //does not set } - double actual_inter_freq = subdev_freq_proxy.as(); + double actual_rf_freq = subdev_freq_proxy.as(); //------------------------------------------------------------------ //-- calculate the dsp freq, only used with automatic policy //------------------------------------------------------------------ - double target_dsp_freq = actual_inter_freq - tune_request.target_freq; + double target_dsp_freq = actual_rf_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; @@ -96,8 +96,8 @@ static tune_result_t tune_xx_subdev_and_dsp( //-- load and return the tune result //------------------------------------------------------------------ tune_result_t tune_result; - tune_result.target_inter_freq = target_inter_freq; - tune_result.actual_inter_freq = actual_inter_freq; + tune_result.target_rf_freq = target_rf_freq; + tune_result.actual_rf_freq = actual_rf_freq; tune_result.target_dsp_freq = target_dsp_freq; tune_result.actual_dsp_freq = actual_dsp_freq; return tune_result; @@ -107,13 +107,13 @@ static double derive_freq_from_xx_subdev_and_dsp( dboard_iface::unit_t unit, wax::obj subdev, wax::obj dsp ){ //extract actual dsp and IF frequencies - double actual_inter_freq = subdev[SUBDEV_PROP_FREQ].as(); + double actual_rf_freq = subdev[SUBDEV_PROP_FREQ].as(); double actual_dsp_freq = dsp[DSP_PROP_FREQ_SHIFT].as(); //invert the sign on the dsp freq given the following conditions if (unit == dboard_iface::UNIT_TX) actual_dsp_freq *= -1.0; - return actual_inter_freq - actual_dsp_freq; + return actual_rf_freq - actual_dsp_freq; } /*********************************************************************** diff --git a/host/tests/tune_helper_test.cpp b/host/tests/tune_helper_test.cpp index 51d216825..9147cd310 100644 --- a/host/tests/tune_helper_test.cpp +++ b/host/tests/tune_helper_test.cpp @@ -188,7 +188,7 @@ BOOST_AUTO_TEST_CASE(test_tune_helper_rx){ std::cout << "Testing tune helper RX automatic IF offset" << std::endl; tune_result_t tr = tune_rx_subdev_and_dsp(subdev.get_link(), dsp.get_link(), 2.3451e9); std::cout << tr.to_pp_string() << std::endl; - BOOST_CHECK_CLOSE(tr.actual_inter_freq, 2.345e9, tolerance); + BOOST_CHECK_CLOSE(tr.actual_rf_freq, 2.345e9, tolerance); BOOST_CHECK_CLOSE(tr.actual_dsp_freq, -100e3, tolerance); double freq_derived = derive_freq_from_rx_subdev_and_dsp(subdev.get_link(), dsp.get_link()); @@ -202,7 +202,7 @@ BOOST_AUTO_TEST_CASE(test_tune_helper_tx){ std::cout << "Testing tune helper TX automatic IF offset" << std::endl; tune_result_t tr = tune_tx_subdev_and_dsp(subdev.get_link(), dsp.get_link(), 2.3451e9); std::cout << tr.to_pp_string() << std::endl; - BOOST_CHECK_CLOSE(tr.actual_inter_freq, 2.345e9, tolerance); + BOOST_CHECK_CLOSE(tr.actual_rf_freq, 2.345e9, tolerance); BOOST_CHECK_CLOSE(tr.actual_dsp_freq, 100e3, tolerance); double freq_derived = derive_freq_from_tx_subdev_and_dsp(subdev.get_link(), dsp.get_link()); @@ -216,7 +216,7 @@ BOOST_AUTO_TEST_CASE(test_tune_helper_rx_nyquist){ std::cout << "Testing tune helper RX dummy basic board" << std::endl; tune_result_t tr = tune_rx_subdev_and_dsp(subdev.get_link(), dsp.get_link(), 55e6); std::cout << tr.to_pp_string() << std::endl; - BOOST_CHECK_CLOSE(tr.actual_inter_freq, 0.0, tolerance); + BOOST_CHECK_CLOSE(tr.actual_rf_freq, 0.0, tolerance); BOOST_CHECK_CLOSE(tr.actual_dsp_freq, 45e6, tolerance); double freq_derived = derive_freq_from_rx_subdev_and_dsp(subdev.get_link(), dsp.get_link()); @@ -233,19 +233,19 @@ BOOST_AUTO_TEST_CASE(test_tune_helper_rx_lo_off){ dsp[DSP_PROP_HOST_RATE] = double(4e6); tr = tune_rx_subdev_and_dsp(subdev.get_link(), dsp.get_link(), 2.45e9); std::cout << tr.to_pp_string() << std::endl; - BOOST_CHECK_CLOSE(tr.actual_inter_freq, 2.45e9+4e6/2, tolerance); + BOOST_CHECK_CLOSE(tr.actual_rf_freq, 2.45e9+4e6/2, tolerance); std::cout << "Testing tune helper RX automatic LO offset B > fs" << std::endl; subdev[SUBDEV_PROP_BANDWIDTH] = double(40e6); dsp[DSP_PROP_HOST_RATE] = double(25e6); tr = tune_rx_subdev_and_dsp(subdev.get_link(), dsp.get_link(), 2.45e9); std::cout << tr.to_pp_string() << std::endl; - BOOST_CHECK_CLOSE(tr.actual_inter_freq, 2.45e9+(40e6-25e6)/2, tolerance); + BOOST_CHECK_CLOSE(tr.actual_rf_freq, 2.45e9+(40e6-25e6)/2, tolerance); std::cout << "Testing tune helper RX automatic LO offset B < fs" << std::endl; subdev[SUBDEV_PROP_BANDWIDTH] = double(20e6); dsp[DSP_PROP_HOST_RATE] = double(25e6); tr = tune_rx_subdev_and_dsp(subdev.get_link(), dsp.get_link(), 2.45e9); std::cout << tr.to_pp_string() << std::endl; - BOOST_CHECK_CLOSE(tr.actual_inter_freq, 2.45e9, tolerance); + BOOST_CHECK_CLOSE(tr.actual_rf_freq, 2.45e9, tolerance); } -- cgit v1.2.3