Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 373985 - sci-mathematics/octave-3.4.0-r1 does not include an upstream bug fix for fftshift
Summary: sci-mathematics/octave-3.4.0-r1 does not include an upstream bug fix for ffts...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Science Mathematics related packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-04 04:46 UTC by trubatch
Modified: 2011-07-12 20:52 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description trubatch 2011-07-04 04:46:10 UTC
Bug report to octave (repeated below) was reported to have been fixed (http://savannah.gnu.org/bugs/?33683) however, buggy code remains in Gentoo ebuild.

Reply:


This bug has been fixed here:

http://hg.savannah.gnu.org/hgweb/octave/rev/189baf055143 



Bug report (to Octave):

fftshift requires a second argument that specifies the dimension along which the shift is to be made, even if the first argumwent is a one-dimensional array (i.e., vector). This behavior does not match the documentation (and is inconsistent with MATLAB) which indicates that fftshift may be called with a single argument.

Transcript:

octave:1> fftshift([1 2 3 4])
error: fftshift: A(I): index out of bounds; value 4 out of bound 1
error: called from:
error: /usr/share/octave/3.4.0/m/signal/fftshift.m at line 70, column 14
octave:1> fftshift([1 2 3 4],1)
ans =

1 2 3 4

octave:2> fftshift([1 2 3 4],2)
ans =

3 4 1 2

octave:3> fftshift([1 2 3 4]')
error: fftshift: A(I): index out of bounds; value 4 out of bound 1
error: called from:
error: /usr/share/octave/3.4.0/m/signal/fftshift.m at line 70, column 14
octave:3> fftshift([1 2 3 4]',1)
ans =

3
4
1
2

octave:4> fftshift([1 2 3 4]',2)
ans =

1
2
3
4

octave:5> help fftshift
`fftshift' is a function from the file /usr/share/octave/3.4.0/m/signal/fftshift.m

-- Function File: fftshift (X)
-- Function File: fftshift (X, DIM)
Perform a shift of the vector X, for use with the `fft' and `ifft'
functions, in order the move the frequency 0 to the center of the
vector or matrix.

If X is a vector of N elements corresponding to N time samples
spaced of Dt each, then `fftshift (fft (X))' corresponds to
frequencies

f = ((1:N) - ceil(N/2)) / N / Dt

If X is a matrix, the same holds for rows and columns. If X is an
array, then the same holds along each dimension.

The optional DIM argument can be used to limit the dimension along
which the permutation occurs.

Additional help for built-in functions and operators is
available in the on-line version of the manual. Use the command
`doc <topic>' to search the manual index.

Help and information about Octave is also available on the WWW
at http://www.octave.org and via the -unavailable-
mailing list.
Comment 1 Rafael Martins (RETIRED) gentoo-dev 2011-07-12 20:52:54 UTC
+*octave-3.4.0-r2 (12 Jul 2011)
+
+  12 Jul 2011; Rafael G. Martins <rafaelmartins@gentoo.org>
+  -octave-3.4.0-r1.ebuild, +octave-3.4.0-r2.ebuild,
+  +files/octave-3.4.0-fftshift.patch:
+  Revision bump. Fixes bug #373985. Thanks to trubatch@hotmail.com for
+  reporting.
+