diff options
author | jcorgan <jcorgan@221aa14e-8319-0410-a670-987f0aec2ac5> | 2007-05-28 17:04:09 +0000 |
---|---|---|
committer | jcorgan <jcorgan@221aa14e-8319-0410-a670-987f0aec2ac5> | 2007-05-28 17:04:09 +0000 |
commit | 9880e7bb383054aa43681b52ebd33c8fd4cb8fcb (patch) | |
tree | c9cd097baefda9ec392da2944fb799cbffabaa40 /gnuradio-core/src/python/gnuradio/gruimpl/freqz.py | |
parent | f29776e2c39c06c958e7b4dfeae8883b47305969 (diff) |
Merged r5547:5542 from jcorgan/num into trunk. Converts from using Python Numeric to numpy. Trunk passes distcheck. gr-radio-astronomy still needs conversion.
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@5553 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'gnuradio-core/src/python/gnuradio/gruimpl/freqz.py')
-rw-r--r-- | gnuradio-core/src/python/gnuradio/gruimpl/freqz.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/gnuradio-core/src/python/gnuradio/gruimpl/freqz.py b/gnuradio-core/src/python/gnuradio/gruimpl/freqz.py index 66023e7884..27d4f4d719 100644 --- a/gnuradio-core/src/python/gnuradio/gruimpl/freqz.py +++ b/gnuradio-core/src/python/gnuradio/gruimpl/freqz.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -# Copyright 2005 Free Software Foundation, Inc. +# Copyright 2005,2007 Free Software Foundation, Inc. # # This file is part of GNU Radio # @@ -54,9 +54,9 @@ __all__ = ['freqz'] -import Numeric -from Numeric import * -Num=Numeric +import numpy +from numpy import * +Num=numpy def atleast_1d(*arys): """ Force a sequence of arrays to each be at least 1D. @@ -74,7 +74,7 @@ def atleast_1d(*arys): for ary in arys: ary = asarray(ary) if len(ary.shape) == 0: - result = Numeric.array([ary[0]]) + result = numpy.array([ary[0]]) else: result = ary res.append(result) @@ -101,7 +101,7 @@ def polyval(p,x): y = 0 else: x = asarray(x) - y = Numeric.zeros(x.shape,x.typecode()) + y = numpy.zeros(x.shape,x.typecode()) for i in range(len(p)): y = x * y + p[i] return y @@ -135,7 +135,7 @@ class poly1d: raise ValueError, "Polynomial must be 1d only." c_or_r = trim_zeros(c_or_r, trim='f') if len(c_or_r) == 0: - c_or_r = Numeric.array([0]) + c_or_r = numpy.array([0]) self.__dict__['coeffs'] = c_or_r self.__dict__['order'] = len(c_or_r) - 1 @@ -281,8 +281,8 @@ class poly1d: if key < 0: raise ValueError, "Does not support negative powers." if key > self.order: - zr = Numeric.zeros(key-self.order,self.coeffs.typecode()) - self.__dict__['coeffs'] = Numeric.concatenate((zr,self.coeffs)) + zr = numpy.zeros(key-self.order,self.coeffs.typecode()) + self.__dict__['coeffs'] = numpy.concatenate((zr,self.coeffs)) self.__dict__['order'] = key ind = 0 self.__dict__['coeffs'][ind] = val |