From b94d4776cc2656b77262714f21e256caaff1617f Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Fri, 21 Jan 2011 10:38:27 -0800 Subject: uhd: use doubles as the theta when calculating the sine table --- host/examples/tx_waveforms.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'host/examples/tx_waveforms.cpp') 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){ -- cgit v1.2.3