diff options
author | Josh Blum <josh@joshknows.com> | 2011-01-21 10:38:27 -0800 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2011-01-21 10:38:27 -0800 |
commit | b94d4776cc2656b77262714f21e256caaff1617f (patch) | |
tree | c70fb94dfedc9342c968d1f2c03a5ebdcfb86b14 | |
parent | c14bbffbebb817fc1c622785094268fe68164c60 (diff) | |
download | uhd-b94d4776cc2656b77262714f21e256caaff1617f.tar.gz uhd-b94d4776cc2656b77262714f21e256caaff1617f.tar.bz2 uhd-b94d4776cc2656b77262714f21e256caaff1617f.zip |
uhd: use doubles as the theta when calculating the sine table
-rw-r--r-- | host/examples/tx_waveforms.cpp | 4 |
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){ |