From 11e9429b9515f4e6315b867dbe2fcd17bd8a96a8 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Fri, 24 Feb 2012 10:00:44 -0800 Subject: usrp1: fix to use the db connection type to determine DAC sign Unlike the other products, usrp1 uses the DAC and not DSP to perform baseband frequency shifting in the hardware. Therefore this shifting occurs before I and Q swapping, and so, the sign of the frequency needs to be inverted on daughterboards which have inverted I and Q TX inputs. --- host/lib/usrp/usrp1/io_impl.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'host/lib/usrp') diff --git a/host/lib/usrp/usrp1/io_impl.cpp b/host/lib/usrp/usrp1/io_impl.cpp index ff2b6017f..d256df660 100644 --- a/host/lib/usrp/usrp1/io_impl.cpp +++ b/host/lib/usrp/usrp1/io_impl.cpp @@ -549,8 +549,16 @@ double usrp1_impl::update_rx_dsp_freq(const size_t dspno, const double freq_){ } double usrp1_impl::update_tx_dsp_freq(const size_t dspno, const double freq){ - //map the freq shift key to a subdev spec to a particular codec chip - _dbc[_tx_subdev_spec.at(dspno).db_name].codec->set_duc_freq(freq, _master_clock_rate); + const subdev_spec_pair_t pair = _tx_subdev_spec.at(dspno); + + //determine the connection type and hence, the sign + const std::string conn = _tree->access(str(boost::format( + "/mboards/0/dboards/%s/tx_frontends/%s/connection" + ) % pair.db_name % pair.sd_name)).get(); + double sign = (conn == "I" or conn == "IQ")? +1.0 : -1.0; + + //map this DSP's subdev spec to a particular codec chip + _dbc[pair.db_name].codec->set_duc_freq(sign*freq, _master_clock_rate); return freq; //assume infinite precision } -- cgit v1.2.3