[SciPy-dev] typo in signal.kaiserord()

iCy-fLaME icy.flame.gm at gmail.com
Tue Jan 24 16:24:44 EST 2006


kaiserord(ripple, width) in filter_design.py,

----------------------------------------------------------
beta = select([A>50, A>21],
              [0.1102*(A-8.7), 0.5842*(A-21)**(0.4) + 0.07866*(A-21)],
              0.0)
----------------------------------------------------------

=> 0.7866 should be 0.7886 instead

=====================================

Also in my system at lest it complain about pi, ceil and select are not defined.
        from scipy import select
        from scipy import ceil
        from scipy import pi
will fix that.

but then:
----------------------------------------------------------
>>> A = 20
>>> beta = select([A>50, A>21], [0.1102*(A-8.7), 0.5842*(A-21)**(0.4)
+ 0.07886*(A-21)], 0.0)

ValueError: negative number cannot be raised to a fractional power
----------------------------------------------------------

Looks like the else part is not performed correctly

I fixed it with:
----------------------------------------------------------
    if A> 50:
    	beta = 0.1102 * (A-8.7)
    elif A>= 21:
    	beta = (0.5842 * (A-21))**0.4 + 0.07886 * (A-21)
    else:
    	beta = 0
----------------------------------------------------------


iCy


More information about the SciPy-Dev mailing list