bugGNU Octave - Bugs: bug #33683, fftshift documentation and...

 
 

bug #33683: fftshift documentation and function behavior do not match

Submitted by:  None
Submitted on:  Thu 30 Jun 2011 08:56:26 PM UTC  
 
Category: InterpreterSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Installation Failure
Status: DuplicateAssigned to: None
Originator Name: A. David TrubatchOriginator Email: -unavailable-
Open/Closed: ClosedRelease: 3.4.0
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.

 

Wed 06 Jul 2011 02:47:08 PM UTC, comment #2:

Closed, duplicate of bug #32442

Jordi GutiƩrrez Hermoso <jordigh>
Project Administrator
Fri 01 Jul 2011 09:38:58 AM UTC, comment #1:

This bug has been fixed here:

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

Marco

Marco Caliari <caliari>
Project Member
Thu 30 Jun 2011 08:56:26 PM UTC, original submission:

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.

Anonymous

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by jordigh (Posted a comment)
  • -unavailable- added by caliari (Posted a comment)
  •  

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

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 06 Jul 2011 02:47:08 PM UTCjordighStatusNone=>Duplicate
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1