bugGNU Octave - Bugs: bug #33883, unwrap works correctly only if the...

 
 

bug #33883: unwrap works correctly only if the deltas <4*pi

Submitted by:  Benja Krieg <zhop>
Submitted on:  Fri 29 Jul 2011 11:39:03 AM UTC  
 
Category: LibrariesSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: FixedAssigned to: None
Originator Name: Open/Closed: Closed
Release: 3.4.2Operating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Sun 31 Jul 2011 10:45:24 PM UTC, comment #5:

Thanks, Andriy. I've pushed your second patch after testing it:

http://hg.savannah.gnu.org/hgweb/octave/rev/7cdf39348879

Closing this bug.

Jordi GutiƩrrez Hermoso <jordigh>
Project Administrator
Sun 31 Jul 2011 10:25:52 PM UTC, comment #4:

unwrap.m: Fix incorrect behavior when unwrapping gaps larger then 2*pi with tests for it (Bug #33883)

Fixed issue in test when for row matrice specifing dim=1, but should be dim=2.
Some fixes in formatting and 3d array test added.

(file #23723)

Andriy Shinkarchuck <andruxoid>
Sun 31 Jul 2011 06:43:06 PM UTC, comment #3:

Patch is ready!

unwrap.m: Fix incorrect behavior when unwrapping gaps larger then 2*pi with tests for it (Bug #33883)

I have modified unwrap.m in such way, that it multiplies kronecker deltas by smallest integer not less than integral part from dividing differencies between neighbour elements by rng, which equals 2*pi.

Thus incorrect behaviour in unwrapping only for 2pi after first unwrap() call, and by 2pi at every unwrap() call fixed.

Also i have modified comment to corrected line where p (peaks) calculated and added usual tests for checking of correct passing default parametres, tests for checking unwrap() for gaps larger then 2*pi and error test.

(file #23718)

Andriy Shinkarchuck <andruxoid>
Sat 30 Jul 2011 03:32:39 PM UTC, comment #2:

>> unwrap ([0, 7*pi])


ans =

0 3.1416

>> unwrap ([0, -7*pi])


ans =

0 -3.1416

>> unwrap ([0, 8*pi])


ans =

0 0

>> version


ans =

7.9.0.529 (R2009b)

>>


As expected.

Michael Godfrey <godfrey>
Project Member
Sat 30 Jul 2011 02:34:46 PM UTC, comment #1:

Confirmed on a recent development tip.

For compatibility, what is Matlab's response for

Rik <rik5>
Project Administrator
Fri 29 Jul 2011 11:39:03 AM UTC, original submission:

The function must be idempotent 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.
============

but:

octave:62> unwrap([0 6*pi])
ans =

0.00000 12.56637

octave:63> unwrap(unwrap([0 6*pi]))
ans =

0.00000 6.28319

octave:64> unwrap(unwrap(unwrap([0 6*pi])))
ans =

0 0

octave:65>

Benja Krieg <zhop>

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #23723:  my_fix.patch added by andruxoid (2KiB - text/x-diff)
file #23718:  my_fix.patch added by andruxoid (2KiB - text/x-diff - unwrap.m: Fix incorrect behavior when unwrapping gaps larger then 2*pi with tests for it (Bug #33883))

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by jordigh (Posted a comment)
  • -unavailable- added by andruxoid (Updated the item)
  • -unavailable- added by godfrey (Posted a comment)
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by zhop (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
    Sun 31 Jul 2011 10:45:24 PM UTCjordighStatusNeed Info=>Fixed
      Open/ClosedOpen=>Closed
    Sun 31 Jul 2011 10:25:52 PM UTCandruxoidAttached File-=>Added my_fix.patch, #23723
    Sun 31 Jul 2011 06:43:06 PM UTCandruxoidAttached File-=>Added my_fix.patch, #23718
    Sat 30 Jul 2011 02:34:46 PM UTCrik5StatusNone=>Need Info

    Back to the top


    Powered by Savane 3.1-cleanup1