From aab82ad7470a68503f44645ca18d5b4686c784e1 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Sat, 5 Nov 2011 11:44:37 -0700 Subject: uhd: performance speed up for tx waveforms, no iterative libmath per sample --- host/examples/tx_waveforms.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/host/examples/tx_waveforms.cpp b/host/examples/tx_waveforms.cpp index 6e5c53642..aaabf5460 100644 --- a/host/examples/tx_waveforms.cpp +++ b/host/examples/tx_waveforms.cpp @@ -76,7 +76,7 @@ public: } inline std::complex operator()(const double theta) const{ - return _wave_table[unsigned(boost::math::iround(theta*wave_table_len))%wave_table_len]; + return _wave_table[unsigned(theta*wave_table_len)%wave_table_len]; } private: @@ -100,7 +100,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){ desc.add_options() ("help", "help message") ("args", po::value(&args)->default_value(""), "single uhd device address args") - ("spb", po::value(&spb)->default_value(10000), "samples per buffer") + ("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") ("ampl", po::value(&l)->default_value(float(0.3)), "amplitude of the waveform [0 to 0.7]") @@ -203,6 +203,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){ double theta = 0; //allocate a buffer which we re-use for each channel + if (spb == 0) spb = tx_stream->get_max_num_samps()*10; std::vector > buff(spb); std::vector *> buffs(usrp->get_tx_num_channels(), &buff.front()); -- cgit v1.2.3