From b2c0d1f55a1c2190a6a6fd5967eb0a6ffd60b272 Mon Sep 17 00:00:00 2001 From: Jason Abele Date: Mon, 13 Feb 2012 14:27:59 -0800 Subject: Make DBSRX* set default bandwidth based on codec rate --- host/lib/usrp/dboard/db_dbsrx.cpp | 3 ++- host/lib/usrp/dboard/db_dbsrx2.cpp | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'host/lib/usrp/dboard') diff --git a/host/lib/usrp/dboard/db_dbsrx.cpp b/host/lib/usrp/dboard/db_dbsrx.cpp index ff4bce20d..846597f06 100644 --- a/host/lib/usrp/dboard/db_dbsrx.cpp +++ b/host/lib/usrp/dboard/db_dbsrx.cpp @@ -193,7 +193,8 @@ dbsrx::dbsrx(ctor_args_t args) : rx_dboard_base(args){ this->send_reg(0x0, 0x5); //set defaults for LO, gains, and filter bandwidth - _bandwidth = 33e6; + double codec_rate = this->get_iface()->get_codec_rate(dboard_iface::UNIT_RX); + _bandwidth = 0.8*codec_rate/2.0; // default to anti-alias at different codec_rate //////////////////////////////////////////////////////////////////// // Register properties diff --git a/host/lib/usrp/dboard/db_dbsrx2.cpp b/host/lib/usrp/dboard/db_dbsrx2.cpp index 01eec133f..517b7b183 100644 --- a/host/lib/usrp/dboard/db_dbsrx2.cpp +++ b/host/lib/usrp/dboard/db_dbsrx2.cpp @@ -214,9 +214,13 @@ dbsrx2::dbsrx2(ctor_args_t args) : rx_dboard_base(args){ .set(true); //always enabled this->get_rx_subtree()->create("use_lo_offset") .set(false); + + double codec_rate = this->get_iface()->get_codec_rate(dboard_iface::UNIT_RX); + this->get_rx_subtree()->create("bandwidth/value") .coerce(boost::bind(&dbsrx2::set_bandwidth, this, _1)) - .set(2.0*40.0e6); //bandwidth in lowpass, convert to complex bandpass + .set(2.0*(0.8*codec_rate/2.0)); //bandwidth in lowpass, convert to complex bandpass + //default to anti-alias at different codec_rate this->get_rx_subtree()->create("bandwidth/range") .set(dbsrx2_bandwidth_range); -- cgit v1.2.3