aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/cores
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2011-11-16 10:36:59 -0800
committerJosh Blum <josh@joshknows.com>2011-11-16 10:36:59 -0800
commit65b6acc1ac877849eb6cbe1a654562ca22e42c07 (patch)
treebeca09db5794eb5a797c1c94e6ed4ad523a17f84 /host/lib/usrp/cores
parenteb11b05298dde8df750e903fe7d791050666278d (diff)
parent95568c8b30490f630a72b665b135c46549ee5882 (diff)
downloaduhd-65b6acc1ac877849eb6cbe1a654562ca22e42c07.tar.gz
uhd-65b6acc1ac877849eb6cbe1a654562ca22e42c07.tar.bz2
uhd-65b6acc1ac877849eb6cbe1a654562ca22e42c07.zip
Merge branch 'calibration'
Diffstat (limited to 'host/lib/usrp/cores')
-rw-r--r--host/lib/usrp/cores/rx_frontend_core_200.cpp4
-rw-r--r--host/lib/usrp/cores/tx_frontend_core_200.cpp4
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: