diff options
Diffstat (limited to 'gnuradio-core/src/python/gnuradio/gruimpl')
-rw-r--r-- | gnuradio-core/src/python/gnuradio/gruimpl/freqz.py | 18 | ||||
-rwxr-xr-x | gnuradio-core/src/python/gnuradio/gruimpl/gnuplot_freqz.py | 6 |
2 files changed, 12 insertions, 12 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 diff --git a/gnuradio-core/src/python/gnuradio/gruimpl/gnuplot_freqz.py b/gnuradio-core/src/python/gnuradio/gruimpl/gnuplot_freqz.py index 45aa1faf80..ee94cbd0f6 100755 --- a/gnuradio-core/src/python/gnuradio/gruimpl/gnuplot_freqz.py +++ b/gnuradio-core/src/python/gnuradio/gruimpl/gnuplot_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 # @@ -25,7 +25,7 @@ __all__ = ['gnuplot_freqz'] import tempfile import os import math -import Numeric +import numpy from gnuradio import gr from gnuradio.gruimpl.freqz import freqz @@ -45,7 +45,7 @@ def gnuplot_freqz (hw, Fs=None, logfreq=False): cmd_file = os.popen ('gnuplot', 'w') h, w = hw - ampl = 20 * Numeric.log10 (Numeric.absolute (h) + 1e-9) + ampl = 20 * numpy.log10 (numpy.absolute (h) + 1e-9) phase = map (lambda x: math.atan2 (x.imag, x.real), h) if Fs: |