diff options
author | Nick Foster <nick@nerdnetworks.org> | 2011-01-21 11:12:36 -0800 |
---|---|---|
committer | Nick Foster <nick@nerdnetworks.org> | 2011-01-21 11:12:36 -0800 |
commit | a8c21f558191344754296d77fa02887b1c9f0533 (patch) | |
tree | 2bf4c0ac40bb174a4d9b9719498a8331d6d7a0b5 /host/lib | |
parent | 934824dd551b2544f29497e19360176742557582 (diff) | |
download | uhd-a8c21f558191344754296d77fa02887b1c9f0533.tar.gz uhd-a8c21f558191344754296d77fa02887b1c9f0533.tar.bz2 uhd-a8c21f558191344754296d77fa02887b1c9f0533.zip |
TVRX: fixed spectrum inversion on USRP1, hopefully for the last $%^&* time.
Diffstat (limited to 'host/lib')
-rw-r--r-- | host/lib/usrp/dboard/db_tvrx.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/host/lib/usrp/dboard/db_tvrx.cpp b/host/lib/usrp/dboard/db_tvrx.cpp index 4eb29c3e8..95657fef3 100644 --- a/host/lib/usrp/dboard/db_tvrx.cpp +++ b/host/lib/usrp/dboard/db_tvrx.cpp @@ -54,7 +54,7 @@ using namespace boost::assign; /*********************************************************************** * The tvrx constants **********************************************************************/ -static const bool tvrx_debug = false; +static const bool tvrx_debug = true; static const freq_range_t tvrx_freq_range(50e6, 860e6); @@ -383,7 +383,7 @@ static double get_alias(double freq, double fs) { double alias; freq = fmod(freq, fs); if(freq >= (fs/2)) { - alias = fs - freq; + alias = freq - fs; } else { alias = freq; } @@ -429,6 +429,14 @@ void tvrx::rx_get(const wax::obj &key_, wax::obj &val){ */ codec_rate = this->get_iface()->get_codec_rate(dboard_iface::UNIT_RX); val = (_lo_freq - tvrx_if_freq) + get_alias(tvrx_if_freq, codec_rate); + if(tvrx_debug) { + std::cout << "Getting TVRX freq..." << std::endl; + std::cout << "\tCodec rate: " << codec_rate << std::endl; + std::cout << "\tLO freq: " << _lo_freq << std::endl; + std::cout << "\tIF freq: " << tvrx_if_freq << std::endl; + std::cout << "\tAlias freq: " << get_alias(tvrx_if_freq, codec_rate) << std::endl; + std::cout << "\tCalculated freq: " << val.as<double>() << std::endl; + } return; case SUBDEV_PROP_FREQ_RANGE: |