[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Unwrap a function

From: ldoolitt
Subject: Re: Unwrap a function
Date: Fri, 16 Oct 1998 08:59:45 -0400 (EDT)

Jim et al. -

> Bill Lash writes:
> > I don't have access to Matlab, so I don't know if it uses the same
> > calling conventions or not.  It should be pretty easy to modify.
> Excellent!  I didn't know about filter().
> I have only one suggestion: If the actual range of the data falls in
> the interval, say, (5.8, 2pi], then the amount to be added for a jump
> should be exactly 2pi.  Similar special arrangements might be made for
> wraps of pi or 1.

I just looked up Matlab's unwrap().  I have never used it, but
have used and programmed the same concept before.  The Matlab
function _only_ adds and subtracts multiples of 2*pi.  If someone
wanted to _supply_ some other "modulus", perhaps as an optional
third argument, that's fine.  I don't see any value to having the
program _guess_ a value for the modulus.

The Matlab routine's (optional) second argument is a cutoff, default
of pi.  Only jumps larger than cutoff trigger a change in the 
2*pi multiplier.

The first (required) argument is, of course, the input data array.
If given a matrix, the Matlab manual says it will operate on each
columns independently.

I have set up something similar that is intended to operate on
experimental data, and it is only useful if the data points are
"close enough" that the unwrap works accurately.  I had the routine
spit out a warning message if jumps were detected between pi/2 and
3*pi/2.  Jumps between 3*pi/2 and 2*pi are corrected silently.
Normally, the input data range is 0 to 2*pi (or -pi to pi), so
jumps never exceed 2*pi.

     - Larry Doolittle   <address@hidden>

reply via email to

[Prev in Thread] Current Thread [Next in Thread]