summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Abele <jason@ettus.com>2012-02-01 10:34:23 -0800
committerJosh Blum <josh@joshknows.com>2012-03-11 15:53:59 -0700
commit715fd038325fa4a265328fac2bdb54850b990ea7 (patch)
treefabdd93ee0e790f8692d5f865414bd8a8ac9da2b
parent38b138b3f31dfaaa4203d82e73be352a03f59280 (diff)
downloaduhd-715fd038325fa4a265328fac2bdb54850b990ea7.tar.gz
uhd-715fd038325fa4a265328fac2bdb54850b990ea7.tar.bz2
uhd-715fd038325fa4a265328fac2bdb54850b990ea7.zip
Fix RSSI measurement
Improve incorrect calculation in XCVR Remove RFX rssi sensor due to limited dynamic range giving strange results
-rw-r--r--host/docs/dboards.rst1
-rw-r--r--host/lib/usrp/dboard/db_rfx.cpp18
-rw-r--r--host/lib/usrp/dboard/db_xcvr2450.cpp4
3 files changed, 4 insertions, 19 deletions
diff --git a/host/docs/dboards.rst b/host/docs/dboards.rst
index 218498dd2..d41bf824c 100644
--- a/host/docs/dboards.rst
+++ b/host/docs/dboards.rst
@@ -136,7 +136,6 @@ Bandwidths (Hz):
Sensors:
* **lo_locked**: boolean for LO lock state
-* **rssi**: float for rssi in dBm
^^^^^^^^^^^^^^^^^^^^^^^^^^^
XCVR 2450
diff --git a/host/lib/usrp/dboard/db_rfx.cpp b/host/lib/usrp/dboard/db_rfx.cpp
index 58382f180..32aa3fe04 100644
--- a/host/lib/usrp/dboard/db_rfx.cpp
+++ b/host/lib/usrp/dboard/db_rfx.cpp
@@ -111,21 +111,9 @@ private:
}
/*!
- * Read the RSSI from the aux adc
- * \return the rssi sensor in dBm
+ * Removed incorrect/confusing RSSI calculation
+ * Limited dynamic range of sensor makes this less useful
*/
- sensor_value_t get_rssi(void){
- //RSSI from VAGC vs RF Power, Fig 34, pg 13
- double max_power = -3.0;
-
- //constants for the rssi calculation
- static const double min_v = 0.35, max_v = 1.0;
- static const double rssi_dyn_range = 60;
- //calculate the rssi from the voltage
- double voltage = this->get_iface()->read_aux_adc(dboard_iface::UNIT_RX, dboard_iface::AUX_ADC_B);
- const double rssi = max_power - rssi_dyn_range*(voltage - min_v)/(max_v - min_v);
- return sensor_value_t("RSSI", rssi, "dBm");
- }
};
/***********************************************************************
@@ -189,8 +177,6 @@ rfx_xcvr::rfx_xcvr(
this->get_rx_subtree()->create<std::string>("name").set("RFX RX");
this->get_rx_subtree()->create<sensor_value_t>("sensors/lo_locked")
.publish(boost::bind(&rfx_xcvr::get_locked, this, dboard_iface::UNIT_RX));
- this->get_rx_subtree()->create<sensor_value_t>("sensors/rssi")
- .publish(boost::bind(&rfx_xcvr::get_rssi, this));
BOOST_FOREACH(const std::string &name, _rx_gain_ranges.keys()){
this->get_rx_subtree()->create<double>("gains/"+name+"/value")
.coerce(boost::bind(&rfx_xcvr::set_rx_gain, this, _1, name))
diff --git a/host/lib/usrp/dboard/db_xcvr2450.cpp b/host/lib/usrp/dboard/db_xcvr2450.cpp
index 7c76c45ef..0fdad0d40 100644
--- a/host/lib/usrp/dboard/db_xcvr2450.cpp
+++ b/host/lib/usrp/dboard/db_xcvr2450.cpp
@@ -171,8 +171,8 @@ private:
}
//constants for the rssi calculation
- static const double min_v = 0.5, max_v = 2.5;
- static const double rssi_dyn_range = 60;
+ static const double min_v = 2.5, max_v = 0.5;
+ static const double rssi_dyn_range = 60.0;
//calculate the rssi from the voltage
double voltage = this->get_iface()->read_aux_adc(dboard_iface::UNIT_RX, dboard_iface::AUX_ADC_B);
double rssi = max_power - rssi_dyn_range*(voltage - min_v)/(max_v - min_v);