File tree Expand file tree Collapse file tree 1 file changed +20
-11
lines changed
Expand file tree Collapse file tree 1 file changed +20
-11
lines changed Original file line number Diff line number Diff line change @@ -363,11 +363,19 @@ plan_irfft
363363fftshift (x) = circshift (x, div .([size (x)... ],2 ))
364364
365365"""
366- fftshift(x)
366+ fftshift(x, [dim] )
367367
368- Swap the first and second halves of each dimension of `x`.
368+ Circular-shift along the given dimension of a periodic signal `x` centered at
369+ index `1` so it becomes centered at index `N÷2+1`, where `N` is the size of
370+ that dimension.
371+
372+ This can be undone with [`ifftshift`](@ref). For even `N` this is equivalent to
373+ swapping the first and second halves, so `fftshift` and [`ifftshift`](@ref) are
374+ the same.
375+
376+ If `dim` is not given then the signal is shifted along each dimension.
369377"""
370- fftshift (x)
378+ fftshift
371379
372380function fftshift (x,dim)
373381 s = zeros (Int,ndims (x))
@@ -377,19 +385,20 @@ function fftshift(x,dim)
377385 circshift (x, s)
378386end
379387
380- """
381- fftshift(x,dim)
382-
383- Swap the first and second halves of the given dimension or iterable of dimensions of array `x`.
384- """
385- fftshift (x,dim)
386-
387388ifftshift (x) = circshift (x, div .([size (x)... ],- 2 ))
388389
389390"""
390391 ifftshift(x, [dim])
391392
392- Undoes the effect of `fftshift`.
393+ Circular-shift along the given dimension of a periodic signal `x` centered at
394+ index `N÷2+1` so it becomes centered at index `1`, where `N` is the size of
395+ that dimension.
396+
397+ This undoes the effect of [`fftshift`](@ref). For even `N` this is equivalent to
398+ swapping the first and second halves, so [`fftshift`](@ref) and `ifftshift` are
399+ the same.
400+
401+ If `dim` is not given then the signal is shifted along each dimension.
393402"""
394403ifftshift
395404
You can’t perform that action at this time.
0 commit comments