aboutsummaryrefslogtreecommitdiffstats
path: root/host/examples
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2011-01-21 10:38:27 -0800
committerJosh Blum <josh@joshknows.com>2011-01-21 10:38:27 -0800
commitb94d4776cc2656b77262714f21e256caaff1617f (patch)
treec70fb94dfedc9342c968d1f2c03a5ebdcfb86b14 /host/examples
parentc14bbffbebb817fc1c622785094268fe68164c60 (diff)
downloaduhd-b94d4776cc2656b77262714f21e256caaff1617f.tar.gz
uhd-b94d4776cc2656b77262714f21e256caaff1617f.tar.bz2
uhd-b94d4776cc2656b77262714f21e256caaff1617f.zip
uhd: use doubles as the theta when calculating the sine table
Diffstat (limited to 'host/examples')
-rw-r--r--host/examples/tx_waveforms.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/host/examples/tx_waveforms.cpp b/host/examples/tx_waveforms.cpp
index 7cc1f5ae0..553d6739d 100644
--- a/host/examples/tx_waveforms.cpp
+++ b/host/examples/tx_waveforms.cpp
@@ -48,9 +48,9 @@ float gen_ramp(float x){
#define sine_table_len 2048
static float sine_table[sine_table_len];
UHD_STATIC_BLOCK(gen_sine_table){
- static const float m_pi = std::acos(float(-1));
+ static const double tau = 2*std::acos(-1.0);
for (size_t i = 0; i < sine_table_len; i++)
- sine_table[i] = std::sin((2*m_pi*i)/sine_table_len);
+ sine_table[i] = float(std::sin((tau*i)/sine_table_len));
}
float gen_sine(float x){