bugGNU Octave - Bugs: bug #47279, Unwrap gives incorrect results for...

 
 

bug #47279: Unwrap gives incorrect results for deltas > 2*pi

Submitted by:  None
Submitted on:  Sat 27 Feb 2016 09:25:35 AM UTC  
 
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: FixedAssigned to: Mike Miller <mtmiller>
Originator Name: HarryOriginator Email: -unavailable-
Open/Closed: ClosedRelease: 4.0.0
Operating System: Microsoft Windows

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Tue 01 Mar 2016 09:30:13 PM UTC, comment #3:

Fixed on the default branch:

http://hg.savannah.gnu.org/hgweb/octave/rev/23e8130ed024

Mike Miller <mtmiller>
Project AdministratorIn charge of this item.
Tue 01 Mar 2016 07:37:30 PM UTC, comment #2:

I don't think it needs a complete rewrite. And the docstring does mention 2*pi. Actually the first example on the Matlab help page works for me. And a very minor change fixes this bug and the second example on the Matlab help page.

I'll commit the fix once I add some more tests for these types of cases.

Mike Miller <mtmiller>
Project AdministratorIn charge of this item.
Sun 28 Feb 2016 02:52:19 AM UTC, comment #1:

Confirmed. I think the unwrap function should be rewritten entirely. The corresponding Matlab function adds increments of +/- 2 pi which Octave does not even document. The examples listed in the Matlab documentation (http://www.mathworks.com/help/matlab/ref/unwrap.html) also fail in Octave.

Rik <rik5>
Project Administrator
Sat 27 Feb 2016 09:25:35 AM UTC, original submission:

Outputs should never contain jumps greater than TOL, as per definition:

============
-- Function File: B = unwrap (X, TOL, DIM)
Unwrap radian phases by adding multiples of 2*pi as appropriate to remove jumps greater than TOL. TOL defaults to pi.
============

However, this generally fails when deltas are greater than 2*pi. For example,

>> unwrap([0,7])

ans = 0 -5.56637061435917

The correct functionality would be:

>> unwrap([0,7])

ans = 0 0.716814692820414

Note: This is closely related to Bug #33883, which seems to have only been fixed in special cases.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by mtmiller (Posted a comment)
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by None (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 01 Mar 2016 09:30:13 PM UTCmtmillerStatusIn Progress=>Fixed
      Open/ClosedOpen=>Closed
    Tue 01 Mar 2016 07:37:30 PM UTCmtmillerStatusConfirmed=>In Progress
      Assigned toNone=>mtmiller
    Sun 28 Feb 2016 02:52:19 AM UTCrik5StatusNone=>Confirmed

    Back to the top


    Powered by Savane 3.1-cleanup1