[Scipy-tickets] [SciPy] #346: error in firwin from filter_design trying calling builtin "sum" instead of "numpy.sum"

SciPy scipy-tickets at scipy.net
Fri Jan 12 11:23:49 CST 2007


#346: error in firwin from filter_design trying calling builtin "sum" instead of
"numpy.sum"
--------------------------+-------------------------------------------------
 Reporter:  lucaciti      |       Owner:  somebody                  
     Type:  defect        |      Status:  new                       
 Priority:  high          |   Milestone:                            
Component:  scipy.signal  |     Version:  0.5.2                     
 Severity:  major         |    Keywords:  filter design, firwin, sum
--------------------------+-------------------------------------------------
 In the function firwin in scipy.signal.filter_design (last line of the
 file) the filter coefficients are normalized:
 {{{
    return h / sum(h,axis=0)
 }}}
 This code tries to use the builtin function sum

 Type: builtin_function_or_method ... Docstring [source file open failed]:
 sum(sequence, start=0) -> value

 instead of numpy.sum

 Type: function ... File: /usr/lib/python2.4/site-
 packages/numpy/core/fromnumeric.py Definition:       numpy.sum(x,
 axis=None, dtype=None, out=None)

 Therefore that line should be changed to
 {{{
    return h / numpy.sum(h,axis=0)
 }}}

 Thanks,
 Luca

-- 
Ticket URL: <http://projects.scipy.org/scipy/scipy/ticket/346>
SciPy <http://www.scipy.org/>
SciPy is open-source software for mathematics, science, and engineering.


More information about the Scipy-tickets mailing list