[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #33683] fftshift documentation and function be
From: |
anonymous |
Subject: |
[Octave-bug-tracker] [bug #33683] fftshift documentation and function behavior do not match |
Date: |
Thu, 30 Jun 2011 20:56:26 +0000 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.15) Gecko/20110308 Gentoo Firefox/3.6.15 |
URL:
<http://savannah.gnu.org/bugs/?33683>
Summary: fftshift documentation and function behavior do not
match
Project: GNU Octave
Submitted by: None
Submitted on: Thu 30 Jun 2011 08:56:26 PM UTC
Category: Interpreter
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: Installation
Status: None
Assigned to: None
Originator Name: A. David Trubatch
Originator Email:
Open/Closed: Open
Discussion Lock: Any
Release: 3.4.0
Operating System: GNU/Linux
_______________________________________________________
Details:
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 address@hidden
mailing list.
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?33683>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Octave-bug-tracker] [bug #33683] fftshift documentation and function behavior do not match,
anonymous <=