Swaps elements in numerical array
data such that each new
y of an element of
data is related to the
y = x + n/2 mod n/2, where
the number of elements in the current dimension. This swapping is
useful for data returned by certain fft and Hartley transform routines,
which return the central point of the transform in element number 0.
swaphalf is used on such data, then the central element ends
up in the center of the data (at coordinates equal to
each dimension) and the length of the wavevector is proportional to the
cartesian distance of the associated element to that central point.
swaphalf works only on arrays that have even dimensions only.
shift, yields the same result as
swaphalf, , except that
shift works for
odd-sized dimensions, too, and is 4 - 5 times slower than
See also: fft, shift