[Numpy-discussion] Re: [SciPy-dev] accuracy problem in filterdesign.py

Travis Oliphant oliphant.travis at ieee.org
Sun Mar 24 16:49:03 EST 2002


On Sunday 24 March 2002 02:38 pm, you wrote:
> Hello,
>
> while writing a test driver for a minimum phase calculation routine I came
> across the following problem. It is causing asymmetriesin the output of
>

> >>> N=512
> >>> lastpoint=2*pi
> >>> w1=arange(0,lastpoint,lastpoint/N)
> >>> w2=arange(0,N)*(lastpoint/N)
> >>> lastpoint-w1[511]-w1[1]
>
> -6.3546390371982397e-014
>
> >>> lastpoint-w2[511]-w2[1]
>
> 4.0245584642661925e-016
>
> >>> w1[511]
>
> 6.2709134608765646
>
> >>> w2[511]
>
> 6.2709134608765007
>
> >>> w2[511]-w1[511]
>
> -6.3948846218409017e-014
>

I just fixed this in Numeric.

The arange in Numeric used to increment the value by the step amount.  It now 
computes the value using value = start + i*step  which fixes the problem.

Thanks for pointing this out.





More information about the NumPy-Discussion mailing list