aboutsummaryrefslogtreecommitdiffstats
path: root/Transceiver52M/UHDDevice.cpp
diff options
context:
space:
mode:
authorkurtis.heimerl <kurtis.heimerl@19bc5d8c-e614-43d4-8b26-e1612bc8e597>2011-11-26 03:18:39 +0000
committerkurtis.heimerl <kurtis.heimerl@19bc5d8c-e614-43d4-8b26-e1612bc8e597>2011-11-26 03:18:39 +0000
commitce31733860392debd9c9d0a6c93eb52ab47da0d8 (patch)
tree68a467239f5b53f8710514dcb3ce981ba6b926ee /Transceiver52M/UHDDevice.cpp
parent513a6291833a589ac7b8fc791b051131d1b8f158 (diff)
transceiver: add option for host based resampling
The resampling transceiver is unified with the 52MHz version. The option to resample 400ksps from the device to a GSM appropriate 270.833ksps is enabled at compile time with the following option. ./configure --with-resamp Signed-off-by: Thomas Tsou <ttsou@vt.edu> git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@2672 19bc5d8c-e614-43d4-8b26-e1612bc8e597
Diffstat (limited to 'Transceiver52M/UHDDevice.cpp')
-rw-r--r--Transceiver52M/UHDDevice.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/Transceiver52M/UHDDevice.cpp b/Transceiver52M/UHDDevice.cpp
index 37a3b96..cc90d73 100644
--- a/Transceiver52M/UHDDevice.cpp
+++ b/Transceiver52M/UHDDevice.cpp
@@ -25,10 +25,15 @@
#include <uhd/usrp/single_usrp.hpp>
#include <uhd/utils/thread_priority.hpp>
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
/*
use_ext_ref - Enable external 10MHz clock reference
- master_clk_rt - Master clock frequency
+ master_clk_rt - Master clock frequency - ignored if host resampling is
+ enabled
rx_smpl_offset - Timing correction in seconds between receive and
transmit timestamps. This value corrects for delays on
@@ -41,10 +46,15 @@
*/
const bool use_ext_ref = false;
const double master_clk_rt = 52e6;
-const double rx_smpl_offset = .0000869;
const size_t smpl_buf_sz = (1 << 20);
const float tx_ampl = .3;
+#ifdef RESAMPLE
+const double rx_smpl_offset = .00005;
+#else
+const double rx_smpl_offset = .0000869;
+#endif
+
/** Timestamp conversion
@param timestamp a UHD or OpenBTS timestamp
@param rate sample rate
@@ -290,6 +300,7 @@ double uhd_device::set_rates(double rate)
{
double actual_rt, actual_clk_rt;
+#ifndef RESAMPLE
// Set master clock rate
usrp_dev->set_master_clock_rate(master_clk_rt);
actual_clk_rt = usrp_dev->get_master_clock_rate();
@@ -298,6 +309,7 @@ double uhd_device::set_rates(double rate)
LOG(ERROR) << "Failed to set master clock rate";
return -1.0;
}
+#endif
// Set sample rates
usrp_dev->set_tx_rate(rate);