ifftshift

Shift frequency spectrum related vectors to uncenter the dc element to the first position.

Syntax

y = ifftshift(x)

y = ifftshift(x,dim)

Inputs

x
The frequency spectrum related vectors to shift.
Type: double | complex
Dimension: vector | matrix
dim
The dimension on which to operate.
(default: shift along every dimension.)
Type: integer
Dimension: scalar

Outputs

y
The shifted vectors.

Example

Show that ifftshift reverses the output of fftshift.

x = fftshift([1:8])
y = ifftshift(x)
x = [Matrix] 1 x 8
5  6  7  8  1  2  3  4
y = [Matrix] 1 x 8
1  2  3  4  5  6  7  8
If x(5) is the location of the dc frequency and x(1) is the location of the negative Nyquist frequency, then y(1) is the location of the dc frequency and y(5) is the location of Nyquist frequency.

Comments

After ifftshift, if a vector has an even number of samples the Nyquist frequency of the input will become centered in the output vector.