bugGNU Octave - Bugs: bug #39017, interpft fails when downsampling...

 
 

bug #39017: interpft fails when downsampling and the old size is not a multiple of the new size

Submitter:  Sébastien Villemot <svillemot>
Submitted:  Sat 18 May 2013 05:31:55 PM UTC
   
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Segfault, Bus Error, etc.
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * 3.6.4 Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 26 Jul 2013 05:00:33 AM UTC, comment #1: 

Thanks, verified and applied this change to the development version:

http://hg.savannah.gnu.org/hgweb/octave/rev/3cbbdb49b8ff

Mike Miller <mtmiller>
Group Member
Sat 18 May 2013 05:31:55 PM UTC, original submission:  

(This is Debian bug http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=706640 )

The function "interpft" has a problem when used for downsampling a vector.
The following octave code triggers the problem:


octave:11> clear
octave:12> y=zeros(100000,1);
octave:13> yi = interpft(y,31000);
error: reshape: can't reshape 33334x1 array to 31000x1 array
error: called from:
error:   /usr/share/octave/3.6.2/m/general/interpft.m at line 86, column 7


The function works correctly in Octave 3.2.4. I believe the problem to be at the line 71 of this interpft.m:


  inc = max (1, fix (m/n));


This line replaced a while loop in the squeeze version but the new version gives a wrong result when downsampling. Replacing this line with


    inc = ceil (m/n);


solved the problem for the tests I ran.

Sébastien Villemot <svillemot>

 

(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

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by svillemot (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-07-26 mtmiller StatusNone Fixed
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code