aboutsummaryrefslogtreecommitdiffstats
path: root/host/examples
diff options
context:
space:
mode:
Diffstat (limited to 'host/examples')
-rw-r--r--host/examples/replay_samples_from_file.cpp2
-rw-r--r--host/examples/wavetable.hpp15
2 files changed, 10 insertions, 7 deletions
diff --git a/host/examples/replay_samples_from_file.cpp b/host/examples/replay_samples_from_file.cpp
index 1c0de27ba..c0443adfa 100644
--- a/host/examples/replay_samples_from_file.cpp
+++ b/host/examples/replay_samples_from_file.cpp
@@ -1,5 +1,6 @@
//
// Copyright 2018 Ettus Research, A National Instruments Company
+// Copyright 2019 Ettus Research, A National Instruments Brand
//
// SPDX-License-Identifier: GPL-3.0-or-later
//
@@ -203,7 +204,6 @@ int UHD_SAFE_MAIN(int argc, char* argv[])
///////////////////////////////////////////////////////////////////////////
// Setup streamer to Replay block
- uint64_t noc_id;
uhd::device_addr_t streamer_args;
uhd::stream_args_t stream_args(cpu_format, wire_format);
uhd::tx_streamer::sptr tx_stream;
diff --git a/host/examples/wavetable.hpp b/host/examples/wavetable.hpp
index 2a1d13f48..73401220f 100644
--- a/host/examples/wavetable.hpp
+++ b/host/examples/wavetable.hpp
@@ -1,6 +1,7 @@
//
// Copyright 2010-2012,2014 Ettus Research LLC
// Copyright 2018 Ettus Research, a National Instruments Company
+// Copyright 2019 Ettus Research, A National Instruments Brand
//
// SPDX-License-Identifier: GPL-3.0-or-later
//
@@ -23,19 +24,21 @@ public:
std::vector<float> real_wave_table(wave_table_len);
if (wave_type == "CONST") {
for (size_t i = 0; i < wave_table_len; i++)
- real_wave_table[i] = 1.0;
+ real_wave_table[i] = 1.0f;
} else if (wave_type == "SQUARE") {
for (size_t i = 0; i < wave_table_len; i++)
- real_wave_table[i] = (i < wave_table_len / 2) ? 0.0 : 1.0;
+ real_wave_table[i] = (i < wave_table_len / 2) ? 0.0f : 1.0f;
} else if (wave_type == "RAMP") {
for (size_t i = 0; i < wave_table_len; i++)
- real_wave_table[i] = 2.0 * i / (wave_table_len - 1) - 1.0;
+ real_wave_table[i] = 2.0f * i / (wave_table_len - 1) - 1.0f;
} else if (wave_type == "SINE") {
static const double tau = 2 * std::acos(-1.0);
- for (size_t i = 0; i < wave_table_len; i++)
- real_wave_table[i] = std::sin((tau * i) / wave_table_len);
- } else
+ for (size_t i = 0; i < wave_table_len; i++) {
+ real_wave_table[i] = static_cast<float>(std::sin((tau * i) / wave_table_len));
+ }
+ } else {
throw std::runtime_error("unknown waveform type: " + wave_type);
+ }
// compute i and q pairs with 90% offset and scale to amplitude
for (size_t i = 0; i < wave_table_len; i++) {