fftshift {AIUQ}R Documentation

fftshift

Description

Rearranges a 2D Fourier transform x by shifting the zero-frequency component to the center of the matrix.

Usage

fftshift(x, dim = -1)

Arguments

x

square matrix input with odd number of rows and columns

dim

shift method. See 'Details'.

Details

By default, dim=-1, swaps the first quadrant of x with the third, and the second quadrant with the fourth. If dim=1, swaps rows 1 to middle with rows (middle+1) to end. If dim=2, swaps columns 1 to middle with columns (middle+1) to end. If dim=3, reverse fftshift.

Value

Shifted matrix.

Author(s)

Yue He [aut], Xubo Liu [aut], Mengyang Gu [aut, cre]

Examples

library(AIUQ)

(m <- matrix(0:8,3,3))
fftshift(m)


[Package AIUQ version 0.5.2 Index]