diff options
Diffstat (limited to 'gnuradio-runtime/lib/math/gen_sine_table.py')
-rw-r--r--[-rwxr-xr-x] | gnuradio-runtime/lib/math/gen_sine_table.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gnuradio-runtime/lib/math/gen_sine_table.py b/gnuradio-runtime/lib/math/gen_sine_table.py index d7d11eff11..75e3a0c58f 100755..100644 --- a/gnuradio-runtime/lib/math/gen_sine_table.py +++ b/gnuradio-runtime/lib/math/gen_sine_table.py @@ -20,6 +20,8 @@ # Boston, MA 02110-1301, USA. # +from __future__ import division +from __future__ import unicode_literals import math import sys @@ -38,8 +40,8 @@ def gen_approx_table (f, nentries, min_x, max_x): for i in range (nentries): a = (i * incx) + min_x b = ((i + 1) * incx) + min_x - m = (f(b)-f(a))/(b-a) - c = (3*a+b)*(f(a)-f(b))/(4*(b-a)) + (f((a+b)/2) + f(a))/2 + m = (f(b)-f(a)) / (b-a) + c = (3*a+b)*(f(a)-f(b))/(4*(b-a)) + (f(old_div((a+b) / 2) + f(a)),2) abs_error = c+m*a-f(a) r.append ((m, c, abs_error)) return r |