[SciPy-user] phase wrapping algorithm

Ryan Krauss ryanlists at gmail.com
Tue Oct 10 13:57:09 CDT 2006


For this simple problem, my FORTRAN version is running about 30 times
faster, but neither takes very long:

Python vector time=0.000700950622559
FORTRAN time=2.09808349609e-05
ratio=33.4090909091
Numpy.unwrap time=0.000639915466309
Numpy ratio=30.5

I will probably finish the FORTRAN version since it is almost done.

Ryan

On 10/10/06, Travis Oliphant <oliphant.travis at ieee.org> wrote:
> Ryan Krauss wrote:
> > Thanks Travis.
> >
> > I looked in scipy.signal and when I didn't see, I just assumed it didn't exist.
> >
> > I was just starting to make good progess on my FORTRAN version too.....
> >
> >
> The FORTRAN version would be faster and not require memory use.  The
> NumPy version creates the difference vector, finds discontinuites and
> forms a correction vector that is cumsummed and added to the original.
> > I may need to revisit this when I need more control over messy
> > experimental data.  Is there a tricky in-place way to calculate the
> >
> > difference between a vector and itself shift by 1 or more elements?
> >
>
> c[:-1] -= c[1:]  # shift-by-one
> c[:-2] -= c[2:]  # shift-by-two
>
> etc.
>
> This will leave un-changed the last elements of the array.
>
> -Travis
>
> _______________________________________________
> SciPy-user mailing list
> SciPy-user at scipy.org
> http://projects.scipy.org/mailman/listinfo/scipy-user
>


More information about the SciPy-user mailing list