>From bb57da3c718d9f331a132c8489b70e4e5beb4481 Mon Sep 17 00:00:00 2001 From: Sebastian Held Date: Tue, 14 Apr 2015 08:07:48 +0200 Subject: [PATCH] added lo_off parameter to tx_waveforms example --- host/examples/tx_waveforms.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/host/examples/tx_waveforms.cpp b/host/examples/tx_waveforms.cpp index 7e63326..bac6c28 100644 --- a/host/examples/tx_waveforms.cpp +++ b/host/examples/tx_waveforms.cpp @@ -95,7 +95,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){ //variables to be set by po std::string args, wave_type, ant, subdev, ref, otw, channel_list; size_t spb; - double rate, freq, gain, wave_freq, bw; + double rate, freq, gain, wave_freq, bw, lo_off; float ampl; //setup the program options @@ -106,6 +106,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){ ("spb", po::value(&spb)->default_value(0), "samples per buffer, 0 for default") ("rate", po::value(&rate), "rate of outgoing samples") ("freq", po::value(&freq), "RF center frequency in Hz") + ("lo_off", po::value(&lo_off), "Offset for frontend LO in Hz (optional)") ("ampl", po::value(&l)->default_value(float(0.3)), "amplitude of the waveform [0 to 0.7]") ("gain", po::value(&gain), "gain for the RF chain") ("ant", po::value(&ant), "antenna selection") @@ -172,6 +173,8 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){ for(size_t ch = 0; ch < channel_nums.size(); ch++) { std::cout << boost::format("Setting TX Freq: %f MHz...") % (freq/1e6) << std::endl; uhd::tune_request_t tune_request(freq); + if(vm.count("lo_off")) tune_request = uhd::tune_request_t(freq, lo_off); + else tune_request = uhd::tune_request_t(freq); if(vm.count("int-n")) tune_request.args = uhd::device_addr_t("mode_n=integer"); usrp->set_tx_freq(tune_request, channel_nums[ch]); std::cout << boost::format("Actual TX Freq: %f MHz...") % (usrp->get_tx_freq(channel_nums[ch])/1e6) << std::endl << std::endl; -- 1.9.1