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
363
363
fftshift (x) = circshift (x, div .([size (x)... ],2 ))
364
364
365
365
"""
366
- fftshift(x)
366
+ fftshift(x, [dim] )
367
367
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.
369
377
"""
370
- fftshift (x)
378
+ fftshift
371
379
372
380
function fftshift (x,dim)
373
381
s = zeros (Int,ndims (x))
@@ -377,19 +385,20 @@ function fftshift(x,dim)
377
385
circshift (x, s)
378
386
end
379
387
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
-
387
388
ifftshift (x) = circshift (x, div .([size (x)... ],- 2 ))
388
389
389
390
"""
390
391
ifftshift(x, [dim])
391
392
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.
393
402
"""
394
403
ifftshift
395
404
You can’t perform that action at this time.
0 commit comments