aboutsummaryrefslogtreecommitdiffstats
path: root/host/examples
diff options
context:
space:
mode:
authornatetemple <nate.temple@ettus.com>2019-01-09 11:13:12 -0800
committerBrent Stapleton <brent.stapleton@ettus.com>2019-01-10 09:47:33 -0800
commit75ea70537875042f6ba683799963397ae5802742 (patch)
treea676153e8563a6bd9c5c752ffa894eff38d9567e /host/examples
parentf1d6d1e480ca873259c816c0bd2dac5eb7aecd5a (diff)
downloaduhd-75ea70537875042f6ba683799963397ae5802742.tar.gz
uhd-75ea70537875042f6ba683799963397ae5802742.tar.bz2
uhd-75ea70537875042f6ba683799963397ae5802742.zip
Examples: Add LO Offset to rx_samples_to_file
Diffstat (limited to 'host/examples')
-rw-r--r--host/examples/rx_samples_to_file.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/host/examples/rx_samples_to_file.cpp b/host/examples/rx_samples_to_file.cpp
index cc324643f..cd3f00d5c 100644
--- a/host/examples/rx_samples_to_file.cpp
+++ b/host/examples/rx_samples_to_file.cpp
@@ -230,7 +230,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
//variables to be set by po
std::string args, file, type, ant, subdev, ref, wirefmt;
size_t channel, total_num_samps, spb;
- double rate, freq, gain, bw, total_time, setup_time;
+ double rate, freq, gain, bw, total_time, setup_time, lo_offset;
//setup the program options
po::options_description desc("Allowed options");
@@ -245,6 +245,8 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
("spb", po::value<size_t>(&spb)->default_value(10000), "samples per buffer")
("rate", po::value<double>(&rate)->default_value(1e6), "rate of incoming samples")
("freq", po::value<double>(&freq)->default_value(0.0), "RF center frequency in Hz")
+ ("lo-offset", po::value<double>(&lo_offset)->default_value(0.0),
+ "Offset for frontend LO in Hz (optional)")
("gain", po::value<double>(&gain), "gain for the RF chain")
("ant", po::value<std::string>(&ant), "antenna selection")
("subdev", po::value<std::string>(&subdev), "subdevice specification")
@@ -309,7 +311,9 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
//set the center frequency
if (vm.count("freq")) { //with default of 0.0 this will always be true
std::cout << boost::format("Setting RX Freq: %f MHz...") % (freq/1e6) << std::endl;
- uhd::tune_request_t tune_request(freq);
+ std::cout << boost::format("Setting RX LO Offset: %f MHz...") % (lo_offset/1e6)
+ << std::endl;
+ uhd::tune_request_t tune_request(freq, lo_offset);
if(vm.count("int-n")) tune_request.args = uhd::device_addr_t("mode_n=integer");
usrp->set_rx_freq(tune_request, channel);
std::cout << boost::format("Actual RX Freq: %f MHz...") % (usrp->get_rx_freq(channel)/1e6) << std::endl << std::endl;