diff options
author | Josh Blum <josh@joshknows.com> | 2011-11-10 17:29:18 -0800 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2011-11-10 17:29:18 -0800 |
commit | 3cb60c974fff6779396294fd456904d1f6addd71 (patch) | |
tree | 32cc650d14243bd60c054a6ca475d30711a4c4fe /host/lib/usrp/cores | |
parent | bb2259e05f03ddffe7b789c4aa16d86e4cfa575c (diff) | |
download | uhd-3cb60c974fff6779396294fd456904d1f6addd71.tar.gz uhd-3cb60c974fff6779396294fd456904d1f6addd71.tar.bz2 uhd-3cb60c974fff6779396294fd456904d1f6addd71.zip |
uhd: basically usable cal sweep for wbx
Diffstat (limited to 'host/lib/usrp/cores')
-rw-r--r-- | host/lib/usrp/cores/rx_frontend_core_200.cpp | 4 | ||||
-rw-r--r-- | host/lib/usrp/cores/tx_frontend_core_200.cpp | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/host/lib/usrp/cores/rx_frontend_core_200.cpp b/host/lib/usrp/cores/rx_frontend_core_200.cpp index d42022947..d6396ef45 100644 --- a/host/lib/usrp/cores/rx_frontend_core_200.cpp +++ b/host/lib/usrp/cores/rx_frontend_core_200.cpp @@ -64,8 +64,8 @@ public: } void set_iq_balance(const std::complex<double> &cor){ - _iface->poke32(REG_RX_FE_MAG_CORRECTION, fs_to_bits(std::abs(cor), 18)); - _iface->poke32(REG_RX_FE_PHASE_CORRECTION, fs_to_bits(std::atan2(cor.real(), cor.imag()), 18)); + _iface->poke32(REG_RX_FE_MAG_CORRECTION, fs_to_bits(std::abs(cor) - 1, 18)); + _iface->poke32(REG_RX_FE_PHASE_CORRECTION, fs_to_bits(std::arg(cor)/6.28318531, 18)); } private: diff --git a/host/lib/usrp/cores/tx_frontend_core_200.cpp b/host/lib/usrp/cores/tx_frontend_core_200.cpp index 327e8d344..b90281d9f 100644 --- a/host/lib/usrp/cores/tx_frontend_core_200.cpp +++ b/host/lib/usrp/cores/tx_frontend_core_200.cpp @@ -62,8 +62,8 @@ public: } void set_iq_balance(const std::complex<double> &cor){ - _iface->poke32(REG_TX_FE_MAG_CORRECTION, fs_to_bits(std::abs(cor), 18)); - _iface->poke32(REG_TX_FE_PHASE_CORRECTION, fs_to_bits(std::atan2(cor.real(), cor.imag()), 18)); + _iface->poke32(REG_TX_FE_MAG_CORRECTION, fs_to_bits(std::abs(cor) - 1, 18)); + _iface->poke32(REG_TX_FE_PHASE_CORRECTION, fs_to_bits(std::arg(cor)/6.28318531, 18)); } private: |