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

[Pkg-octave-devel] Bug#706640: octave-common: interpft fails when downsampling



Package: octave-common
Version: 3.6.2-5



Dear Maintainer,

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 squeeze. 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. I believe this bug is also
present in the version 3.6.4-1 in experimental since the file
interpft.m is the same in both versions AFAICT.

Best wishes,

Ubiratan Freitas.



Reply to: