Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
2023.0.0 - 日本語


ifftshift

fftshiftを反転する

呼び出し手順

y = ifftshift(x)
y = ifftshift(x, along)

引数

x, y

実数または複素数のベクトルまたは行列.

along

整数, 選択する次元, または文字列 'all'

説明

ifftshift(x) は,ベクトルxの 左半分と右半分を交換します.

行列の場合, ifftshift(x) は 最初の4分の1を3番目の4分の1,2番目の4分の1を4番目の4分の1と交換します.

x が多次元配列の場合, ifftshift(x) は各次元でxの "半分の空間"を交換します.

y= ifftshift(x,n)n番目の次元 のみについて配置換えを行ないます.

ifftshift() is designed in such a way that whatever is x with even or/and odd sizes, ifftshift(fftshift(x)) and fftshift(ifftshift(x)) are always equal to x.

Example #1:

When the size of a vector (or of a dimension>1) is even, fftshift() and ifftshift() are equivalent. It is no longer the case when a size is odd:

even = [1 2 3 4 5 6];
odd  = [1 2 3 4 5 6 7];
[fftshift(even) ; ifftshift(even)]
[fftshift(odd)  ; ifftshift(odd)]

// Both are always reciprocal:
ifftshift(fftshift(odd))
fftshift(ifftshift(odd))
--> even = [1 2 3 4 5 6];
--> odd  = [1 2 3 4 5 6 7];
--> [fftshift(even) ; ifftshift(even)]
 ans  =
   4.   5.   6.   1.   2.   3.
   4.   5.   6.   1.   2.   3.

--> [fftshift(odd)  ; ifftshift(odd)]
 ans  =
   5.   6.   7.   1.   2.   3.   4.
   4.   5.   6.   7.   1.   2.   3.

--> // Both are always reciprocal:
--> ifftshift(fftshift(odd))
 ans  =
   1.   2.   3.   4.   5.   6.   7.

--> fftshift(ifftshift(odd))
 ans  =
   1.   2.   3.   4.   5.   6.   7.

例 #2:

// 信号を生成
t = 0:0.1:1000;
x = 3*sin(t) + 8*sin(3*t) + 0.5*sin(5*t) + 3*rand(t);
// fftを計算
y = fft(x, -1);
// 結果を反転
shift = fftshift(y);
// 反転結果を反転
invShift = ifftshift(shift);
// 元の結果を再成したどうかを確認
and(y == invShift)

例 #3:

// 2次元画像を生成
t = 0:0.1:30;
x = 3*sin(t')*cos(2*t) + 8*sin(3*t')*sin(5*t) + ..
  0.5*sin(5*t')*sin(5*t) + 3*rand(t')*rand(t);
// fftを計算
y = fft(x,-1);

// 結果を反転
shift = fftshift(y);
// 反転結果を反転
invShift = ifftshift(shift);
// 元の結果を再成したどうかを確認
and(y == invShift)

参照

  • fftshift — fft出力を再配置し,スペクトルの中心に周波数0を移動する
  • fft — 高速フーリエ変換
  • flipdim — 指定した次元に沿って x ブロック要素を反転

履歴

バージョン記述
6.0.2 Option along added.
Report an issue
<< hilb Transforms bilt >>

Copyright (c) 2022-2023 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Tue Mar 07 09:28:47 CET 2023