aboutsummaryrefslogtreecommitdiffstats
path: root/host/examples
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2011-01-11 19:46:45 -0800
committerJosh Blum <josh@joshknows.com>2011-01-11 19:46:45 -0800
commit395bbbbc1118b061262a10d5c847f17a4fd0c6ae (patch)
tree6347a18702529cfd42dcb94c37ce2866b49b93f4 /host/examples
parent18defbd9d40a4c11a33025c8684f48fe51f102c5 (diff)
downloaduhd-395bbbbc1118b061262a10d5c847f17a4fd0c6ae.tar.gz
uhd-395bbbbc1118b061262a10d5c847f17a4fd0c6ae.tar.bz2
uhd-395bbbbc1118b061262a10d5c847f17a4fd0c6ae.zip
uhd: replace all the instances of float not pertaining to io types with double, simplifies life
Diffstat (limited to 'host/examples')
-rw-r--r--host/examples/rx_ascii_art_dft.cpp6
-rw-r--r--host/examples/rx_samples_to_file.cpp5
-rw-r--r--host/examples/rx_samples_to_udp.cpp5
-rw-r--r--host/examples/tx_from_file.cpp7
-rw-r--r--host/examples/tx_waveforms.cpp6
5 files changed, 13 insertions, 16 deletions
diff --git a/host/examples/rx_ascii_art_dft.cpp b/host/examples/rx_ascii_art_dft.cpp
index 5a24867b4..b677bcb07 100644
--- a/host/examples/rx_ascii_art_dft.cpp
+++ b/host/examples/rx_ascii_art_dft.cpp
@@ -34,8 +34,8 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
//variables to be set by po
std::string args;
size_t num_bins;
- double rate, freq, frame_rate;
- float gain, ref_lvl, dyn_rng;
+ double rate, freq, gain, frame_rate;
+ float ref_lvl, dyn_rng;
//setup the program options
po::options_description desc("Allowed options");
@@ -45,7 +45,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
// hardware parameters
("rate", po::value<double>(&rate), "rate of incoming samples (sps)")
("freq", po::value<double>(&freq)->default_value(0), "RF center frequency in Hz")
- ("gain", po::value<float>(&gain)->default_value(0), "gain for the RF chain")
+ ("gain", po::value<double>(&gain)->default_value(0), "gain for the RF chain")
// display parameters
("num-bins", po::value<size_t>(&num_bins)->default_value(512), "the number of bins in the DFT")
("frame-rate", po::value<double>(&frame_rate)->default_value(5), "frame rate of the display (fps)")
diff --git a/host/examples/rx_samples_to_file.cpp b/host/examples/rx_samples_to_file.cpp
index c80d2a6de..6a6528a12 100644
--- a/host/examples/rx_samples_to_file.cpp
+++ b/host/examples/rx_samples_to_file.cpp
@@ -33,8 +33,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
//variables to be set by po
std::string args, file;
size_t total_num_samps;
- double rate, freq;
- float gain;
+ double rate, freq, gain;
//setup the program options
po::options_description desc("Allowed options");
@@ -45,7 +44,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
("nsamps", po::value<size_t>(&total_num_samps)->default_value(1000), "total number of samples to receive")
("rate", po::value<double>(&rate)->default_value(100e6/16), "rate of incoming samples")
("freq", po::value<double>(&freq)->default_value(0), "rf center frequency in Hz")
- ("gain", po::value<float>(&gain)->default_value(0), "gain for the RF chain")
+ ("gain", po::value<double>(&gain)->default_value(0), "gain for the RF chain")
;
po::variables_map vm;
po::store(po::parse_command_line(argc, argv, desc), vm);
diff --git a/host/examples/rx_samples_to_udp.cpp b/host/examples/rx_samples_to_udp.cpp
index 488c95494..5f1cd4a57 100644
--- a/host/examples/rx_samples_to_udp.cpp
+++ b/host/examples/rx_samples_to_udp.cpp
@@ -33,8 +33,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
//variables to be set by po
std::string args;
size_t total_num_samps;
- double rate, freq;
- float gain;
+ double rate, freq, gain;
std::string addr, port;
//setup the program options
@@ -45,7 +44,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
("nsamps", po::value<size_t>(&total_num_samps)->default_value(1000), "total number of samples to receive")
("rate", po::value<double>(&rate)->default_value(100e6/16), "rate of incoming samples")
("freq", po::value<double>(&freq)->default_value(0), "rf center frequency in Hz")
- ("gain", po::value<float>(&gain)->default_value(0), "gain for the RF chain")
+ ("gain", po::value<double>(&gain)->default_value(0), "gain for the RF chain")
("port", po::value<std::string>(&port)->default_value("7124"), "server udp port")
("addr", po::value<std::string>(&addr)->default_value("192.168.1.10"), "resolvable server address")
;
diff --git a/host/examples/tx_from_file.cpp b/host/examples/tx_from_file.cpp
index 40ce6db6b..392924c05 100644
--- a/host/examples/tx_from_file.cpp
+++ b/host/examples/tx_from_file.cpp
@@ -34,9 +34,8 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
time_t seconds_in_future;
size_t total_num_samps;
size_t samps_per_packet;
- double tx_rate, freq;
+ double tx_rate, freq, gain;
float ampl;
- float tx_gain;
//setup the program options
po::options_description desc("Allowed options");
@@ -48,7 +47,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
("txrate", po::value<double>(&tx_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>(&ampl)->default_value(float(0.3)), "amplitude of each sample")
- ("gain", po::value<float>(&tx_gain)->default_value(float(0)), "amplitude of each sample")
+ ("gain", po::value<double>(&gain)->default_value(0), "amplitude of each sample")
("dilv", "specify to disable inner-loop verbose")
;
po::variables_map vm;
@@ -78,7 +77,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
sdev->set_tx_freq(freq);
sdev->set_time_now(uhd::time_spec_t(0.0));
- sdev->set_tx_gain(tx_gain);
+ sdev->set_gain(gain);
//allocate data to send
std::vector<std::complex<short> > buff;
diff --git a/host/examples/tx_waveforms.cpp b/host/examples/tx_waveforms.cpp
index 751b79cf5..238a24b88 100644
--- a/host/examples/tx_waveforms.cpp
+++ b/host/examples/tx_waveforms.cpp
@@ -63,8 +63,8 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
//variables to be set by po
std::string args, wave_type;
size_t total_duration, spb;
- double rate, freq, wave_freq;
- float ampl, gain;
+ double rate, freq, gain, wave_freq;
+ float ampl;
//setup the program options
po::options_description desc("Allowed options");
@@ -76,7 +76,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){
("rate", po::value<double>(&rate)->default_value(1.5e6), "rate of outgoing samples")
("freq", po::value<double>(&freq)->default_value(0), "rf center frequency in Hz")
("ampl", po::value<float>(&ampl)->default_value(float(0.3)), "amplitude of the waveform")
- ("gain", po::value<float>(&gain)->default_value(float(0)), "gain for the RF chain")
+ ("gain", po::value<double>(&gain)->default_value(0), "gain for the RF chain")
("wave-type", po::value<std::string>(&wave_type)->default_value("CONST"), "waveform type (CONST, SQUARE, RAMP, SINE)")
("wave-freq", po::value<double>(&wave_freq)->default_value(0), "waveform frequency in Hz")
;