diff options
Diffstat (limited to 'host')
| -rw-r--r-- | host/include/uhd/usrp/multi_usrp.hpp | 8 | ||||
| -rw-r--r-- | host/lib/usrp/multi_usrp.cpp | 17 | 
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")) { | 
