aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulian Arnold <julian.arnold@ettus.com>2015-02-20 10:49:53 -0800
committerJulian Arnold <julian.arnold@ettus.com>2015-02-20 11:00:33 -0800
commit4602ea9148e5e36fefca6402b7dcc5a1104e7410 (patch)
treeac1430e084641e4689dceafbb70b8af5c9b961ca
parent09c9c6bb77d4f1f2fa0682835fc3a6ef6e3e851a (diff)
downloaduhd-4602ea9148e5e36fefca6402b7dcc5a1104e7410.tar.gz
uhd-4602ea9148e5e36fefca6402b7dcc5a1104e7410.tar.bz2
uhd-4602ea9148e5e36fefca6402b7dcc5a1104e7410.zip
uhd: iq imbalance correction api
-rw-r--r--host/include/uhd/usrp/multi_usrp.hpp8
-rw-r--r--host/lib/usrp/multi_usrp.cpp17
2 files changed, 25 insertions, 0 deletions
diff --git a/host/include/uhd/usrp/multi_usrp.hpp b/host/include/uhd/usrp/multi_usrp.hpp
index cebfda5a2..8357b9ffb 100644
--- a/host/include/uhd/usrp/multi_usrp.hpp
+++ b/host/include/uhd/usrp/multi_usrp.hpp
@@ -652,6 +652,14 @@ public:
virtual void set_rx_dc_offset(const std::complex<double> &offset, size_t chan = ALL_CHANS) = 0;
/*!
+ * Enable/disable the automatic IQ imbalance correction.
+ *
+ * \param enb true to enable automatic IQ balance correction
+ * \param chan the channel index 0 to N-1
+ */
+ virtual void set_rx_iq_balance(const bool enb, size_t chan) = 0;
+
+ /*!
* Set the RX frontend IQ imbalance correction.
* Use this to adjust the magnitude and phase of I and Q.
*
diff --git a/host/lib/usrp/multi_usrp.cpp b/host/lib/usrp/multi_usrp.cpp
index eab8c5283..e7d39b244 100644
--- a/host/lib/usrp/multi_usrp.cpp
+++ b/host/lib/usrp/multi_usrp.cpp
@@ -916,6 +916,9 @@ public:
if (chan != ALL_CHANS){
if (_tree->exists(rx_fe_root(chan) / "dc_offset" / "enable")) {
_tree->access<bool>(rx_fe_root(chan) / "dc_offset" / "enable").set(enb);
+ } else if (_tree->exists(rx_rf_fe_root(chan) / "dc_offset" / "enable")) {
+ /*For B2xx devices the dc-offset correction is implemented in the rf front-end*/
+ _tree->access<bool>(rx_rf_fe_root(chan) / "dc_offset" / "enable").set(enb);
} else {
UHD_MSG(warning) << "Setting DC offset compensation is not possible on this device." << std::endl;
}
@@ -940,6 +943,20 @@ public:
}
}
+ void set_rx_iq_balance(const bool enb, size_t chan){
+ if (chan != ALL_CHANS){
+ if (_tree->exists(rx_rf_fe_root(chan) / "iq_balance" / "enable")) {
+ _tree->access<bool>(rx_rf_fe_root(chan) / "iq_balance" / "enable").set(enb);
+ } else {
+ UHD_MSG(warning) << "Setting IQ imbalance compensation is not possible on this device." << std::endl;
+ }
+ return;
+ }
+ for (size_t c = 0; c < get_rx_num_channels(); c++){
+ this->set_rx_iq_balance(enb, c);
+ }
+ }
+
void set_rx_iq_balance(const std::complex<double> &offset, size_t chan){
if (chan != ALL_CHANS){
if (_tree->exists(rx_fe_root(chan) / "iq_balance" / "value")) {