bugGNU Octave - Bugs: bug #42763, Change in behaviour of interp1...

 
 

bug #42763: Change in behaviour of interp1 function breaks signal processing functions such as fir1

Submitted by:  None
Submitted on:  Sun 13 Jul 2014 03:03:31 PM UTC  
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Regression
Status:  Fixed Assigned to:  None
Originator Name:  Robert Jackson Originator Email:  -email is unavailable-
Open/Closed:  Closed Release:  3.8.1
Operating System:  GNU/Linux

Add a New Comment (Rich Markup)
   

You are not logged in

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

 

Mon 14 Jul 2014 03:10:32 AM UTC, comment #4: 

This issue has been fixed on the stable branch.  It will be a part of the 3.8.2 bug fix release.  I would upgrade to 3.8.2 as soon as it comes out, or you can get the sources from Mercurial using the stable branch and build from scratch.

Rik <rik5>
Project Administrator
Sun 13 Jul 2014 05:44:24 PM UTC, comment #3: 

Yes, that is correct.  I've also checked fir1 gives the correct results with the latest development version of interp1.

When looking for the problem, I only searched backwards in the file history when I should have looked forwards too!  The commit fixing the regression was this one:

interp1.m: fix function for inputs w/multiple discontinuities (bug #41980).

http://hg.savannah.gnu.org/hgweb/octave/rev/5fe907167520

Thanks for your help
Robert

Anonymous
Sun 13 Jul 2014 05:18:51 PM UTC, comment #2: 

Using the developer's default branch

m = interp1([0;0.2;0.2;1], [1;1;0;0], [0.00000 0.19805 0.20000 0.20195 1.00000])
m =

   1   1   0   0   0

Is this the correct behavior?

Ben Abbott <bpabbott>
Project Member
Sun 13 Jul 2014 03:23:17 PM UTC, comment #1: 

I've found the commit which changed the behaviour of interp1:

interp1.m: Fix handling multi-column y-input with jumps (bug #40825).

http://hg.savannah.gnu.org/hgweb/octave/rev/b06675ef40f2

Author: Juan Pablo Carbajal <ajuanpi+dev@gmail.com>

Regards
Robert

Anonymous
Sun 13 Jul 2014 03:03:31 PM UTC, original submission:  

The fir1 function from the signal package generates incorrect results in Octave 3.8.1 compared to Octave 3.6.4 (and Matlab).  I've tracked the mismatch down to the interp1 function (which is built-in I believe).

Below is the output of my fir1 testcase.  Below that is the output of the interp1 function (which is called by fir2 - which is itself called from fir1).

GNU Octave, version 3.6.4

octave:1> fir1(32,0.2)'
ans =

  -8.7001e-04
   8.6629e-05
   1.6246e-03
   3.7088e-03
   5.3433e-03
   4.6062e-03
  -3.5509e-04
  -9.7044e-03
  -2.0575e-02
  -2.7019e-02
  -2.1744e-02
   7.7639e-04
   4.1127e-02
   9.3305e-02
   1.4568e-01
   1.8455e-01
   1.9891e-01
   1.8455e-01
   1.4568e-01
   9.3305e-02
   4.1127e-02
   7.7639e-04
  -2.1744e-02
  -2.7019e-02
  -2.0575e-02
  -9.7044e-03
  -3.5509e-04
   4.6062e-03
   5.3433e-03
   3.7088e-03
   1.6246e-03
   8.6629e-05
  -8.7001e-04

GNU Octave, version 3.8.1

octave:1> fir1(32,0.2)'
ans =

   3.4685e-04
   4.8446e-04
   6.5126e-04
   7.4865e-04
   6.3247e-04
   2.7611e-04
   1.0088e-06
   6.5234e-04
   3.5772e-03
   1.0320e-02
   2.2070e-02
   3.9039e-02
   6.0007e-02
   8.2297e-02
   1.0225e-01
   1.1611e-01
   1.2108e-01
   1.1611e-01
   1.0225e-01
   8.2297e-02
   6.0007e-02
   3.9039e-02
   2.2070e-02
   1.0320e-02
   3.5772e-03
   6.5234e-04
   1.0088e-06
   2.7611e-04
   6.3247e-04
   7.4865e-04
   6.5126e-04
   4.8446e-04
   3.4685e-04

GNU Octave, version 3.6.4

octave:1> m = interp1([0;0.2;0.2;1], [1;1;0;0], [0.00000 0.19805 0.20000 0.20195 1.00000])
m =

   1   1   0   0   0

GNU Octave, version 3.8.1

octave:1> m = interp1([0;0.2;0.2;1], [1;1;0;0], [0.00000 0.19805 0.20000 0.20195 1.00000])
m =

   1.00000   0.00975   0.00000   0.00000   0.00000

Note m(2) is completely different.

Please let me know if you require further information

Regards
Robert

Anonymous

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Digest:
   bug dependencies.

 

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

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

    Only project members can vote.

     

     

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2014-10-31 mtmiller Dependencies- => bugs #43506 is dependent
    2014-07-14 rik5 StatusNone => Fixed
        Open/ClosedOpen => Closed

    Back to the top


    Powered by Savane 3.5