aboutsummaryrefslogtreecommitdiffstats
path: root/host
diff options
context:
space:
mode:
authornatetemple <nate.temple@ettus.com>2019-01-09 11:35:52 -0800
committerBrent Stapleton <brent.stapleton@ettus.com>2019-01-10 09:47:33 -0800
commita476cba5f5cc753c90749d1573ae286286a89c98 (patch)
treef238c655b397cb61dd4fc7f66cc305e490c18607 /host
parentb5e80dfb2a67e525283fd05e05c9b4821c15843b (diff)
downloaduhd-a476cba5f5cc753c90749d1573ae286286a89c98.tar.gz
uhd-a476cba5f5cc753c90749d1573ae286286a89c98.tar.bz2
uhd-a476cba5f5cc753c90749d1573ae286286a89c98.zip
Examples: Add lo-offset to tx_waveforms
Diffstat (limited to 'host')
-rw-r--r--host/examples/tx_waveforms.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/host/examples/tx_waveforms.cpp b/host/examples/tx_waveforms.cpp
index b432741fa..c4d850820 100644
--- a/host/examples/tx_waveforms.cpp
+++ b/host/examples/tx_waveforms.cpp
@@ -40,7 +40,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
std::string args, wave_type, ant, subdev, ref, pps, otw, channel_list;
uint64_t total_num_samps;
size_t spb;
- double rate, freq, gain, wave_freq, bw;
+ double rate, freq, gain, wave_freq, bw, lo_offset;
float ampl;
//setup the program options
@@ -52,6 +52,8 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
("nsamps", po::value<uint64_t>(&total_num_samps)->default_value(0), "total number of samples to transmit")
("rate", po::value<double>(&rate), "rate of outgoing samples")
("freq", po::value<double>(&freq), "RF center frequency in Hz")
+ ("lo-offset", po::value<double>(&lo_offset)->default_value(0.0),
+ "Offset for frontend LO in Hz (optional)")
("ampl", po::value<float>(&ampl)->default_value(float(0.3)), "amplitude of the waveform [0 to 0.7]")
("gain", po::value<double>(&gain), "gain for the RF chain")
("ant", po::value<std::string>(&ant), "antenna selection")
@@ -117,7 +119,9 @@ 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);
+ std::cout << boost::format("Setting TX 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_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;