octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #39017] interpft fails when downsampling and t


From: Sébastien Villemot
Subject: [Octave-bug-tracker] [bug #39017] interpft fails when downsampling and the old size is not a multiple of the new size
Date: Sat, 18 May 2013 17:31:56 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130515 Firefox/17.0 Iceweasel/17.0.6

URL:
  <http://savannah.gnu.org/bugs/?39017>

                 Summary: interpft fails when downsampling and the old size is
not a multiple of the new size
                 Project: GNU Octave
            Submitted by: svillemot
            Submitted on: Sat 18 May 2013 05:31:55 PM GMT
                Category: Octave Function
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Crash
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 3.6.4
        Operating System: GNU/Linux

    _______________________________________________________

Details:

(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.





    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?39017>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]