diff options
author | Josh Blum <josh@joshknows.com> | 2010-08-20 10:04:02 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2010-08-20 10:04:02 -0700 |
commit | 605483a2cf38eecdd39222622b9eab93f8061186 (patch) | |
tree | 66c57cd62ad1dcc782321313bb0d2b68e7fdd446 /host/examples | |
parent | eec4cd82ff0948652fb073d81b426fa9ce1ab7c5 (diff) | |
download | uhd-605483a2cf38eecdd39222622b9eab93f8061186.tar.gz uhd-605483a2cf38eecdd39222622b9eab93f8061186.tar.bz2 uhd-605483a2cf38eecdd39222622b9eab93f8061186.zip |
uhd: tx waveform change how error is measured
Diffstat (limited to 'host/examples')
-rw-r--r-- | host/examples/tx_waveforms.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/host/examples/tx_waveforms.cpp b/host/examples/tx_waveforms.cpp index 22975da96..b9b24f516 100644 --- a/host/examples/tx_waveforms.cpp +++ b/host/examples/tx_waveforms.cpp @@ -34,7 +34,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){ //variables to be set by po std::string args, wave_type; size_t total_duration, mspb; - double rate, freq, wave_freq; + double rate, freq, wave_freq, aepb; float ampl, gain; //setup the program options @@ -44,6 +44,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){ ("args", po::value<std::string>(&args)->default_value(""), "simple uhd device address args") ("duration", po::value<size_t>(&total_duration)->default_value(3), "number of seconds to transmit") ("mspb", po::value<size_t>(&mspb)->default_value(10000), "mimimum samples per buffer") + ("aepb", po::value<double>(&aepb)->default_value(1e-5), "allowed error per buffer") ("rate", po::value<double>(&rate)->default_value(100e6/16), "rate of outgoing samples") ("freq", po::value<double>(&freq)->default_value(0), "rf center frequency in Hz") ("ampl", po::value<float>(&l)->default_value(float(0.3)), "amplitude of the waveform") @@ -103,7 +104,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){ while (true){ double num_samps_per_buff = periods_per_buff*samps_per_period; double sample_error = num_samps_per_buff - boost::math::round(num_samps_per_buff); - if (std::abs(sample_error/num_samps_per_buff) < 1e-5) break; + if (std::abs(sample_error) <= aepb) break; periods_per_buff++; } |