summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan van der Walt <stefan@sun.ac.za>2009-03-06 09:09:45 +0000
committerStefan van der Walt <stefan@sun.ac.za>2009-03-06 09:09:45 +0000
commit173384a6fbe3a782f52ef30a8ffdc0a315a58880 (patch)
treea37d6777fa757e697f59a62d6eef4ed432d7c651
parent442d00d1fcf19915b49c47a6917e707381e1ae5b (diff)
downloadnumpy-173384a6fbe3a782f52ef30a8ffdc0a315a58880.tar.gz
For kaiser, allow beta to be specified as an integer.
-rw-r--r--numpy/lib/function_base.py2
-rw-r--r--numpy/lib/tests/test_function_base.py3
2 files changed, 4 insertions, 1 deletions
diff --git a/numpy/lib/function_base.py b/numpy/lib/function_base.py
index c6731a945..4eabba545 100644
--- a/numpy/lib/function_base.py
+++ b/numpy/lib/function_base.py
@@ -2562,7 +2562,7 @@ def kaiser(M,beta):
from numpy.dual import i0
n = arange(0,M)
alpha = (M-1)/2.0
- return i0(beta * sqrt(1-((n-alpha)/alpha)**2.0))/i0(beta)
+ return i0(beta * sqrt(1-((n-alpha)/alpha)**2.0))/i0(float(beta))
def sinc(x):
"""
diff --git a/numpy/lib/tests/test_function_base.py b/numpy/lib/tests/test_function_base.py
index 143e28ae5..daaa3e28e 100644
--- a/numpy/lib/tests/test_function_base.py
+++ b/numpy/lib/tests/test_function_base.py
@@ -813,6 +813,9 @@ class TestKaiser(TestCase):
array([ 0.58285404, 0.88409679, 1. ,
0.88409679, 0.58285404]))
+ def test_int_beta(self):
+ kaiser(3, 4)
+
class TestMsort(TestCase):
def test_simple(self):
A = array([[ 0.44567325, 0.79115165, 0.5490053 ],