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

*Subject*: Re: unwrap modulo 2pi*From*: Craig Markwardt <craigmnet(at)cow.physics.wisc.edu>*Date*: 07 Feb 2001 15:07:03 -0600*Newsgroups*: comp.lang.idl-pvwave*Organization*: U. Wisc. Madison Physics -- Compact Objects*References*: <95q313$53u$1@nnrp1.deja.com> <3A80F590.95C94E2A@acsys.it> <95rpna$h3v$1@nnrp1.deja.com> <3A817F92.1DBCDCCA@noaa.gov> <95s209$pe3$1@nnrp1.deja.com> <3A81B271.9B858DA4@noaa.gov>*Reply-To*: craigmnet(at)cow.physics.wisc.edu*Xref*: news.doit.wisc.edu comp.lang.idl-pvwave:23435

"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 --------------------------------------------------------------------------

**Follow-Ups**:**Re: unwrap modulo 2pi***From:*Pavel A. Romashkin

**References**:**unwrap modulo 2pi***From:*graham_wilson

**Re: unwrap modulo 2pi***From:*Nando Iavarone

**Re: unwrap modulo 2pi***From:*graham_wilson

**Re: unwrap modulo 2pi***From:*Pavel A. Romashkin

**Re: unwrap modulo 2pi***From:*graham_wilson

**Re: unwrap modulo 2pi***From:*Pavel A. Romashkin

- Prev by Date:
**Re: Hi, My Name is David. And I'm a Lurker** - Next by Date:
**IDL 5.4 and save files** - Prev by thread:
**Re: unwrap modulo 2pi** - Next by thread:
**Re: unwrap modulo 2pi** - Index(es):