comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: unwrap modulo 2pi
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: unwrap modulo 2pi [message #23634 is a reply to message #23629] Wed, 07 February 2001 13:07 Go to previous messageGo to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
"Pavel A. Romashkin" <pavel.romashkin@noaa.gov> writes:

> I just don't see that you can do this at all. Modulo operator discards
> information about the number of multiples of B from A, leaving only the
> remainder of the division operation. For example, if:
>
... deleted ...
>
> Unless I am missing something, I see no way how a unique solution can be
> obtained from the *remainder of division* and *divisor*. But I studied
> arithmetics a long time ago :-)

Pavel, and others--

He is looking for an algorithm that can *reconstruct* the full number.
Of course this will use local information from the surrounding points.

His example is perhaps a little too simple. Try this one:

ph = findgen(100)
ph1 = atan(sin(ph), cos(ph))

Now, PH and PH1 represent the same phase angle on the circle, but PH1
has the disadvantage of being a discontinuous sawtooth function.
Sometimes you want to reconstruct PH based only on knowledge of PH1.
Assuming that the function is nearly monotonic and there is never a
phase jump more than !dpi, I believe this can be done.

The naive solution (which I've never gotten beyond) is to look for
discontinuities in PH1 of (say) more than !dpi. When such a
discontinuity is found, assume we have wound around once, so add
another 2*!dpi to the number.

Craig

--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: IDL programmers wanted
Next Topic: Re: True Color, but !d.table_size eq 64?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 00:57:29 PDT 2025

Total time taken to generate the page: 0.08143 seconds