From 2a54f8e291ded149268542a1fa23e870106d7e4b Mon Sep 17 00:00:00 2001 From: Tom Tsou Date: Thu, 8 Jan 2015 11:53:23 -0800 Subject: convert: Fix sc12 unpack shifting Resolve issue #666 "B200: Rx signal distortion when using SC12". During 12-bit unpacking, OTW samples are shifted into the high order bits of the 16-bit intermediate values. The remaining 4-bits are not zeroed and contain bits from adjacent samples. Consequently, signal distortion becomes noticable with spurs and other random signal garbage when operating at low signal levels. Signed-off-by: Tom Tsou --- host/lib/convert/convert_unpack_sc12.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'host') diff --git a/host/lib/convert/convert_unpack_sc12.cpp b/host/lib/convert/convert_unpack_sc12.cpp index a2aec2ae5..94b415355 100644 --- a/host/lib/convert/convert_unpack_sc12.cpp +++ b/host/lib/convert/convert_unpack_sc12.cpp @@ -62,17 +62,17 @@ void convert_sc12_item32_3_to_star_4 const boost::uint64_t line12 = (boost::uint64_t(line1) << 32) | line2; //step 1: shift out and mask off the individual numbers - const type i0 = type(boost::int16_t(line0 >> 16)*scalar); - const type q0 = type(boost::int16_t(line0 >> 4)*scalar); + const type i0 = type(boost::int16_t((line0 >> 16) & 0xfff0)*scalar); + const type q0 = type(boost::int16_t((line0 >> 4) & 0xfff0)*scalar); - const type i1 = type(boost::int16_t(line01 >> 24)*scalar); - const type q1 = type(boost::int16_t(line1 >> 12)*scalar); + const type i1 = type(boost::int16_t((line01 >> 24) & 0xfff0)*scalar); + const type q1 = type(boost::int16_t((line1 >> 12) & 0xfff0)*scalar); - const type i2 = type(boost::int16_t(line1 >> 0)*scalar); - const type q2 = type(boost::int16_t(line12 >> 20)*scalar); + const type i2 = type(boost::int16_t((line1 >> 0) & 0xfff0)*scalar); + const type q2 = type(boost::int16_t((line12 >> 20) & 0xfff0)*scalar); - const type i3 = type(boost::int16_t(line2 >> 8)*scalar); - const type q3 = type(boost::int16_t(line2 << 4)*scalar); + const type i3 = type(boost::int16_t((line2 >> 8) & 0xfff0)*scalar); + const type q3 = type(boost::int16_t((line2 << 4) & 0xfff0)*scalar); //step 2: load the outputs out0 = std::complex(i0, q0); -- cgit v1.2.3 From f3556c72bb8125b2ba58d4691e1b243ce99d8ab9 Mon Sep 17 00:00:00 2001 From: michael-west Date: Thu, 18 Dec 2014 18:45:48 -0800 Subject: uhd: Fix for BUG #650: multi_usrp::get_usrp_tx/rx_info returning incorrect dboard info for second mboard --- host/lib/usrp/multi_usrp.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'host') diff --git a/host/lib/usrp/multi_usrp.cpp b/host/lib/usrp/multi_usrp.cpp index 0c128dd22..175633c4c 100644 --- a/host/lib/usrp/multi_usrp.cpp +++ b/host/lib/usrp/multi_usrp.cpp @@ -393,16 +393,16 @@ public: dict usrp_info; mboard_eeprom_t mb_eeprom = _tree->access(mb_root(mcp.mboard) / "eeprom").get(); - dboard_eeprom_t db_eeprom = _tree->access(rx_rf_fe_root(mcp.chan).branch_path().branch_path() / "rx_eeprom").get(); + dboard_eeprom_t db_eeprom = _tree->access(rx_rf_fe_root(chan).branch_path().branch_path() / "rx_eeprom").get(); usrp_info["mboard_id"] = _tree->access(mb_root(mcp.mboard) / "name").get(); usrp_info["mboard_name"] = mb_eeprom["name"]; usrp_info["mboard_serial"] = mb_eeprom["serial"]; usrp_info["rx_id"] = db_eeprom.id.to_pp_string(); - usrp_info["rx_subdev_name"] = _tree->access(rx_rf_fe_root(mcp.chan) / "name").get(); + usrp_info["rx_subdev_name"] = _tree->access(rx_rf_fe_root(chan) / "name").get(); usrp_info["rx_subdev_spec"] = _tree->access(mb_root(mcp.mboard) / "rx_subdev_spec").get().to_string(); usrp_info["rx_serial"] = db_eeprom.serial; - usrp_info["rx_antenna"] = _tree->access(rx_rf_fe_root(mcp.chan) / "antenna" / "value").get(); + usrp_info["rx_antenna"] = _tree->access(rx_rf_fe_root(chan) / "antenna" / "value").get(); return usrp_info; } @@ -412,16 +412,16 @@ public: dict usrp_info; mboard_eeprom_t mb_eeprom = _tree->access(mb_root(mcp.mboard) / "eeprom").get(); - dboard_eeprom_t db_eeprom = _tree->access(tx_rf_fe_root(mcp.chan).branch_path().branch_path() / "tx_eeprom").get(); + dboard_eeprom_t db_eeprom = _tree->access(tx_rf_fe_root(chan).branch_path().branch_path() / "tx_eeprom").get(); usrp_info["mboard_id"] = _tree->access(mb_root(mcp.mboard) / "name").get(); usrp_info["mboard_name"] = mb_eeprom["name"]; usrp_info["mboard_serial"] = mb_eeprom["serial"]; usrp_info["tx_id"] = db_eeprom.id.to_pp_string(); - usrp_info["tx_subdev_name"] = _tree->access(tx_rf_fe_root(mcp.chan) / "name").get(); + usrp_info["tx_subdev_name"] = _tree->access(tx_rf_fe_root(chan) / "name").get(); usrp_info["tx_subdev_spec"] = _tree->access(mb_root(mcp.mboard) / "tx_subdev_spec").get().to_string(); usrp_info["tx_serial"] = db_eeprom.serial; - usrp_info["tx_antenna"] = _tree->access(tx_rf_fe_root(mcp.chan) / "antenna" / "value").get(); + usrp_info["tx_antenna"] = _tree->access(tx_rf_fe_root(chan) / "antenna" / "value").get(); return usrp_info; } -- cgit v1.2.3 From 0b9b070515eaae6a631095f2d08d664e07ee4140 Mon Sep 17 00:00:00 2001 From: michael-west Date: Mon, 29 Dec 2014 23:15:09 -0800 Subject: x300: Fix for BUG #655: X300: Device Time Not Getting Set from GPSDO - Moved setting of tick rate before setting of PPS time --- host/lib/usrp/x300/x300_impl.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'host') diff --git a/host/lib/usrp/x300/x300_impl.cpp b/host/lib/usrp/x300/x300_impl.cpp index a879ae02d..eab5cfef2 100644 --- a/host/lib/usrp/x300/x300_impl.cpp +++ b/host/lib/usrp/x300/x300_impl.cpp @@ -755,6 +755,12 @@ void x300_impl::setup_mb(const size_t mb_i, const uhd::device_addr_t &dev_addr) _tree->create(mb_path / "clock_source" / "output") .subscribe(boost::bind(&x300_clock_ctrl::set_ref_out, mb.clock, _1)); + //initialize tick rate (must be done before setting time) + _tree->access(mb_path / "tick_rate") + .subscribe(boost::bind(&x300_impl::set_tick_rate, this, boost::ref(mb), _1)) + .subscribe(boost::bind(&x300_impl::update_tick_rate, this, boost::ref(mb), _1)) + .set(mb.clock->get_master_clock_rate()); + //////////////////////////////////////////////////////////////////// // initialize clock and time sources //////////////////////////////////////////////////////////////////// @@ -789,14 +795,6 @@ void x300_impl::setup_mb(const size_t mb_i, const uhd::device_addr_t &dev_addr) _tree->create(mb_path / "sensors" / "ref_locked") .publish(boost::bind(&x300_impl::get_ref_locked, this, mb.zpu_ctrl)); - //////////////////////////////////////////////////////////////////// - // create clock properties - //////////////////////////////////////////////////////////////////// - _tree->access(mb_path / "tick_rate") - .subscribe(boost::bind(&x300_impl::set_tick_rate, this, boost::ref(mb), _1)) - .subscribe(boost::bind(&x300_impl::update_tick_rate, this, boost::ref(mb), _1)) - .set(mb.clock->get_master_clock_rate()); - //////////////////////////////////////////////////////////////////// // do some post-init tasks //////////////////////////////////////////////////////////////////// -- cgit v1.2.3