Every Fourier representation pairs one domain with another, and discreteness in one domain forces periodicity in the other. The DTFT of Chapter 7 maps a discrete-time sequence to a continuous, periodic function $X(e^{j\omega})$ — useful analytically, but a computer cannot store a continuum of frequencies. The Discrete Fourier Transform(離散傅立葉變換)closes the loop: both domains are discrete and finite, so it is the only member of the family a computer can evaluate exactly.每一種傅立葉表示法都把一個定義域配對到另一個定義域,而且某一個域是離散的,就會逼得另一個域是週期的。第 7 章的 DTFT 把離散時間序列映到一個連續而且週期的函數 $X(e^{j\omega})$——分析上很好用,但電腦沒辦法儲存一整個連續的頻率軸。離散傅立葉變換(DFT)把這個迴圈收了起來:兩個域都是離散而且有限的,所以它是這個家族裡唯一能被電腦精確計算的成員。フーリエ表現はいずれも一方の領域をもう一方の領域と対にするものであり、一方の領域が離散であれば、もう一方は必ず周期的になる。第 7 章の DTFT は離散時間系列を連続かつ周期的な関数 $X(e^{j\omega})$ へ写す。解析には便利だが、計算機は連続な周波数軸をそのまま保持できない。離散フーリエ変換(DFT)はこの環を閉じる。両方の領域が離散かつ有限なので、計算機が厳密に評価できる一族唯一の成員である。
| Transform | Time domain | Frequency domain |
|---|---|---|
| Fourier Series (FS) | continuous, periodic | discrete, aperiodic |
| Fourier Transform (FT) | continuous, aperiodic | continuous, aperiodic |
| DTFT | discrete, aperiodic | continuous, periodic ($2\pi$) |
| DFT | discrete, finite ($N$ points) | discrete, finite ($N$ points) |
| 變換 | 時域 | 頻域 |
|---|---|---|
| 傅立葉級數(FS) | 連續、週期 | 離散、非週期 |
| 傅立葉變換(FT) | 連續、非週期 | 連續、非週期 |
| DTFT | 離散、非週期 | 連續、週期($2\pi$) |
| DFT | 離散、有限($N$ 點) | 離散、有限($N$ 點) |
| 変換 | 時間領域 | 周波数領域 |
|---|---|---|
| フーリエ級数(FS) | 連続・周期 | 離散・非周期 |
| フーリエ変換(FT) | 連続・非周期 | 連続・非周期 |
| DTFT | 離散・非周期 | 連続・周期($2\pi$) |
| DFT | 離散・有限($N$ 点) | 離散・有限($N$ 点) |
The DTFT $X(e^{j\omega})=\sum_n x[n]e^{-j\omega n}$ requires (i) an infinite sum and (ii) a continuous variable $\omega$. The DFT fixes both problems at once: it takes only $N$ samples of the signal and evaluates the spectrum at only $N$ frequencies $\omega_k = 2\pi k/N$. Everything in this chapter follows from understanding exactly what is gained and what is lost in that step.DTFT $X(e^{j\omega})=\sum_n x[n]e^{-j\omega n}$ 需要 (i) 一個無窮級數,以及 (ii) 一個連續變數 $\omega$。DFT 一口氣解決了這兩個問題:它只取訊號的 $N$ 個樣本,並且只在 $N$ 個頻率 $\omega_k = 2\pi k/N$ 上計算頻譜。本章接下來的一切,都來自於弄清楚這一步究竟得到了什麼、又失去了什麼。DTFT $X(e^{j\omega})=\sum_n x[n]e^{-j\omega n}$ には (i) 無限和と (ii) 連続変数 $\omega$ が必要である。DFT はこの二つの問題を一挙に解決する。信号の標本を $N$ 個だけ取り、スペクトルを $N$ 個の周波数 $\omega_k = 2\pi k/N$ でのみ評価するのである。本章の内容はすべて、この一歩で何が得られ何が失われるのかを正確に理解することから導かれる。
Let $\tilde{x}[n]$ be periodic(週期性序列)with period $N$: $\tilde{x}[n] = \tilde{x}[n+N]$ for all $n$. Such a sequence is fully described by one period, and it can be expanded on the $N$ harmonically related complex exponentials $e^{j2\pi kn/N}$, $k = 0,\dots,N-1$. This is the Discrete Fourier Series(離散傅立葉級數, DFS):設 $\tilde{x}[n]$ 是週期為 $N$ 的週期序列:對所有 $n$ 都有 $\tilde{x}[n] = \tilde{x}[n+N]$。這樣的序列只要一個週期就能完整描述,而且可以用 $N$ 個成諧波關係的複指數 $e^{j2\pi kn/N}$($k = 0,\dots,N-1$)展開。這就是離散傅立葉級數(DFS):$\tilde{x}[n]$ を周期 $N$ の周期系列とする。すなわち、すべての $n$ について $\tilde{x}[n] = \tilde{x}[n+N]$ が成り立つ。このような系列は一周期だけで完全に記述でき、調和関係にある $N$ 個の複素指数 $e^{j2\pi kn/N}$($k = 0,\dots,N-1$)で展開できる。これが離散フーリエ級数(DFS)である:
Both $\tilde{x}[n]$ and $\tilde{X}[k]$ are periodic with period $N$. The DFT defined next is numerically identical to one period of the DFS — the only difference is interpretation: the DFT treats $x[n]$ as a finite-length sequence on $0 \le n \le N-1$, while the DFS treats it as one period of an infinitely repeating signal.$\tilde{x}[n]$ 與 $\tilde{X}[k]$ 都是週期為 $N$ 的。接下來要定義的 DFT,在數值上完全等同於 DFS 的一個週期——唯一的差別在於詮釋:DFT 把 $x[n]$ 看成定義在 $0 \le n \le N-1$ 上的有限長度序列,而 DFS 把它看成一個無限重複訊號的其中一個週期。$\tilde{x}[n]$ も $\tilde{X}[k]$ も周期 $N$ の周期系列である。次に定義する DFT は、DFS の一周期と数値的に完全に一致する。違いは解釈だけである。DFT は $x[n]$ を $0 \le n \le N-1$ 上の有限長系列とみなすのに対し、DFS はそれを無限に繰り返す信号の一周期とみなす。
The DFT inherits the periodic worldview of the DFS. Whenever a DFT property involves a time shift, a reversal, or a convolution, the operation is performed modulo $N$ — as if the $N$ samples lived on a circle, not a line. This single fact explains circular shift, circular convolution, and time aliasing.DFT 繼承了 DFS 那套「週期性」的世界觀。只要某個 DFT 性質牽涉到時間位移、反轉或摺積,該運算就是對 $N$ 取模進行的——就好像那 $N$ 個樣本住在一個圓上,而不是一條線上。光是這一件事,就解釋了圓周位移、圓周摺積與時域混疊的由來。DFT は DFS の周期的な世界観をそのまま受け継ぐ。DFT の性質が時間シフト・反転・畳み込みを含むときは、その演算は必ず$N$ を法として行われる。$N$ 個の標本が直線ではなく円の上に並んでいるかのように振る舞うのである。この一点だけで、円状シフト・円状畳み込み・時間領域エイリアシングのすべてが説明できる。
Take a finite-length sequence $x[n]$, $0 \le n \le L-1$, with DTFT $X(e^{j\omega})$. Evaluate (sample) the DTFT at $N$ equally spaced frequencies $\omega_k = 2\pi k/N$:取一個有限長度序列 $x[n]$($0 \le n \le L-1$),其 DTFT 為 $X(e^{j\omega})$。在 $N$ 個等間隔的頻率 $\omega_k = 2\pi k/N$ 上對這個 DTFT 求值(取樣):有限長系列 $x[n]$($0 \le n \le L-1$)をとり、その DTFT を $X(e^{j\omega})$ とする。この DTFT を等間隔な $N$ 個の周波数 $\omega_k = 2\pi k/N$ で評価する(標本化する):
Sampling in frequency causes periodization in time — the exact dual of Chapter 4, where sampling in time periodized the spectrum. Inverting the $N$ frequency samples returns not $x[n]$ itself but its periodic superposition:在頻域取樣會造成時域的週期化——這正好是第 4 章的對偶:在時域取樣會使頻譜週期化。把這 $N$ 個頻率樣本反變換回去,得到的並不是 $x[n]$ 本身,而是它的週期性疊加:周波数領域で標本化すると時間領域が周期化される。これは第 4 章の厳密な双対である。あちらでは時間領域の標本化がスペクトルを周期化した。$N$ 個の周波数標本を逆変換して得られるのは $x[n]$ そのものではなく、その周期的重ね合わせである:
You may sample a DTFT as coarsely as you like and still get a valid set of numbers — but you can only get the original sequence back if you took at least as many frequency samples as the sequence length ($N \ge L$). Sampling the DTFT of an infinite-length sequence (e.g. $a^n u[n]$) always produces time aliasing; see Exercise 4.你想把 DTFT 取樣得多稀疏都可以,總是會得到一組合法的數值——但只有在頻率樣本數至少等於序列長度($N \ge L$)時,才能把原序列救回來。對無限長度序列(例如 $a^n u[n]$)的 DTFT 取樣,一定會產生時域混疊;見習題 4。DTFT はどれだけ粗く標本化しても構わず、得られる数値の組はつねに正当である。しかし元の系列を取り戻せるのは、周波数標本数が系列長以上($N \ge L$)の場合だけである。無限長系列(たとえば $a^n u[n]$)の DTFT を標本化すれば、かならず時間領域エイリアシングが生じる。演習 4 を参照。
Define the twiddle factor(旋轉因子)$W_N$, the principal $N$-th root of unity:定義旋轉因子 $W_N$,也就是 $N$ 次單位根的主值:回転因子 $W_N$、すなわち $N$ 乗根の主値を次のように定義する:
Useful identities, used constantly in derivations and in the FFT of the next chapter:以下幾個恆等式在推導中以及下一章的 FFT 裡會不斷用到:以下の恒等式は、諸々の導出でも次章の FFT でも絶えず用いられる:
Notation: we write $x[n] \;\overset{\text{DFT}}{\longleftrightarrow}\; X[k]$, and $((n))_N$ means $n$ modulo $N$($n$ 對 $N$ 取餘數).記號:我們寫成 $x[n] \;\overset{\text{DFT}}{\longleftrightarrow}\; X[k]$,而 $((n))_N$ 表示 $n$ 對 $N$ 取餘數。記法:$x[n] \;\overset{\text{DFT}}{\longleftrightarrow}\; X[k]$ と書き、$((n))_N$ は $n$ を $N$ で割った余り($n$ を $N$ で割った剰余)を表す。
Proof that IDFT inverts the DFT. Substitute the DFT into the IDFT and swap sums:證明 IDFT 確實是 DFT 的反變換。把 DFT 代入 IDFT 並交換求和次序:IDFT が DFT の逆変換であることの証明。DFT を IDFT に代入し、和の順序を交換する:
$$\frac{1}{N}\sum_{k=0}^{N-1}\left(\sum_{l=0}^{N-1} x[l] W_N^{kl}\right) W_N^{-kn} = \sum_{l=0}^{N-1} x[l] \underbrace{\frac{1}{N}\sum_{k=0}^{N-1} W_N^{k(l-n)}}_{=\;\delta[((l-n))_N]} = x[n].$$The inner sum is the orthogonality identity above — it acts as a Kronecker delta and sifts out exactly the term $l=n$.內層的總和就是上面那個正交性恆等式——它的作用像一個 Kronecker delta,只篩出 $l=n$ 那一項。内側の和は上の直交性の恒等式そのものである。これは Kronecker のデルタとして働き、$l=n$ の項だけをふるい出す。
The four lines above are compressed. Here is the same argument with every symbol named before it is used.上面那四行壓得很緊。以下是同一個論證,但每個符號都先定義再使用。上の四行は圧縮されている。以下は同じ論証を、使う前にすべての記号を定義しながら述べたものである。
| Symbol | Meaning |
|---|---|
| $N$ | DFT length: the number of samples, and also the number of frequency bins |
| $x[\cdot]$ | The time-domain signal, defined for indices $0, 1, \dots, N-1$ |
| $X[k]$ | The DFT output: the strength of frequency bin $k$ |
| $k$ | Frequency index, $0 \le k \le N-1$; bin $k$ is the frequency $\omega_k = 2\pi k/N$ |
| $n$ | Time index of the sample we want to recover, fixed on the left-hand side |
| $l$ | Time index inside the DFT sum — a dummy variable, renamed so it cannot clash with $n$ |
| $W_N$ | Twiddle factor $W_N = e^{-j2\pi/N}$: a unit vector rotated $1/N$ of a turn clockwise |
| $W_N^{a}$ | $e^{-j2\pi a/N}$: rotation by $a$ steps of $1/N$ turn; a negative $a$ rotates counterclockwise |
| $m$ | Shorthand for $l-n$, the gap between the two time indices |
| $\delta[m]$ | Unit impulse: $\delta[0]=1$ and $\delta[m]=0$ for $m \ne 0$ |
| 符號 | 意義 |
|---|---|
| $N$ | DFT 長度:樣本的個數,同時也是頻率格的個數 |
| $x[\cdot]$ | 時域訊號,定義在索引 $0, 1, \dots, N-1$ 上 |
| $X[k]$ | DFT 的輸出:第 $k$ 個頻率格的強度 |
| $k$ | 頻率索引,$0 \le k \le N-1$;第 $k$ 格對應頻率 $\omega_k = 2\pi k/N$ |
| $n$ | 我們想還原的那個樣本的時間索引,在等號左邊是固定的 |
| $l$ | DFT 和式內部的時間索引——一個啞變數,改名是為了不跟 $n$ 撞在一起 |
| $W_N$ | 旋轉因子 $W_N = e^{-j2\pi/N}$:順時針轉了一圈的 $1/N$ 的單位向量 |
| $W_N^{a}$ | $e^{-j2\pi a/N}$:轉 $a$ 個「$1/N$ 圈」的步伐;$a$ 為負就逆時針轉 |
| $m$ | $l-n$ 的簡寫,也就是兩個時間索引之間的差 |
| $\delta[m]$ | 單位脈衝:$\delta[0]=1$,而 $m \ne 0$ 時 $\delta[m]=0$ |
| 記号 | 意味 |
|---|---|
| $N$ | DFT 長:標本の個数であり、同時に周波数ビンの個数でもある |
| $x[\cdot]$ | 時間領域の信号。索引 $0, 1, \dots, N-1$ 上で定義される |
| $X[k]$ | DFT の出力:周波数ビン $k$ の強さ |
| $k$ | 周波数索引($0 \le k \le N-1$)。ビン $k$ は周波数 $\omega_k = 2\pi k/N$ に対応する |
| $n$ | 復元したい標本の時間索引。左辺では固定されている |
| $l$ | DFT の和の内部にある時間索引 — ダミー変数であり、$n$ と衝突しないように改名してある |
| $W_N$ | 回転因子 $W_N = e^{-j2\pi/N}$:単位ベクトルを一周の $1/N$ だけ時計回りに回したもの |
| $W_N^{a}$ | $e^{-j2\pi a/N}$:一周の $1/N$ という歩幅で $a$ 歩回転する。$a$ が負なら反時計回りに回る |
| $m$ | $l-n$ の略記。二つの時間索引の差である |
| $\delta[m]$ | 単位インパルス:$\delta[0]=1$ であり、$m \ne 0$ では $\delta[m]=0$ |
Two of the $W_N$ identities from §8.2.1 do all the work: exponents add, $W_N^{a}W_N^{b} = W_N^{a+b}$, and period $N$, $W_N^{N} = e^{-j2\pi} = 1$, hence $W_N^{a+N} = W_N^{a}$. (The orthogonality identity listed there is the same sum we are about to evaluate, with the roles of the time and frequency indices exchanged.)真正出力的只有 §8.2.1 那幾條 $W_N$ 恆等式中的兩條:指數相加,$W_N^{a}W_N^{b} = W_N^{a+b}$;以及週期為 $N$,$W_N^{N} = e^{-j2\pi} = 1$,因此 $W_N^{a+N} = W_N^{a}$。(那裡列出的正交性恆等式,其實就是我們接下來要算的這個和,只是時間索引與頻率索引的角色對調。)実際に効いているのは §8.2.1 の $W_N$ 恒等式のうち二つだけである。指数は加わること、$W_N^{a}W_N^{b} = W_N^{a+b}$、そして周期は $N$ であること、$W_N^{N} = e^{-j2\pi} = 1$、したがって $W_N^{a+N} = W_N^{a}$。(そこに挙げた直交性の恒等式は、これから評価する和そのものであり、時間索引と周波数索引の役割が入れ替わっているだけである。)
Step 1 — substitute the DFT into the IDFT步驟 1 — 把 DFT 代進 IDFTステップ 1 — DFT を IDFT に代入する
Write the DFT with $l$ as its time index, $X[k] = \sum_{l=0}^{N-1} x[l]\,W_N^{kl}$, and drop it into the IDFT:把 DFT 用 $l$ 當時間索引寫成 $X[k] = \sum_{l=0}^{N-1} x[l]\,W_N^{kl}$,再代入 IDFT:DFT の時間索引を $l$ として $X[k] = \sum_{l=0}^{N-1} x[l]\,W_N^{kl}$ と書き、これを IDFT に放り込む:
$$\frac{1}{N}\sum_{k=0}^{N-1}\Big(\sum_{l=0}^{N-1} x[l]\,W_N^{kl}\Big) W_N^{-kn}$$This is why the inner index is renamed: if it were also called $n$, it would collide with the fixed $n$ we are trying to recover.這就是內層索引要改名的原因:如果它也叫 $n$,就會跟我們想還原的那個固定的 $n$ 撞在一起。内側の索引を改名するのはこのためである。もしそれも $n$ と呼べば、復元しようとしている固定された $n$ と衝突してしまう。
Step 2 — swap the sums, combine the exponents步驟 2 — 交換求和次序,合併指數ステップ 2 — 和の順序を交換し、指数をまとめる
Both sums are finite, so the order can be exchanged freely. Once swapped, $x[l]$ does not depend on $k$ and moves outside the $k$-sum, and the two twiddle factors merge by "exponents add": $W_N^{kl}\,W_N^{-kn} = W_N^{k(l-n)}$.兩個和都是有限項,所以次序可以隨意交換。交換之後 $x[l]$ 不依賴 $k$,可以移到 $k$ 的和之外;而兩個旋轉因子依「指數相加」合而為一:$W_N^{kl}\,W_N^{-kn} = W_N^{k(l-n)}$。どちらの和も有限項なので、順序は自由に交換できる。交換すると $x[l]$ は $k$ に依存しないので $k$ の和の外に出せる。そして二つの回転因子は「指数は加わる」により一つにまとまる:$W_N^{kl}\,W_N^{-kn} = W_N^{k(l-n)}$。
$$\frac{1}{N}\sum_{l=0}^{N-1} x[l]\;\underbrace{\sum_{k=0}^{N-1} W_N^{k(l-n)}}_{\textstyle S(l-n)}$$Step 3 — evaluate the inner sum $S(m)$步驟 3 — 計算內層的和 $S(m)$ステップ 3 — 内側の和 $S(m)$ を評価する
Write $m = l-n$. The inner sum is $N$ unit vectors, each rotated $m$ steps further than the one before it:令 $m = l-n$。內層的和是 $N$ 個單位向量,每一個都比前一個多轉 $m$ 步:$m = l-n$ と置く。内側の和は $N$ 個の単位ベクトルであり、各々が一つ前より $m$ 歩だけ余分に回っている:
$$S(m) = \sum_{k=0}^{N-1} W_N^{km} = W_N^{0} + W_N^{m} + W_N^{2m} + \dots + W_N^{(N-1)m}$$If $m=0$ (that is, $l=n$): every term is $W_N^{0}=1$, so $S(0) = N$.若 $m=0$(也就是 $l=n$):每一項都是 $W_N^{0}=1$,所以 $S(0) = N$。$m=0$ のとき(すなわち $l=n$):すべての項が $W_N^{0}=1$ なので、$S(0) = N$ である。
If $m \ne 0$ (that is, $l \ne n$): geometrically, the vectors are spread evenly around the unit circle, and every direction is balanced by an opposite one, so the vector sum is zero. Algebraically, $S(m)$ is a geometric series with ratio $r = W_N^{m}$, and $\sum_{k=0}^{N-1} r^{k} = \frac{1-r^{N}}{1-r}$ gives若 $m \ne 0$(也就是 $l \ne n$):從幾何上看,這些向量均勻散佈在單位圓上,每個方向都有相反方向與之抵銷,所以向量和為零。從代數上看,$S(m)$ 是公比 $r = W_N^{m}$ 的等比級數,由 $\sum_{k=0}^{N-1} r^{k} = \frac{1-r^{N}}{1-r}$ 得$m \ne 0$ のとき(すなわち $l \ne n$):幾何的には、これらのベクトルは単位円上に等間隔に散らばっており、どの向きにも必ず反対向きの相手がいて打ち消し合うので、ベクトル和はゼロになる。代数的には、$S(m)$ は公比 $r = W_N^{m}$ の等比級数であり、$\sum_{k=0}^{N-1} r^{k} = \frac{1-r^{N}}{1-r}$ から次が得られる
$$S(m) = \frac{1 - W_N^{mN}}{1 - W_N^{m}}, \qquad W_N^{mN} = \big(W_N^{N}\big)^{m} = 1^{m} = 1 \;\Longrightarrow\; \text{numerator} = 0.$$The denominator is safe: since $l$ and $n$ both live in $0,\dots,N-1$, the gap satisfies $-(N-1) \le m \le N-1$, and a nonzero $m$ in that range is never a multiple of $N$ — so $W_N^{m} \ne 1$. Hence $S(m)=0$, and both cases together read分母不會出事:因為 $l$ 與 $n$ 都落在 $0,\dots,N-1$ 之內,兩者的差滿足 $-(N-1) \le m \le N-1$,而這個範圍裡非零的 $m$ 絕不會是 $N$ 的倍數——所以 $W_N^{m} \ne 1$。因此 $S(m)=0$。兩種情況合起來就是分母は安全である。$l$ も $n$ も $0,\dots,N-1$ の中にあるので、その差は $-(N-1) \le m \le N-1$ を満たし、この範囲でゼロでない $m$ が $N$ の倍数になることはない。したがって $W_N^{m} \ne 1$ である。ゆえに $S(m)=0$ となり、二つの場合を合わせると
Step 4 — only $l=n$ survives步驟 4 — 只有 $l=n$ 活下來ステップ 4 — 生き残るのは $l=n$ だけ
Put that back into Step 2. Every term with $l \ne n$ is multiplied by zero and disappears; only $l=n$ is left:把結果放回步驟 2。所有 $l \ne n$ 的項都被乘上零而消失,只剩下 $l=n$:これをステップ 2 に戻す。$l \ne n$ の項はすべてゼロを掛けられて消え、$l=n$ だけが残る:
$$\frac{1}{N}\sum_{l=0}^{N-1} x[l]\cdot N\,\delta[l-n] \;=\; \frac{1}{N}\cdot x[n]\cdot N \;=\; x[n] \quad\checkmark$$So the $1/N$ in front of the IDFT exists for exactly one reason: to cancel the $N$ that the inner sum produces.所以 IDFT 前面那個 $1/N$ 存在的理由只有一個:抵銷內層的和所產生的那個 $N$。つまり IDFT の前にある $1/N$ が存在する理由はただ一つ、内側の和が生み出す $N$ を打ち消すためである。
Step 3 leaned on $-(N-1) \le l-n \le N-1$, which holds only while $n$ stays inside $0,\dots,N-1$. Evaluate the IDFT expression at an $n$ outside that range and it still returns a number — but that number is $x[((n))_N]$, the periodic repetition of the signal, not a new sample. The DFT simply has nothing to say about $x[n]$ beyond one period.步驟 3 用到了 $-(N-1) \le l-n \le N-1$,而這只在 $n$ 留在 $0,\dots,N-1$ 之內時才成立。把 IDFT 的式子拿到這個範圍外的 $n$ 上求值,它仍然會給出一個數——但那個數是 $x[((n))_N]$,也就是訊號的週期延拓,而不是什麼新的樣本。DFT 對一個週期以外的 $x[n]$ 根本無話可說。ステップ 3 は $-(N-1) \le l-n \le N-1$ に依拠していたが、これは $n$ が $0,\dots,N-1$ の中にとどまる限りでしか成り立たない。この範囲の外の $n$ で IDFT の式を評価しても、やはり何らかの数は返ってくる。しかしその数は $x[((n))_N]$、すなわち信号の周期的繰り返しであって、新しい標本ではない。DFT は一周期の外の $x[n]$ について何も語らないのである。
$W_4 = e^{-j2\pi/4} = e^{-j\pi/2} = -j$, so the powers of $W_4$ cycle through $1, -j, -1, j$.$W_4 = e^{-j2\pi/4} = e^{-j\pi/2} = -j$,所以 $W_4$ 的次方循環走過 $1, -j, -1, j$。$W_4 = e^{-j2\pi/4} = e^{-j\pi/2} = -j$ なので、$W_4$ のべき乗は $1, -j, -1, j$ を巡回する。
| $m = l-n$ | $W_4^{0}$ | $W_4^{m}$ | $W_4^{2m}$ | $W_4^{3m}$ | $S(m)$ |
|---|---|---|---|---|---|
| $0$ | $1$ | $1$ | $1$ | $1$ | $4$ |
| $1$ | $1$ | $-j$ | $-1$ | $j$ | $0$ |
| $2$ | $1$ | $-1$ | $1$ | $-1$ | $0$ |
| $3$ | $1$ | $j$ | $-1$ | $-j$ | $0$ |
| $m = l-n$ | $W_4^{0}$ | $W_4^{m}$ | $W_4^{2m}$ | $W_4^{3m}$ | $S(m)$ |
|---|---|---|---|---|---|
| $0$ | $1$ | $1$ | $1$ | $1$ | $4$ |
| $1$ | $1$ | $-j$ | $-1$ | $j$ | $0$ |
| $2$ | $1$ | $-1$ | $1$ | $-1$ | $0$ |
| $3$ | $1$ | $j$ | $-1$ | $-j$ | $0$ |
| $m = l-n$ | $W_4^{0}$ | $W_4^{m}$ | $W_4^{2m}$ | $W_4^{3m}$ | $S(m)$ |
|---|---|---|---|---|---|
| $0$ | $1$ | $1$ | $1$ | $1$ | $4$ |
| $1$ | $1$ | $-j$ | $-1$ | $j$ | $0$ |
| $2$ | $1$ | $-1$ | $1$ | $-1$ | $0$ |
| $3$ | $1$ | $j$ | $-1$ | $-j$ | $0$ |
Only $m=0$ gives a nonzero sum, and that sum is exactly $N=4$.只有 $m=0$ 的那一列總和不為零,而且那個總和剛好就是 $N=4$。和がゼロでないのは $m=0$ の行だけであり、その和はちょうど $N=4$ である。
For different $n$, the vectors $\{W_N^{-kn}\}_{k=0}^{N-1}$ are orthogonal(正交): the inner sum is their inner product, which equals $N$ for matching indices and $0$ otherwise. That orthogonality is the whole reason the IDFT can pull each $x[n]$ back out of the mixture.對不同的 $n$ 而言,向量組 $\{W_N^{-kn}\}_{k=0}^{N-1}$ 彼此正交:內層的和就是它們的內積,索引相同時為 $N$,否則為 $0$。正是這個正交性,讓 IDFT 能夠把每一個 $x[n]$ 從混合物裡重新拉出來。異なる $n$ に対して、ベクトル列 $\{W_N^{-kn}\}_{k=0}^{N-1}$ は互いに直交する。内側の和はそれらの内積であり、索引が一致すれば $N$、そうでなければ $0$ になる。この直交性こそが、IDFT が混ざり合いの中から各 $x[n]$ を取り出せる理由のすべてである。
DFT vs. IDFT differ in exactly three places: (1) the sign of the exponent ($-j$ vs. $+j$), (2) the factor $1/N$ in front of the inverse, (3) which variable is summed over ($n$ vs. $k$). Some texts split the $1/N$ as $1/\sqrt{N}$ on both sides to make the transform unitary; MATLAB and these lecture notes put all of $1/N$ in the inverse.DFT 與 IDFT 剛好差在三個地方:(1) 指數的正負號($-j$ 對 $+j$),(2) 反變換前面多了 $1/N$,(3) 對哪個變數求和($n$ 對 $k$)。有些教科書把 $1/N$ 拆成兩邊各 $1/\sqrt{N}$,讓變換成為么正的;MATLAB 與本課程講義則把 $1/N$ 全部放在反變換這一側。DFT と IDFT が違うのはちょうど三か所である。(1) 指数の符号($-j$ と $+j$)、(2) 逆変換の前に付く因子 $1/N$、(3) どの変数について和をとるか($n$ と $k$)。教科書によっては $1/N$ を両辺の $1/\sqrt{N}$ に分けて変換をユニタリにするものもあるが、MATLAB と本講義ノートは $1/N$ をすべて逆変換側に置く。
The cosine step above is compressed into one line. Unpacked, it is just Euler's formula followed by the same rotated-vector sum that proved the IDFT in §8.2.2. The cosine splits into two complex exponentials, and each one lines up with exactly one DFT basis vector and produces exactly one spike.上面那個餘弦波的步驟壓成了一行。拆開來看,它不過是 Euler 公式,加上 §8.2.2 證明 IDFT 時用的那個「旋轉向量和」而已。餘弦波被拆成兩個複指數,而每一個都恰好對準一個 DFT 基底向量,產生恰好一根譜線。上の余弦波のステップは一行に圧縮されている。ほどいてみれば、Euler の公式に、§8.2.2 で IDFT を証明したのと同じ回転ベクトルの和を続けただけである。余弦波は二つの複素指数に分かれ、そのそれぞれがちょうど一つの DFT 基底ベクトルと揃い、ちょうど一本の尖りを生む。
Step 1 — split the cosine (Euler)步驟 1 — 用 Euler 公式把餘弦拆開ステップ 1 — 余弦波を分ける(Euler)
With $W_N = e^{-j2\pi/N}$, so that $W_N^{-k_0 n} = e^{+j2\pi k_0 n/N}$:由於 $W_N = e^{-j2\pi/N}$,因此 $W_N^{-k_0 n} = e^{+j2\pi k_0 n/N}$:$W_N = e^{-j2\pi/N}$ なので、$W_N^{-k_0 n} = e^{+j2\pi k_0 n/N}$ である:
$$\cos\!\Big(\frac{2\pi k_0 n}{N}\Big) = \frac{1}{2}\Big(e^{\,j2\pi k_0 n/N} + e^{-j2\pi k_0 n/N}\Big) = \frac{1}{2}\Big(W_N^{-k_0 n} + W_N^{\,k_0 n}\Big)$$Step 2 — transform each half separately步驟 2 — 分別對兩半做變換ステップ 2 — それぞれの半分を別々に変換する
Feed each half through $X[k] = \sum_n x[n]\,W_N^{kn}$ and combine the exponents:把每一半分別代入 $X[k] = \sum_n x[n]\,W_N^{kn}$,再把指數合併:各々の半分を $X[k] = \sum_n x[n]\,W_N^{kn}$ に通し、指数をまとめる:
$$X[k] = \frac{1}{2}\underbrace{\sum_{n=0}^{N-1} W_N^{\,n(k-k_0)}}_{\text{A}} \;+\; \frac{1}{2}\underbrace{\sum_{n=0}^{N-1} W_N^{\,n(k+k_0)}}_{\text{B}}$$Both A and B are the rotated-vector sum of §8.2.2: $N$ when the exponent multiplier is a multiple of $N$, and $0$ otherwise.A 與 B 都是 §8.2.2 的那個旋轉向量和:當指數的倍數是 $N$ 的倍數時為 $N$,其餘情況為 $0$。A も B も §8.2.2 の回転ベクトルの和である。指数の係数が $N$ の倍数のときは $N$、それ以外では $0$ になる。
Each spike is therefore $\tfrac12 \cdot N = N/2$ tall, and every other bin is exactly zero — which is the boxed result of Example 8-2.因此每一根譜線的高度都是 $\tfrac12 \cdot N = N/2$,而其餘每一格都恰好為零——這就是範例 8-2 框起來的那個結果。したがって各々の尖りの高さは $\tfrac12 \cdot N = N/2$ であり、他のビンはすべて厳密にゼロとなる。これが例 8-2 で枠に入れた結果である。
Four things are worth watching as you move the sliders:移動滑桿時,有四件事值得留意:スライダーを動かすとき、注目に値することが四つある:
The most important transform pair of the chapter: the length-$L$ rectangular pulse $x[n] = 1$, $0\le n\le L-1$. Its DTFT is a geometric series:本章最重要的一組變換對:長度為 $L$ 的矩形脈衝 $x[n] = 1$($0\le n\le L-1$)。它的 DTFT 是一個等比級數:本章で最も重要な変換対:長さ $L$ の矩形パルス $x[n] = 1$($0\le n\le L-1$)。その DTFT は等比級数である:
The magnitude $\left|\sin(\omega L/2)/\sin(\omega/2)\right|$ is the periodic sinc: main-lobe peak $L$ at $\omega = 0$, zeros at $\omega = 2\pi m/L$ ($m$ not a multiple of $L$), main-lobe width $4\pi/L$, and — unlike the continuous sinc — it is $2\pi$-periodic and returns to height $L$ at every multiple of $2\pi$.振幅 $\left|\sin(\omega L/2)/\sin(\omega/2)\right|$ 就是週期性 sinc:在 $\omega = 0$ 處主瓣峰值為 $L$,零點位於 $\omega = 2\pi m/L$($m$ 不為 $L$ 的倍數),主瓣寬度為 $4\pi/L$;而且——與連續的 sinc 不同——它是以 $2\pi$ 為週期的,在每一個 $2\pi$ 的倍數處都會回到高度 $L$。振幅 $\left|\sin(\omega L/2)/\sin(\omega/2)\right|$ が周期 sinc である。$\omega = 0$ で主ローブの頂点が $L$、零点は $\omega = 2\pi m/L$($m$ は $L$ の倍数でない)、主ローブ幅は $4\pi/L$ であり、しかも —— 連続の sinc とは違って —— 周期 $2\pi$ をもち、$2\pi$ の倍数のたびに高さ $L$ へ戻る。
Now sample it. With $N = L = 8$, every DFT sample except $k=0$ lands exactly on a zero crossing of the periodic sinc — the DFT sees only $X[0]=8$ and looks deceptively like an impulse. With $N = 32$ (zero padding the same 8 samples), the DFT samples trace out the full lobe structure:現在對它取樣。當 $N = L = 8$ 時,除了 $k=0$ 以外,每一個 DFT 樣本都正好落在週期性 sinc 的零交越點上——DFT 只看得到 $X[0]=8$,看起來會誤以為是一個脈衝。改成 $N = 32$(把同樣的 8 個樣本補零),DFT 的樣本才描出完整的旁瓣結構:これを標本化してみよう。$N = L = 8$ では、$k=0$ を除くすべての DFT 標本が周期 sinc の零交差点にちょうど落ちる。DFT には $X[0]=8$ しか見えず、紛らわしくもインパルスのように見える。$N = 32$ にすると(同じ 8 標本にゼロ詰めする)、DFT の標本がローブ構造を余さずなぞり出す:
Fig. 8-1 (top) is a classic exam trap: an $N$-point DFT can look "clean" purely because the interesting features of the underlying DTFT fall between the samples. The DTFT did not change between the two panels — only the sampling grid did. Zero padding (§8.7.1) is how you refine the grid.圖 8-1(上)是考試的經典陷阱:一個 $N$ 點 DFT 看起來很「乾淨」,可能純粹是因為底層 DTFT 中有趣的特徵都落在樣本之間。上下兩張圖的 DTFT 完全沒變,變的只有取樣格點。補零(§8.7.1)就是加密這個格點的方法。図 8-1(上)は試験の古典的な罠である。$N$ 点 DFT が「きれい」に見えるのは、背後の DTFT の面白い特徴がすべて標本のあいだに落ちているだけ、ということがある。二つの図のあいだで DTFT は変わっておらず、変わったのは標本化格子だけである。格子を細かくする方法がゼロ詰め(§8.7.1)である。
§8.1.3 sampled the DTFT to get the DFT. This section runs the arrow backwards: the $N$ DFT samples $X[k]$ already determine the entire continuous DTFT $X(e^{j\omega})$ of a length-$N$ sequence. The values between the samples are filled in by the periodic sinc kernel of §8.2.4. This is the frequency-domain twin of the sinc interpolation that reconstructed a signal from its samples when we upsampled.§8.1.3 是對 DTFT 取樣得到 DFT。本節把箭頭反過來:$N$ 個 DFT 樣本 $X[k]$ 就能決定長度為 $N$ 之序列的整條連續 DTFT $X(e^{j\omega})$。樣本之間的值由 §8.2.4 的週期性 sinc核函數補上。這就是先前升取樣投影片中 sinc 內插的頻域版本。§8.1.3 では DTFT を標本化して DFT を得た。本節は矢印を逆向きに辿る。$N$ 個の DFT 標本 $X[k]$ は、長さ $N$ の系列の連続な DTFT $X(e^{j\omega})$ 全体をすでに決定している。標本と標本のあいだの値は、§8.2.4 の周期 sinc 核によって埋められる。これは、アップサンプリングの際に標本から信号を再構成した sinc 内挿の、周波数領域における双子である。
| Symbol | Meaning |
|---|---|
| $x[n]$ | finite-length sequence, nonzero only on $0 \le n \le N-1$ |
| $X(e^{j\omega})$ | the DTFT: a continuous function of $\omega$, $2\pi$-periodic |
| $X[k]$ | the $N$-point DFT: the DTFT sampled at $\omega_k = 2\pi k/N$, i.e. $X[k] = X(e^{j2\pi k/N})$ |
| $W_N$ | $e^{-j2\pi/N}$, so that $W_N^{-kn} = e^{+j2\pi kn/N}$ |
| $\omega$ | an arbitrary frequency, not restricted to the bin grid |
| $\Delta\omega_k$ | $\omega - \frac{2\pi k}{N}$: the distance from $\omega$ to the $k$-th bin |
| 符號 | 意義 |
|---|---|
| $x[n]$ | 有限長度序列,只在 $0 \le n \le N-1$ 時非零 |
| $X(e^{j\omega})$ | DTFT:$\omega$ 的連續函數,週期為 $2\pi$ |
| $X[k]$ | $N$ 點 DFT:DTFT 在 $\omega_k = 2\pi k/N$ 處的取樣,即 $X[k] = X(e^{j2\pi k/N})$ |
| $W_N$ | $e^{-j2\pi/N}$,因此 $W_N^{-kn} = e^{+j2\pi kn/N}$ |
| $\omega$ | 任意頻率,不限於頻率格點(bin)上 |
| $\Delta\omega_k$ | $\omega - \frac{2\pi k}{N}$:$\omega$ 與第 $k$ 個格點的距離 |
| 記号 | 意味 |
|---|---|
| $x[n]$ | 有限長系列。$0 \le n \le N-1$ でのみ非零 |
| $X(e^{j\omega})$ | DTFT:$\omega$ の連続関数で、周期は $2\pi$ |
| $X[k]$ | $N$ 点 DFT:DTFT を $\omega_k = 2\pi k/N$ で標本化したもの、すなわち $X[k] = X(e^{j2\pi k/N})$ |
| $W_N$ | $e^{-j2\pi/N}$。したがって $W_N^{-kn} = e^{+j2\pi kn/N}$ |
| $\omega$ | 任意の周波数。ビンの格子上に限られない |
| $\Delta\omega_k$ | $\omega - \frac{2\pi k}{N}$:$\omega$ から第 $k$ ビンまでの距離 |
Step 1 — start from the DTFT步驟 1 — 從 DTFT 出發ステップ 1 — DTFT から出発する
Because $x[n]$ has only $N$ nonzero samples, the sum is finite:由於 $x[n]$ 只有 $N$ 個非零樣本,和式是有限項:$x[n]$ は非零の標本を $N$ 個しかもたないので、和は有限項である:
$$X(e^{j\omega}) = \sum_{n=0}^{N-1} x[n]\,e^{-j\omega n}$$Now replace $x[n]$ by the IDFT, $x[n] = \frac{1}{N}\sum_k X[k]\,W_N^{-kn}$.接著以 IDFT 取代 $x[n]$,即 $x[n] = \frac{1}{N}\sum_k X[k]\,W_N^{-kn}$。次に $x[n]$ を IDFT、すなわち $x[n] = \frac{1}{N}\sum_k X[k]\,W_N^{-kn}$ で置き換える。
Step 2 — swap the sums and merge the exponents步驟 2 — 交換求和順序並合併指數ステップ 2 — 和の順序を交換し、指数をまとめる
$$W_N^{-kn}e^{-j\omega n} = e^{j\frac{2\pi k}{N}n}e^{-j\omega n} = e^{-j\left(\omega - \frac{2\pi k}{N}\right)n} = e^{-j\Delta\omega_k n}$$The inner sum over $n$ therefore depends only on the distance $\Delta\omega_k$ — not on $\omega$ and $k$ separately.因此對 $n$ 的內層和只與距離 $\Delta\omega_k$ 有關,而與 $\omega$、$k$ 各自的值無關。したがって $n$ についての内側の和は距離 $\Delta\omega_k$ だけに依存し、$\omega$ と $k$ の個別の値には依存しない。
Step 3 — evaluate the inner sum步驟 3 — 計算內層和ステップ 3 — 内側の和を評価する
It is a geometric series with ratio $e^{-j\Delta\omega_k}$ and $N$ terms. Pull $e^{-jN\Delta\omega_k/2}$ out of the numerator and $e^{-j\Delta\omega_k/2}$ out of the denominator so each bracket becomes the symmetric form $e^{j\theta}-e^{-j\theta}$, then apply $e^{j\theta}-e^{-j\theta} = 2j\sin\theta$ — the two factors of $2j$ cancel:這個和的公比為 $e^{-j\Delta\omega_k}$,共 $N$ 項。從分子提出 $e^{-jN\Delta\omega_k/2}$、從分母提出 $e^{-j\Delta\omega_k/2}$,使每個括號都成為對稱形式 $e^{j\theta}-e^{-j\theta}$,再套用尤拉公式 $e^{j\theta}-e^{-j\theta} = 2j\sin\theta$——分子分母的 $2j$ 互相抵消:これは公比 $e^{-j\Delta\omega_k}$、項数 $N$ の等比級数である。分子から $e^{-jN\Delta\omega_k/2}$ を、分母から $e^{-j\Delta\omega_k/2}$ をくくり出して、どちらの括弧も対称形 $e^{j\theta}-e^{-j\theta}$ にする。そこへ $e^{j\theta}-e^{-j\theta} = 2j\sin\theta$ を適用すると、二つの $2j$ が打ち消し合う:
$$\sum_{n=0}^{N-1} e^{-j\Delta\omega_k n} = \frac{1 - e^{-jN\Delta\omega_k}}{1 - e^{-j\Delta\omega_k}} = \underbrace{e^{-j\frac{N-1}{2}\Delta\omega_k}}_{\text{pure phase},\;|\cdot|=1}\cdot \underbrace{\frac{\sin(N\Delta\omega_k/2)}{\sin(\Delta\omega_k/2)}}_{\text{purely real}}$$The phase factor is linear in $\Delta\omega_k$ and corresponds to a delay of $\frac{N-1}{2}$ — the centre of the sequence $0,\dots,N-1$. The real factor sets the shape.相位因子對 $\Delta\omega_k$ 是線性的,對應 $\frac{N-1}{2}$ 的延遲,也就是序列 $0,\dots,N-1$ 的中心。實數部分決定形狀。位相因子は $\Delta\omega_k$ について線形であり、$\frac{N-1}{2}$ の遅延、すなわち系列 $0,\dots,N-1$ の中心に対応する。形を決めるのは実数因子のほうである。
In words: the DTFT at any $\omega$ is a weighted sum of the $N$ DFT values, the weight of bin $k$ depending only on how far $\omega$ sits from that bin.這條式子的意思是:任意 $\omega$ 處的 DTFT,都是 $N$ 個 DFT 值的加權和。第 $k$ 個格點的權重取決於 $\omega$ 離該格點多遠。言葉で言えば、任意の $\omega$ における DTFT は $N$ 個の DFT 値の重み付き和である。ビン $k$ の重みは、$\omega$ がそのビンからどれだけ離れているかだけで決まる。
Step 3 above pulled a half-angle exponential out of the numerator and the denominator. That one move is what turns a messy complex fraction into a pure phase times a purely real function, so it is worth doing slowly.上面的步驟 3 從分子和分母各提出了一個半角的指數。正是這一步,把一個雜亂的複數分式變成「純相位 × 純實數函數」,所以值得慢慢走一遍。上のステップ 3 では、分子と分母から半角の指数をくくり出した。この一手こそが、ごちゃついた複素分数を「純位相 × 純実関数」に変えるものなので、ゆっくり辿る価値がある。
The numerator is lopsided分子是不對稱的分子は左右非対称である
Its two terms have angles $0$ and $-N\Delta\omega_k$ — not symmetric about anything. Pull out an exponential whose angle is half the full angle:它的兩項角度分別是 $0$ 與 $-N\Delta\omega_k$——對任何東西都不對稱。於是提出一個角度為全角一半的指數:その二項の角度は $0$ と $-N\Delta\omega_k$ であり、何に対しても対称ではない。そこで、全角の半分を角度にもつ指数をくくり出す:
$$1 - e^{-jN\Delta\omega_k} = e^{-jN\Delta\omega_k/2}\Big(e^{+jN\Delta\omega_k/2} - e^{-jN\Delta\omega_k/2}\Big)$$Check it by multiplying back in: $e^{-jN\Delta\omega_k/2}\cdot e^{+jN\Delta\omega_k/2} = e^{0} = 1$ and $e^{-jN\Delta\omega_k/2}\cdot e^{-jN\Delta\omega_k/2} = e^{-jN\Delta\omega_k}$, so the two sides agree.乘回去檢查即可:$e^{-jN\Delta\omega_k/2}\cdot e^{+jN\Delta\omega_k/2} = e^{0} = 1$,而 $e^{-jN\Delta\omega_k/2}\cdot e^{-jN\Delta\omega_k/2} = e^{-jN\Delta\omega_k}$,兩邊確實相等。掛け戻して確かめればよい。$e^{-jN\Delta\omega_k/2}\cdot e^{+jN\Delta\omega_k/2} = e^{0} = 1$ であり、$e^{-jN\Delta\omega_k/2}\cdot e^{-jN\Delta\omega_k/2} = e^{-jN\Delta\omega_k}$ であるから、両辺は一致する。
The denominator, treated identically分母比照辦理分母も同じように扱う
Same move with half of its angle, $\Delta\omega_k/2$:同樣的動作,用的是它自己的半角 $\Delta\omega_k/2$:同じ操作を、今度は分母自身の半角 $\Delta\omega_k/2$ で行う:
$$1 - e^{-j\Delta\omega_k} = e^{-j\Delta\omega_k/2}\Big(e^{+j\Delta\omega_k/2} - e^{-j\Delta\omega_k/2}\Big)$$Now every bracket is symmetric現在每個括號都是對稱的了これでどの括弧も対称になった
Each bracket has the form $e^{j\theta} - e^{-j\theta}$, which Euler turns straight into a sine, $e^{j\theta} - e^{-j\theta} = 2j\sin\theta$. The two factors of $2j$ cancel and the two leftover phases combine into one:每個括號都是 $e^{j\theta} - e^{-j\theta}$ 的形式,而尤拉公式直接把它變成正弦:$e^{j\theta} - e^{-j\theta} = 2j\sin\theta$。兩個 $2j$ 互相抵消,剩下的兩個相位則合併為一個:どの括弧も $e^{j\theta} - e^{-j\theta}$ の形をしており、Euler の公式がこれをそのまま正弦に変える:$e^{j\theta} - e^{-j\theta} = 2j\sin\theta$。二つの $2j$ は打ち消し合い、残った二つの位相は一つにまとまる:
$$\frac{1 - e^{-jN\Delta\omega_k}}{1 - e^{-j\Delta\omega_k}} = \frac{e^{-jN\Delta\omega_k/2}}{e^{-j\Delta\omega_k/2}}\cdot \frac{2j\sin(N\Delta\omega_k/2)}{2j\sin(\Delta\omega_k/2)} = e^{-j\frac{N-1}{2}\Delta\omega_k}\cdot\frac{\sin(N\Delta\omega_k/2)}{\sin(\Delta\omega_k/2)}$$the phases combining because $\dfrac{e^{-jN\Delta\omega_k/2}}{e^{-j\Delta\omega_k/2}} = e^{-j(N-1)\Delta\omega_k/2}$. That is exactly the split the slide labels: a pure phase and a purely real function.相位之所以能合併,是因為 $\dfrac{e^{-jN\Delta\omega_k/2}}{e^{-j\Delta\omega_k/2}} = e^{-j(N-1)\Delta\omega_k/2}$。這正是投影片上標示的那個拆解:一個純相位,乘上一個純實數的函數。位相がまとまるのは $\dfrac{e^{-jN\Delta\omega_k/2}}{e^{-j\Delta\omega_k/2}} = e^{-j(N-1)\Delta\omega_k/2}$ だからである。これこそスライドが名づけている分解、すなわち純位相と純実数の関数への分解である。
The points $1$ and $e^{-j\theta}$ both sit on the unit circle, and $1 - e^{-j\theta}$ is the chord joining them. The chord is perpendicular to the bisector of the two radii, and that bisector points at angle $-\theta/2$; the chord's length is $2\left|\sin(\theta/2)\right|$. Factoring out $e^{-j\theta/2}$ rotates the whole picture so the bisector lies along the real axis — and in that rotated frame the chord is purely vertical, i.e. purely imaginary, with length $2\sin(\theta/2)$. That is where the sine comes from, and why what is left over is real.點 $1$ 與 $e^{-j\theta}$ 都落在單位圓上,而 $1 - e^{-j\theta}$ 就是連接兩者的弦。這條弦垂直於兩條半徑的角平分線,而該角平分線指向角度 $-\theta/2$;弦長為 $2\left|\sin(\theta/2)\right|$。提出 $e^{-j\theta/2}$ 相當於把整張圖轉到角平分線落在實軸上——在那個旋轉後的座標裡,弦是純垂直的,也就是純虛數,長度為 $2\sin(\theta/2)$。正弦就是這樣跑出來的,剩下的部分之所以是實數也是因為如此。点 $1$ と $e^{-j\theta}$ はどちらも単位円上にあり、$1 - e^{-j\theta}$ は両者を結ぶ弦である。この弦は二本の半径の二等分線に垂直であり、その二等分線は角度 $-\theta/2$ を向く。弦の長さは $2\left|\sin(\theta/2)\right|$ である。$e^{-j\theta/2}$ をくくり出すことは、図全体を回して二等分線を実軸に重ねることに当たる。その回転した座標では弦は純粋に垂直、すなわち純虚数となり、長さは $2\sin(\theta/2)$ である。正弦はここから生じ、残ったものが実数になる理由もここにある。
| Position (with $x = \Delta\omega_k/2$) | Value | Why |
|---|---|---|
| $x = 0$, i.e. $\omega$ exactly on bin $k$ | $N$ | limit $\frac{\sin Nx}{\sin x} \to \frac{Nx}{x} = N$ |
| $x = r\pi/N$, $r = \pm1, \pm2, \dots$ | $0$ | numerator $\sin(r\pi) = 0$, denominator nonzero |
| $x = \pi$ | $\pm N$ | periodic repetition; the sign is $(-1)^{N-1}$ |
| elsewhere | in between | decaying ripple |
| 位置(令 $x = \Delta\omega_k/2$) | 值 | 原因 |
|---|---|---|
| $x = 0$,即 $\omega$ 恰好在第 $k$ 個格點上 | $N$ | 極限 $\frac{\sin Nx}{\sin x} \to \frac{Nx}{x} = N$ |
| $x = r\pi/N$,$r = \pm1, \pm2, \dots$ | $0$ | 分子 $\sin(r\pi) = 0$,分母不為零 |
| $x = \pi$ | $\pm N$ | 週期性重複;正負號為 $(-1)^{N-1}$ |
| 其他位置 | 介於其間 | 逐漸衰減的漣波 |
| 位置($x = \Delta\omega_k/2$ とおく) | 値 | 理由 |
|---|---|---|
| $x = 0$、すなわち $\omega$ がちょうどビン $k$ 上 | $N$ | 極限 $\frac{\sin Nx}{\sin x} \to \frac{Nx}{x} = N$ |
| $x = r\pi/N$、$r = \pm1, \pm2, \dots$ | $0$ | 分子が $\sin(r\pi) = 0$、分母は非零 |
| $x = \pi$ | $\pm N$ | 周期的な繰り返し。符号は $(-1)^{N-1}$ |
| それ以外 | その中間 | 減衰するリップル |
Let $\omega$ be another bin, $\omega = 2\pi k'/N$. Then $\Delta\omega_k/2 = \pi(k'-k)/N$, which lands exactly on a zero. So kernel $k$ equals $N$ on its own bin and $0$ on every other bin; after dividing by $N$, the interpolated curve passes exactly through every $X[k]$. This is the same property the time-domain sinc had when we upsampled: $1$ at its own sample, $0$ at all the others.令 $\omega$ 為另一個格點,$\omega = 2\pi k'/N$。則 $\Delta\omega_k/2 = \pi(k'-k)/N$,恰好落在零點上。所以第 $k$ 個核函數在自己的格點上等於 $N$,在其他所有格點上等於 $0$。除以 $N$ 之後,內插曲線會精確通過每一個 $X[k]$。這與升取樣例子中時域 sinc 的性質相同:在自己的樣本點為 $1$,在其他樣本點為 $0$。$\omega$ を別のビン $\omega = 2\pi k'/N$ としてみよう。すると $\Delta\omega_k/2 = \pi(k'-k)/N$ となり、ちょうど零点に落ちる。つまり核 $k$ は自分のビンでは $N$、他のどのビンでも $0$ である。$N$ で割れば、内挿された曲線はすべての $X[k]$ をきっかり通る。これはアップサンプリングのときに時間領域の sinc がもっていたのと同じ性質である。自分の標本点では $1$、他のすべての標本点では $0$ になるという性質である。
The slide's picture drops the phase factor. That is exact when $x[n]$ is symmetric, $x[n] = x[N-1-n]$: the linear phase factors out completely and the remaining real amplitude is interpolated by the real kernel alone. The plot above uses a symmetric $x[n]$, so it is exact. Things worth trying with the sliders:投影片的圖省略了相位因子。當 $x[n]$ 對稱,即 $x[n] = x[N-1-n]$ 時,這樣做是精確的:線性相位可以整個提出來,剩下的實數振幅只靠實數核函數內插。上圖使用對稱的 $x[n]$,因此結果是精確的。可以用滑桿試試以下幾件事:スライドの図は位相因子を落としている。それが厳密に正しいのは $x[n]$ が対称、すなわち $x[n] = x[N-1-n]$ のときである。そのとき線形位相は完全にくくり出され、残った実数振幅は実数核だけで内挿される。上の図は対称な $x[n]$ を用いているので厳密である。スライダーで試してみる価値のあることは:
The boxed formula has two factors, and the plot above showed only the real one. Seen in 3-D, the complex kernel $D(\Delta\omega)/N$ is a curve that corkscrews around the $\Delta\omega$ axis:方框裡的公式有兩個因子,而上面的圖只畫了實數那一個。若放到 3-D 來看,複數核函數 $D(\Delta\omega)/N$ 是一條繞著 $\Delta\omega$ 軸旋轉前進的曲線:枠内の公式には二つの因子があるが、上の図は実数のほうしか描いていない。3 次元で見ると、複素核 $D(\Delta\omega)/N$ は $\Delta\omega$ 軸のまわりを螺旋状に進む曲線である:
§8.2.5 is the third time this course has reconstructed a continuous curve from a discrete set of samples, and all three times the machinery was identical. Lining them up makes the pattern — and the one genuine difference — obvious.§8.2.5 已經是本課程第三次「由離散的樣本重建出一條連續曲線」了,而且這三次用的機制完全相同。把它們並排放在一起,共通的模式——以及唯一真正的差異——就一目了然。§8.2.5 は、本講義で離散的な標本の組から連続な曲線を再構成した三度目であり、三度とも仕組みは同一であった。並べてみれば、共通の型 —— そして唯一の本物の違い —— がはっきりする。
| §6.4.2 — reconstruction | §7.3.3 — upsampling | §8.2.5 — DTFT from DFT | |
|---|---|---|---|
| Given | samples $x[n] = x_a(nT)$ | samples $x[k]$ at rate $1/T$ | DFT values $X[k]$ |
| Reconstructs | $\hat{x}_a(t)$, continuous in $t$ | $x_i[n]$ on the finer grid $T/L$ | $X(e^{j\omega})$, continuous in $\omega$ |
| Formula | $\sum_n x[n]\,\dfrac{\sin(\pi(t-nT)/T)}{\pi(t-nT)/T}$ | $\sum_k x[k]\,\dfrac{\sin(\pi(n-kL)/L)}{\pi(n-kL)/L}$ | $\dfrac{1}{N}\sum_k X[k]\,D(\Delta\omega_k)\,e^{-j\frac{N-1}{2}\Delta\omega_k}$ |
| Kernel | ordinary sinc | ordinary sinc | periodic sinc (Dirichlet) |
| Number of terms | infinite | infinite | exactly $N$ |
| What makes it work | $x_a$ is bandlimited to $\pi/T$ | same, one domain down | $x[n]$ is time-limited to $N$ samples |
| Fails when | $T$ too large → frequency aliasing | — | $N <$ sequence length → time aliasing (§8.5) |
| §6.4.2 — 訊號重建 | §7.3.3 — 升取樣 | §8.2.5 — 由 DFT 求 DTFT | |
|---|---|---|---|
| 已知 | 樣本 $x[n] = x_a(nT)$ | 取樣率 $1/T$ 的樣本 $x[k]$ | DFT 值 $X[k]$ |
| 重建出 | $\hat{x}_a(t)$,對 $t$ 連續 | 較密格點 $T/L$ 上的 $x_i[n]$ | $X(e^{j\omega})$,對 $\omega$ 連續 |
| 公式 | $\sum_n x[n]\,\dfrac{\sin(\pi(t-nT)/T)}{\pi(t-nT)/T}$ | $\sum_k x[k]\,\dfrac{\sin(\pi(n-kL)/L)}{\pi(n-kL)/L}$ | $\dfrac{1}{N}\sum_k X[k]\,D(\Delta\omega_k)\,e^{-j\frac{N-1}{2}\Delta\omega_k}$ |
| 核函數 | 一般的 sinc | 一般的 sinc | 週期性 sinc(Dirichlet) |
| 項數 | 無限 | 無限 | 恰好 $N$ 項 |
| 為什麼成立 | $x_a$ 是帶限於 $\pi/T$ 的 | 同上,只是降一個域 | $x[n]$ 是時限於 $N$ 個樣本的 |
| 何時失效 | $T$ 太大 → 頻率上的混疊 | — | $N <$ 序列長度 → 時間上的混疊(§8.5) |
| §6.4.2 — 再構成 | §7.3.3 — アップサンプリング | §8.2.5 — DFT から DTFT へ | |
|---|---|---|---|
| 与えられるもの | 標本 $x[n] = x_a(nT)$ | レート $1/T$ の標本 $x[k]$ | DFT 値 $X[k]$ |
| 再構成するもの | $t$ について連続な $\hat{x}_a(t)$ | より細かい格子 $T/L$ 上の $x_i[n]$ | $\omega$ について連続な $X(e^{j\omega})$ |
| 公式 | $\sum_n x[n]\,\dfrac{\sin(\pi(t-nT)/T)}{\pi(t-nT)/T}$ | $\sum_k x[k]\,\dfrac{\sin(\pi(n-kL)/L)}{\pi(n-kL)/L}$ | $\dfrac{1}{N}\sum_k X[k]\,D(\Delta\omega_k)\,e^{-j\frac{N-1}{2}\Delta\omega_k}$ |
| 核 | ふつうの sinc | ふつうの sinc | 周期 sinc(Dirichlet) |
| 項数 | 無限 | 無限 | ちょうど $N$ |
| 成り立つ理由 | $x_a$ が $\pi/T$ に帯域制限されている | 同じことを一つ下の領域で | $x[n]$ が $N$ 標本に時間制限されている |
| 破綻する条件 | $T$ が大きすぎる → 周波数エイリアシング | — | $N <$ 系列長 → 時間エイリアシング(§8.5) |
Every one of these formulas works for exactly one reason. The kernel equals $1$ at the sample it belongs to and $0$ at every other sample point:上面每一條公式之所以成立,理由完全相同:核函數在它所屬的那個樣本上等於 $1$,而在其他每一個樣本點上等於 $0$:これらの公式がどれも成り立つ理由はただ一つである。核は自分が属する標本では $1$ に等しく、他のあらゆる標本点では $0$ になる:
Between the nodes the neighbouring kernels are nonzero, so the value there is a weighted mix — with alternating signs, which is what bends the curve onto the smooth path rather than a straight line between samples.在節點之間,鄰近的核函數都不為零,所以該處的值是一個加權混合——而且正負交替,正是這一點把曲線彎到平滑的路徑上,而不是在樣本之間走直線。節点と節点のあいだでは隣の核が非零なので、そこでの値は重み付きの混合になる。しかも符号が交互に入れ替わり、これこそが曲線を標本間の直線ではなくなめらかな経路へと曲げるものである。
A sinc is what you get when you transform a rectangle. Which kind of sinc depends on whether the axis the rectangle sits on is continuous or discrete:對一個矩形做變換就會得到 sinc。至於得到哪一種 sinc,取決於矩形所在的那條軸是連續的還是離散的:矩形を変換すれば sinc が出てくる。どの種類の sinc になるかは、矩形が載っている軸が連続か離散かで決まる:
Being limited in one domain buys you interpolability in the other. §6.4.2 is bandlimited in frequency, so the time function is pinned down by samples spaced $T$ apart. §8.2.5 is time-limited in time, so the frequency function is pinned down by samples spaced $2\pi/N$ apart. Sampling theorem and DFT interpolation are the same theorem read in opposite directions.在一個域裡受限,就換來在另一個域裡可內插。§6.4.2 在頻率上帶限,所以時間函數被間隔 $T$ 的樣本完全釘住;§8.2.5 在時間上時限,所以頻率函數被間隔 $2\pi/N$ 的樣本完全釘住。取樣定理與 DFT 內插,其實是同一條定理從相反方向讀出來的。一方の領域で制限されていることが、もう一方の領域での内挿可能性を買い取る。§6.4.2 は周波数で帯域制限されているので、時間の関数は間隔 $T$ の標本で完全に決まる。§8.2.5 は時間で時間制限されているので、周波数の関数は間隔 $2\pi/N$ の標本で完全に決まる。標本化定理と DFT 内挿は、同じ定理を逆方向から読んだものである。
The failure modes are dual too. Sample too slowly in time and the spectral copies overlap — frequency aliasing (§6.3.2). Sample the DTFT too sparsely, $N$ smaller than the sequence length, and the time copies overlap — time aliasing (§8.5), which is exactly the wrap-around behind circular convolution (§8.6.2) and the reason zero padding works (§8.7.1).連失效的方式也是對偶的。在時間上取樣太慢,頻譜的複本就會重疊——這是頻率上的混疊(§6.3.2)。對 DTFT 取樣太稀疏,也就是 $N$ 小於序列長度時,時間上的複本就會重疊——這是時間上的混疊(§8.5),也正是循環摺積背後那個繞回現象(§8.6.2),以及補零之所以有效的原因(§8.7.1)。破綻の仕方もまた双対である。時間での標本化が粗すぎればスペクトルの複製が重なる —— 周波数エイリアシング(§6.3.2)である。DTFT の標本化が疎すぎれば、すなわち $N$ が系列長より小さければ、時間の複製が重なる —— 時間エイリアシング(§8.5)であり、これこそ円状畳み込みの背後にある巻き込み(§8.6.2)そのものであり、ゼロ詰めが効く理由(§8.7.1)でもある。
| Role | §6.4.2 (time) | §8.2.5 (frequency) |
|---|---|---|
| limited quantity | bandwidth $\le \pi/T$ | duration $\le N$ samples |
| sample spacing | $T$ in time | $2\pi/N$ in $\omega$ |
| reconstructed axis | continuous $t$ | continuous $\omega$ |
| kernel | sinc, aperiodic | Dirichlet, $2\pi$-periodic |
| too-coarse sampling causes | aliasing in frequency | aliasing in time |
| the fix | sample faster / anti-alias filter | zero pad to a larger $N$ |
| 角色 | §6.4.2(時域) | §8.2.5(頻域) |
|---|---|---|
| 受限的量 | 頻寬 $\le \pi/T$ | 長度 $\le N$ 個樣本 |
| 取樣間隔 | 時間上的 $T$ | $\omega$ 上的 $2\pi/N$ |
| 被重建的軸 | 連續的 $t$ | 連續的 $\omega$ |
| 核函數 | sinc,非週期 | Dirichlet,以 $2\pi$ 為週期 |
| 取樣太疏會造成 | 頻率上的混疊 | 時間上的混疊 |
| 解決辦法 | 提高取樣率/加抗混疊濾波器 | 補零到更大的 $N$ |
| 役割 | §6.4.2(時間) | §8.2.5(周波数) |
|---|---|---|
| 制限される量 | 帯域幅 $\le \pi/T$ | 継続長 $\le N$ 標本 |
| 標本間隔 | 時間上の $T$ | $\omega$ 上の $2\pi/N$ |
| 再構成される軸 | 連続な $t$ | 連続な $\omega$ |
| 核 | sinc、非周期 | Dirichlet、周期 $2\pi$ |
| 標本化が粗すぎると起きること | 周波数でのエイリアシング | 時間でのエイリアシング |
| 対処法 | 標本化を速める/折返し防止フィルタ | より大きな $N$ までゼロ詰めする |
The §6.4.2 sum is infinite and the §8.2.5 sum is finite, and that is not an accident of notation. A bandlimited signal has infinitely many degrees of freedom — one per sample, over all time — so exact reconstruction genuinely needs every sample, which is why ideal reconstruction is unrealisable and §7.3.4's practical interpolators exist. A length-$N$ sequence has only $N$ degrees of freedom, so $N$ numbers really are enough and the DFT interpolation formula is exactly computable. The 2-D demo above confirms it: the interpolated curve matches the true DTFT to machine precision.§6.4.2 的和是無限項,而 §8.2.5 的和是有限項,這不是記號上的偶然。一個帶限訊號有無限多個自由度——橫跨所有時間、每個樣本一個——所以精確重建確實需要用到每一個樣本,這也正是理想重建無法實現、而 §7.3.4 的實用內插器必須存在的原因。反觀長度為 $N$ 的序列只有 $N$ 個自由度,所以 $N$ 個數字真的就夠了,DFT 的內插公式是可以精確計算的。上面的 2-D 互動圖證實了這一點:內插出來的曲線與真正的 DTFT 吻合到機器精度。§6.4.2 の和は無限項、§8.2.5 の和は有限項であり、これは記法上の偶然ではない。帯域制限信号は無限個の自由度をもつ —— 全時間にわたって標本一つにつき一つ —— ので、厳密な再構成にはほんとうにすべての標本が要る。理想的な再構成が実現不可能であり、§7.3.4 の実用的な内挿器が存在するのはそのためである。一方、長さ $N$ の系列は自由度を $N$ 個しかもたないので、$N$ 個の数で本当に足りる。DFT の内挿公式は厳密に計算可能なのである。上の 2 次元デモがそれを裏づけている。内挿された曲線は真の DTFT と機械精度まで一致する。
Because the DFT is a linear map from $N$ samples to $N$ coefficients, it is a matrix–vector product. Stack the signal into $\mathbf{x} = \begin{bmatrix} x[0] & x[1] & \cdots & x[N-1]\end{bmatrix}^{T}$ and define the $N \times N$ DFT matrix $\mathbf{W}_N$ with entries $[\mathbf{W}_N]_{k,n} = W_N^{kn}$:由於 DFT 是一個從 $N$ 個樣本映到 $N$ 個係數的線性映射,它就是一個矩陣與向量的乘積。把訊號疊成 $\mathbf{x} = \begin{bmatrix} x[0] & x[1] & \cdots & x[N-1]\end{bmatrix}^{T}$,並定義元素為 $[\mathbf{W}_N]_{k,n} = W_N^{kn}$ 的 $N \times N$ DFT 矩陣 $\mathbf{W}_N$:DFT は $N$ 個の標本から $N$ 個の係数への線形写像なので、行列とベクトルの積である。信号を $\mathbf{x} = \begin{bmatrix} x[0] & x[1] & \cdots & x[N-1]\end{bmatrix}^{T}$ と積み上げ、成分が $[\mathbf{W}_N]_{k,n} = W_N^{kn}$ である $N \times N$ の DFT 行列 $\mathbf{W}_N$ を定義する:
$\mathbf{W}_N$ is a symmetric Vandermonde matrix(symmetric:$\mathbf{W}_N^{T} = \mathbf{W}_N$,因為 $W_N^{kn}=W_N^{nk}$). For example,$\mathbf{W}_N$ 是一個對稱的 Vandermonde 矩陣(對稱是指 $\mathbf{W}_N^{T} = \mathbf{W}_N$,因為 $W_N^{kn}=W_N^{nk}$)。舉例來說,$\mathbf{W}_N$ は対称な Vandermonde 行列である(対称とは $\mathbf{W}_N^{T} = \mathbf{W}_N$ のこと。$W_N^{kn}=W_N^{nk}$ だからである)。たとえば、
$$\mathbf{W}_4 = \begin{bmatrix} 1 & 1 & 1 & 1\\ 1 & -j & -1 & j\\ 1 & -1 & 1 & -1\\ 1 & j & -1 & -j \end{bmatrix} \qquad (W_4 = e^{-j\pi/2} = -j).$$From the orthogonality identity, the rows of $\mathbf{W}_N$ are orthogonal with norm-squared $N$, so the inverse needs no Gaussian elimination:由正交性恆等式可知,$\mathbf{W}_N$ 的各列互相正交、範數平方為 $N$,所以求反矩陣根本不需要高斯消去法:直交性の恒等式から、$\mathbf{W}_N$ の各行は互いに直交し、ノルムの二乗は $N$ である。したがって逆行列に Gauss の消去法は要らない:
Equivalently $\frac{1}{\sqrt{N}}\mathbf{W}_N$ is a unitary matrix(么正矩陣). Two consequences:等價地說,$\frac{1}{\sqrt{N}}\mathbf{W}_N$ 是一個么正矩陣。由此可得兩個推論:同じことだが、$\frac{1}{\sqrt{N}}\mathbf{W}_N$ はユニタリ行列である。ここから二つの帰結が得られる:
A direct matrix–vector DFT costs $N^2$ complex multiplications and $N(N-1)$ complex additions — $\mathcal{O}(N^2)$. For $N = 10^6$ that is $10^{12}$ multiplies. The FFT (next chapter) exploits the periodicity and symmetry of $W_N^{kn}$ to reduce this to $\mathcal{O}(N\log_2 N)$, which is why the DFT — not the DTFT — is the workhorse of practical DSP.直接用矩陣乘向量算 DFT,需要 $N^2$ 次複數乘法與 $N(N-1)$ 次複數加法——是 $\mathcal{O}(N^2)$。當 $N = 10^6$ 時就是 $10^{12}$ 次乘法。FFT(下一章)利用 $W_N^{kn}$ 的週期性與對稱性,把它降到 $\mathcal{O}(N\log_2 N)$——這正是為什麼在實用的 DSP 中挑大樑的是 DFT,而不是 DTFT。行列とベクトルの積で素直に DFT を計算すると、複素乗算が $N^2$ 回、複素加算が $N(N-1)$ 回かかる —— $\mathcal{O}(N^2)$ である。$N = 10^6$ なら $10^{12}$ 回の乗算になる。FFT(次章)は $W_N^{kn}$ の周期性と対称性を利用してこれを $\mathcal{O}(N\log_2 N)$ まで減らす。実用的な DSP の主役が DTFT ではなく DFT である理由はここにある。
MATLAB computes the DFT with fft and the IDFT with ifft (both use FFT algorithms regardless of whether $N$ is a power of two). Key conventions to remember:MATLAB 用 fft 計算 DFT、用 ifft 計算 IDFT(不論 $N$ 是不是 2 的冪次,兩者都採用 FFT 演算法)。幾個一定要記住的慣例:MATLAB は DFT を fft で、IDFT を ifft で計算する($N$ が 2 のべき乗かどうかに関わらず、どちらも FFT アルゴリズムを用いる)。覚えておくべき主な約束事は次のとおり:
X = fft(x) uses $N = $ length(x); X = fft(x, N) zero-pads or truncates to $N$ first.X = fft(x) 取 $N = $ length(x);X = fft(x, N) 則會先補零或截斷到 $N$。X = fft(x) は $N = $ length(x) をとる。X = fft(x, N) はまず $N$ までゼロ詰めするか、そこまで切り詰める。X(k+1). DC is X(1).索引是從 1 開始的:第 $k$ 格存在 X(k+1)。直流項是 X(1)。索引は 1 始まりである。ビン $k$ は X(k+1) にある。直流は X(1) である。fftshift recenters the spectrum.在取樣率為 $F_s$ 時,頻格與頻率的對應為 $f_k = k F_s/N$ Hz;超過 $N/2$ 的頻格代表負頻率。fftshift 可以把頻譜重新置中。標本化レートが $F_s$ のときのビンと周波数の対応は $f_k = k F_s/N$ Hz である。$N/2$ を超えるビンは負の周波数を表す。fftshift でスペクトルを中央に置き直せる。dftmtx(N), or build it directly as W.^(n'*k) as in Exercise 6.DFT 矩陣本身可以用 dftmtx(N),或像習題 6 那樣直接以 W.^(n'*k) 建構。DFT 行列そのものは dftmtx(N) で得られる。あるいは演習 6 のように W.^(n'*k) と直接構成してもよい。(1) X(1) must equal sum(x). (2) For real $x$, X(N-k+1) = conj(X(k+1)) — magnitude plots must be symmetric about $N/2$. (3) sum(abs(x).^2) must equal sum(abs(X).^2)/N (Parseval). If any of these fail, the bug is in your indexing.(1) X(1) 必須等於 sum(x)。(2) 對實數的 $x$,X(N-k+1) = conj(X(k+1))——振幅圖必須對 $N/2$ 左右對稱。(3) sum(abs(x).^2) 必須等於 sum(abs(X).^2)/N(Parseval)。只要有任何一項不成立,錯的一定是你的索引。(1) X(1) は sum(x) に等しくなければならない。(2) 実数の $x$ については X(N-k+1) = conj(X(k+1)) —— 振幅のプロットは $N/2$ について対称でなければならない。(3) sum(abs(x).^2) は sum(abs(X).^2)/N に等しくなければならない(Parseval)。どれか一つでも成り立たなければ、バグは索引の付け方にある。
Linearity(線性). If both sequences are defined on the same $N$-point grid, $a\,x_1[n] + b\,x_2[n] \;\longleftrightarrow\; a\,X_1[k] + b\,X_2[k]$. If lengths differ, zero-pad both to a common $N$ first.線性。若兩個序列定義在同一組 $N$ 點格點上,則 $a\,x_1[n] + b\,x_2[n] \;\longleftrightarrow\; a\,X_1[k] + b\,X_2[k]$。若長度不同,要先把兩者補零到共同的 $N$。線形性。二つの系列が同じ $N$ 点格子の上で定義されていれば、$a\,x_1[n] + b\,x_2[n] \;\longleftrightarrow\; a\,X_1[k] + b\,X_2[k]$ が成り立つ。長さが違う場合は、まず両方を共通の $N$ までゼロ詰めする。
Circular time shift(循環時間位移). Because the DFT views $x[n]$ as one period of a periodic sequence, "shifting" means rotating the samples around a circle of circumference $N$:循環時間位移。因為 DFT 把 $x[n]$ 看成某個週期序列的一個週期,所謂「位移」就是在一個周長為 $N$ 的圓上旋轉這些樣本:円状時間シフト。DFT は $x[n]$ をある周期系列の一周期とみなすので、「シフト」とは周長 $N$ の円のまわりで標本を回転させることを意味する:
Magnitude is untouched; only a linear phase ramp is added — exactly like the DTFT shift theorem, but with the shift interpreted modulo $N$. Samples pushed past $n = N-1$ wrap around to $n = 0$:振幅完全不受影響,只是加上一個線性的相位斜坡——這和 DTFT 的位移定理一模一樣,只是位移要對 $N$ 取模來解讀。被推過 $n = N-1$ 的樣本會繞回到 $n = 0$:振幅は手つかずで、加わるのは線形の位相の傾斜だけである —— DTFT のシフト定理とまったく同じだが、シフトを $N$ を法として解釈する点が異なる。$n = N-1$ の先へ押し出された標本は $n = 0$ へ巻き戻る:
Circular frequency shift / modulation(調變). The dual statement:循環頻率位移/調變。對偶的敘述是:円状周波数シフト/変調。双対な主張は次のとおり:
Circular time reversal(循環時間反轉). Reversal modulo $N$ keeps $x[0]$ in place and reverses the rest: $x[((-n))_N] = x[((N-n))_N]$, i.e. $\{x[0], x[N-1], x[N-2], \dots, x[1]\}$.循環時間反轉。對 $N$ 取模的反轉會讓 $x[0]$ 留在原位、其餘倒過來:$x[((-n))_N] = x[((N-n))_N]$,也就是 $\{x[0], x[N-1], x[N-2], \dots, x[1]\}$。円状時間反転。$N$ を法とする反転は $x[0]$ をその場に残し、残りを逆順にする。すなわち $x[((-n))_N] = x[((N-n))_N]$、つまり $\{x[0], x[N-1], x[N-2], \dots, x[1]\}$ である。
The rule is easier to see than to say. Pin the $N$ samples to a circle and the reversal becomes a single physical motion: the circle turned over about the diameter through $x[0]$. The sample sitting on that axis cannot go anywhere, which is exactly why $x[0]$ stays at $n=0$ while everything else runs backwards.這條規則用看的比用說的容易。把 $N$ 個樣本釘在圓上,反轉就變成一個實際的動作:沿著通過 $x[0]$ 的直徑把圓翻過來。坐在那條軸上的樣本哪裡也去不了,這正是 $x[0]$ 留在 $n=0$、其餘全部倒過來的原因。この規則は語るより見るほうが易しい。$N$ 個の標本を円上に留めれば、反転は一つの物理的な動作になる。$x[0]$ を通る直径を軸として、円をひっくり返すのである。その軸の上に乗っている標本はどこへも行けない。それこそが、$x[0]$ が $n=0$ に残り、ほかのすべてが逆順になる理由である。
$((-n))_N$ means $-n$ reduced modulo $N$ (mod $N$), so the result lands in $0,\dots,N-1$:$((-n))_N$ 代表 $-n$ 對 $N$ 取模(mod $N$),結果落在 $0,\dots,N-1$:$((-n))_N$ は $-n$ を $N$ で割った剰余(mod $N$)を表し、結果は $0,\dots,N-1$ に収まる:
| $n$ | $-n$ | $((-n))_5$ | $\tilde{x}[((-n))_5]$ |
|---|---|---|---|
| $0$ | $0$ | $0$ | $x[0]$ |
| $1$ | $-1$ | $4$ | $x[4]$ |
| $2$ | $-2$ | $3$ | $x[3]$ |
| $3$ | $-3$ | $2$ | $x[2]$ |
| $4$ | $-4$ | $1$ | $x[1]$ |
| $n$ | $-n$ | $((-n))_5$ | $\tilde{x}[((-n))_5]$ |
|---|---|---|---|
| $0$ | $0$ | $0$ | $x[0]$ |
| $1$ | $-1$ | $4$ | $x[4]$ |
| $2$ | $-2$ | $3$ | $x[3]$ |
| $3$ | $-3$ | $2$ | $x[2]$ |
| $4$ | $-4$ | $1$ | $x[1]$ |
| $n$ | $-n$ | $((-n))_5$ | $\tilde{x}[((-n))_5]$ |
|---|---|---|---|
| $0$ | $0$ | $0$ | $x[0]$ |
| $1$ | $-1$ | $4$ | $x[4]$ |
| $2$ | $-2$ | $3$ | $x[3]$ |
| $3$ | $-3$ | $2$ | $x[2]$ |
| $4$ | $-4$ | $1$ | $x[1]$ |
So所以したがって
$$\{x[0],\ x[1],\ x[2],\ x[3],\ x[4]\} \;\longrightarrow\; \{x[0],\ \underbrace{x[4],\ x[3],\ x[2],\ x[1]}_{\text{order reversed}}\}$$$$\{x[0],\ x[1],\ x[2],\ x[3],\ x[4]\} \;\longrightarrow\; \{x[0],\ \underbrace{x[4],\ x[3],\ x[2],\ x[1]}_{\text{順序倒過來}}\}$$$$\{x[0],\ x[1],\ x[2],\ x[3],\ x[4]\} \;\longrightarrow\; \{x[0],\ \underbrace{x[4],\ x[3],\ x[2],\ x[1]}_{\text{逆順になる}}\}$$
Upper plot, window $0 \sim 4$ (in cyan): $x[0]$ is very low, and after it $x[1] \to x[4]$ climbs steadily upwards.上圖視窗 $0 \sim 4$(青色):$x[0]$ 很低,接著 $x[1] \to x[4]$ 逐漸上升。上の図の窓 $0 \sim 4$(シアン):$x[0]$ はとても低く、続いて $x[1] \to x[4]$ がしだいに上昇する。
Lower plot, window $0 \sim 4$: $x[0]$ is still very low (it has not moved), and after it the curve starts from its highest point and falls away. That is exactly the order $x[4], x[3], x[2], x[1]$. Panels ① and ② of the interactive figure above are those same two pictures.下圖視窗 $0 \sim 4$:$x[0]$ 仍然很低(沒動),接著從最高點開始逐漸下降。這正是 $x[4], x[3], x[2], x[1]$ 的順序。上面互動圖的 ① 與 ② 就是這兩張圖。下の図の窓 $0 \sim 4$:$x[0]$ は依然としてとても低く(動いていない)、その後は最高点から出発してしだいに下降する。これがまさに $x[4], x[3], x[2], x[1]$ の順である。上のインタラクティブ図の ① と ② が、ちょうどこの二枚にあたる。
An ordinary reversal would give $\{x[4], x[3], x[2], x[1], x[0]\}$ — that is, even $x[0]$ is carried to the end.一般的「倒序」會得到 $\{x[4], x[3], x[2], x[1], x[0]\}$,也就是連 $x[0]$ 都移到最後。通常の「逆順」なら $\{x[4], x[3], x[2], x[1], x[0]\}$ となる。つまり $x[0]$ までもが最後へ移ってしまう。
Circular time reversal, however, mirrors the periodic sequence about the axis $n = 0$. After the mirroring, the positions $n = 1, 2, 3, \dots$ hold the values that originally sat at $n = -1, -2, -3, \dots$, which are $x[4], x[3], x[2], \dots$ from the previous period. Think of it this way: five samples are arranged on a circle with $x[0]$ at the top; turn the circle over about the diameter through $x[0]$, and $x[0]$ does not move while every other point swaps sides.但循環時間反轉是把週期序列以 $n = 0$ 為軸鏡射。鏡射之後,$n = 1, 2, 3, \dots$ 的位置看到的是原本在 $n = -1, -2, -3, \dots$ 的值,也就是上一個週期的 $x[4], x[3], x[2], \dots$。可以把它想成:5 個樣本排在一個圓上,$x[0]$ 在正上方;以通過 $x[0]$ 的直徑為軸翻面,$x[0]$ 不動,其他點左右對調。しかし円状時間反転は、周期系列を $n = 0$ を軸として鏡映するものである。鏡映したあと、$n = 1, 2, 3, \dots$ の位置に見えるのは、もともと $n = -1, -2, -3, \dots$ にあった値、すなわち一つ前の周期の $x[4], x[3], x[2], \dots$ である。次のように思えばよい。5 個の標本を円上に並べ、$x[0]$ を真上に置く。$x[0]$ を通る直径を軸として裏返すと、$x[0]$ は動かず、ほかの点は左右が入れ替わる。
Only this definition lets the DFT property hold:這樣定義才能讓 DFT 的性質成立:このように定義してはじめて、DFT の性質が成り立つ:
$$x[((-n))_N] \;\overset{\text{DFT}}{\longleftrightarrow}\; X[((-k))_N]$$
If $x[n]$ is a real sequence there is also $X[((-k))_N] = X^{*}[k]$. The definition of circular convolution uses this reversal too: the $h[((-m))_N]$ sitting inside $\sum_m x[m]\,h[((n-m))_N]$ is exactly a circular time reversal.若 $x[n]$ 是實數序列,還有 $X[((-k))_N] = X^{*}[k]$。循環摺積的定義中也會用到這種反轉:$\sum_m x[m]\,h[((n-m))_N]$ 裡的 $h[((-m))_N]$ 就是循環時間反轉。$x[n]$ が実数系列であれば、さらに $X[((-k))_N] = X^{*}[k]$ も成り立つ。円状畳み込みの定義にも、この反転は用いられる。$\sum_m x[m]\,h[((n-m))_N]$ の中にある $h[((-m))_N]$ こそが、円状時間反転にほかならない。
Changing $N$ changes nothing about the rule: whatever $N$ is, $x[0]$ is fixed and the other $N-1$ samples are reversed. That is the entire content of $x[((-n))_N]$, and the transform pair below says the same thing on the frequency side — reversing the time index reverses the frequency index, in exactly the same circular sense.改變 $N$ 也一樣:不論 $N$ 是多少,$x[0]$ 永遠固定,其餘 $N-1$ 個樣本倒序。這就是 $x[((-n))_N]$ 的全部內容,而下面的變換對在頻率那一側說的是同一件事——把時間索引反轉,頻率索引也以完全相同的循環方式反轉。$N$ を変えても規則は変わらない。$N$ がいくつであろうと、$x[0]$ はつねに固定され、残り $N-1$ 個の標本が逆順になる。これが $x[((-n))_N]$ の内容のすべてであり、下の変換対は同じことを周波数の側で述べている。時間の索引を反転させれば、周波数の索引もまったく同じ円状の意味で反転するのである。
In the figure below, $((-n))_N$ is the same notation used above: $-n$ reduced modulo $N$. The three axes are the index ($n$ or $k$), the real part Re and the imaginary part Im, and each stem is one complex sample. Drag to rotate, scroll to zoom, and the buttons along the top run the animations.下面這張圖中的 $((-n))_N$ 就是前面用的那個記號:$-n$ 對 $N$ 取模。三個軸分別是索引($n$ 或 $k$)、實部 Re 和虛部 Im,每根桿子是一個複數樣本。可以拖曳旋轉、滾輪縮放,按上方按鈕觀看動畫。下の図の $((-n))_N$ は、これまでと同じ記号である。すなわち $-n$ を $N$ で割った剰余である。三つの軸はそれぞれ索引($n$ または $k$)、実部 Re、虚部 Im であり、各々の棒が一つの複素標本を表す。ドラッグで回転、ホイールで拡大縮小ができ、上のボタンを押せばアニメーションが動く。
What the figure shows: the two sides do exactly the same thing. Index 0 does not move; every other stem goes to position $((-n))_N$ ($1 \leftrightarrow N-1$, $2 \leftrightarrow N-2$, and so on), and the stem itself keeps both its length and its direction. In other words, a circular time reversal in the time domain is a circular time reversal in the frequency domain too.圖中看到的:左右兩邊做完全相同的動作。索引 0 不動,其他桿子換到 $((-n))_N$ 的位置($1 \leftrightarrow N-1$、$2 \leftrightarrow N-2$……),桿子本身的長度與方向都不變。也就是說,時域做循環時間反轉,頻域也做循環時間反轉。図中に見えるもの:左右はまったく同じ動作をする。索引 0 は動かず、ほかの棒は $((-n))_N$ の位置へ移り($1 \leftrightarrow N-1$、$2 \leftrightarrow N-2$……)、棒そのものの長さも向きも変わらない。すなわち、時間領域で円状時間反転を行えば、周波数領域でも円状時間反転が起こる。
Derivation: put $y[n] = x[((-n))_N]$ and let $m = ((-n))_N$. As $n$ runs over $0 \sim N-1$ so does $m$, and $W_N^{kn} = W_N^{-km}$ because $W_N$ has period $N$. Hence推導:令 $y[n] = x[((-n))_N]$,並令 $m = ((-n))_N$。當 $n$ 跑遍 $0 \sim N-1$ 時,$m$ 也跑遍 $0 \sim N-1$,而且 $W_N^{kn} = W_N^{-km}$,因為 $W_N$ 以 $N$ 為週期。所以導出:$y[n] = x[((-n))_N]$ とおき、$m = ((-n))_N$ とする。$n$ が $0 \sim N-1$ を動けば $m$ も $0 \sim N-1$ を動き、しかも $W_N$ は周期 $N$ をもつので $W_N^{kn} = W_N^{-km}$ である。したがって
$$Y[k] = \sum_n x[((-n))_N]\,W_N^{kn} = \sum_m x[m]\,W_N^{(-k)m} = X[((-k))_N]$$
What the figure shows:圖中看到的:図中に見えるもの:
So conjugating in the time domain costs more than a conjugation in the frequency domain: an index reversal comes with it.所以時域取共軛,在頻域不只取共軛,還要加上索引反轉。したがって時間領域で共役をとると、周波数領域では共役をとるだけでは済まず、索引の反転まで伴う。
Derivation: conjugation turns $W_N^{kn}$ into $W_N^{-kn}$:推導:共軛會把 $W_N^{kn}$ 變成 $W_N^{-kn}$:導出:共役は $W_N^{kn}$ を $W_N^{-kn}$ に変える:
$$\sum_n x^{*}[n]\,W_N^{kn} = \Big(\sum_n x[n]\,W_N^{-kn}\Big)^{*} = \Big(X[((-k))_N]\Big)^{*}$$
The $W_N^{-kn}$ inside the brackets is where the index reversal $k \to -k$ comes from.括號裡的 $W_N^{-kn}$ 就是索引反轉 $k \to -k$ 的來源。括弧の中の $W_N^{-kn}$ こそが、索引の反転 $k \to -k$ の出どころである。
Every time the mode is switched, the widget really does run a DFT of the left-hand sequence and compares it with the result drawn on the right. The largest error comes out at around $10^{-15}$ — floating-point rounding and nothing else, which is to say the two properties hold exactly.每切換一種模式,程式都會對左邊的序列真的算一次 DFT,再和右邊畫出的結果比較。最大誤差約為 $10^{-15}$,也就是只有浮點數捨入誤差,代表這兩個性質完全成立。モードを切り替えるたびに、このウィジェットは左の系列に対して実際に DFT を一度計算し、右に描かれた結果と比べている。最大誤差はおよそ $10^{-15}$ であり、浮動小数点の丸め誤差にすぎない。つまりこの二つの性質は厳密に成り立っている。
If $x[n]$ is real then $x^{*}[n] = x[n]$. Substituting that into property ② gives若 $x[n]$ 是實數,則 $x^{*}[n] = x[n]$。代入性質 ② 得到$x[n]$ が実数であれば $x^{*}[n] = x[n]$ である。これを性質 ② に代入すると
$$X[k] = X^{*}[((-k))_N]$$
that is, $X[N-k] = X^{*}[k]$, which is called conjugate symmetry. It is the reason the FFT of a real signal only needs its first half of the frequency points to be looked at. In the sampled-cosine interactive figure of §8.2.3 the two spikes stand at $k = r$ and $k = N - r$ (the figure writes that $r$ as $k_0$) and are the same height — exactly this property at work.也就是 $X[N-k] = X^{*}[k]$,稱為共軛對稱。這就是為什麼實數訊號的 FFT 只需要看前一半的頻率點。§8.2.3 那張取樣餘弦的互動圖中,兩根尖峰出現在 $k = r$ 和 $k = N - r$(圖中把這個 $r$ 寫成 $k_0$),而且大小相同,正是這個性質的結果。すなわち $X[N-k] = X^{*}[k]$ であり、これを共役対称性と呼ぶ。実数信号の FFT が周波数点の前半だけを見ればよいのは、このためである。§8.2.3 にある標本化した余弦の対話図では、二本の尖りが $k = r$ と $k = N - r$ に立ち(図ではこの $r$ を $k_0$ と書いている)、しかも高さが等しい。これこそがこの性質の現れである。
Conjugate symmetry for real signals(實數訊號的共軛對稱). Combining the two: if $x[n]$ is real, then實數訊號的共軛對稱。把上面兩者合起來:若 $x[n]$ 為實數,則実数信号の共役対称性。上の二つを組み合わせると、$x[n]$ が実数のとき次が成り立つ:
So a real $N$-point signal has only about $N/2$ independent spectral values: bins $k$ and $N-k$ are mirror images. $X[0]$ is always real, and for even $N$ so is $X[N/2]$.所以一個實數的 $N$ 點訊號,其實只有大約 $N/2$ 個獨立的頻譜值:第 $k$ 格與第 $N-k$ 格互為鏡像。$X[0]$ 恆為實數,而當 $N$ 為偶數時 $X[N/2]$ 也是。したがって実数の $N$ 点信号は、独立なスペクトル値をおよそ $N/2$ 個しかもたない。ビン $k$ とビン $N-k$ は互いに鏡像である。$X[0]$ はつねに実数であり、$N$ が偶数なら $X[N/2]$ も実数である。
Duality(對偶性). The DFT and IDFT have nearly the same form, so transforming twice almost returns the signal:對偶性。DFT 與 IDFT 的形式幾乎相同,所以連做兩次變換就幾乎回到原訊號:双対性。DFT と IDFT はほとんど同じ形をしているので、二度変換すればほぼ元の信号に戻る:
Put the two definitions side by side:把兩個公式並排:二つの式を並べてみよう:
$$\text{DFT:}\quad G[k] = \sum_{n=0}^{N-1} g[n]\,W_N^{kn} \qquad\qquad \text{IDFT:}\quad g[n] = \frac{1}{N}\sum_{k=0}^{N-1} G[k]\,W_N^{-kn}$$
Both turn one length-$N$ vector into another length-$N$ vector, and there are only two differences between them:兩者都是把一個長度 $N$ 的向量變成另一個長度 $N$ 的向量,而且只有兩個差別:どちらも長さ $N$ のベクトルを長さ $N$ のベクトルに変えるものであり、両者の違いは二つしかない:
The difference in sign is where the circular time reversal comes from; the difference in the factor is where the $N$ comes from. Circular time reversal and the $((-n))_N$ notation are exactly the subject of §8.4.2 just above, figures included, so nothing new has to be said about them here.正負號的差別就是循環時間反轉的來源,倍數的差別就是 $N$ 的來源。循環時間反轉與 $((-n))_N$ 這個記號正是上面 §8.4.2 的主題(連圖都有),所以這裡不必再重講一次。符号の違いが円状時間反転の出どころであり、係数の違いが $N$ の出どころである。円状時間反転と $((-n))_N$ という記法は、すぐ上の §8.4.2 がまさに図つきで扱った主題なので、ここで改めて述べる必要はない。
Treat $G[\cdot]$ as a time sequence $G[n]$ and take its DFT:把 $G[\cdot]$ 當成時間序列 $G[n]$,對它做 DFT:$G[\cdot]$ を時間系列 $G[n]$ とみなし、その DFT をとる:
$$\text{DFT}\{G\}[k] = \sum_{n=0}^{N-1} G[n]\,W_N^{kn}$$
Now compare that with the IDFT. The value of the IDFT at time $m$ is和 IDFT 比較。IDFT 在時間點 $m$ 的值是これを IDFT と比べる。IDFT の時間 $m$ における値は
$$g[m] = \frac{1}{N}\sum_{n=0}^{N-1} G[n]\,W_N^{-mn}$$
Set $m = ((-k))_N$. Then $W_N^{-mn} = W_N^{kn}$, because the twiddle factor $W_N$ has period $N$, and therefore令 $m = ((-k))_N$,則 $W_N^{-mn} = W_N^{kn}$(旋轉因子 $W_N$ 以 $N$ 為週期),所以$m = ((-k))_N$ とおく。回転因子 $W_N$ は周期 $N$ をもつので $W_N^{-mn} = W_N^{kn}$ となり、したがって
$$g[((-k))_N] = \frac{1}{N}\sum_{n} G[n]\,W_N^{kn} = \frac{1}{N}\,\text{DFT}\{G\}[k]$$
Moving the $\frac{1}{N}$ across gives precisely the statement already boxed above:移項即得上面方框裡的結果:係数を移項すれば、上の囲みに掲げた結果がそのまま得られる:
$$G[n] \;\longleftrightarrow\; N \cdot g[((-k))_N]$$
Example: $\delta[n] \leftrightarrow 1$ (all $k$), and dually the all-ones sequence $\leftrightarrow N\delta[k]$ — exactly Examples 8-1(a) and (b).例子:$\delta[n] \leftrightarrow 1$(所有 $k$),對偶地,全為 1 的序列 $\leftrightarrow N\delta[k]$——正好就是範例 8-1 的 (a) 與 (b)。例:$\delta[n] \leftrightarrow 1$(すべての $k$ について)であり、双対的に、全要素が 1 の系列は $\leftrightarrow N\delta[k]$ となる —— これはまさに例 8-1 の (a) と (b) である。
Said again in the language of duality: $g[n] = \delta[n]$ gives $G[k] = 1$ for every $k$, so duality demands that the all-ones sequence transform to $N\cdot\delta[((-k))_N] = N\,\delta[k]$ — an impulse already sitting at index $0$ is left where it is by a circular reversal. Computing it directly, $\sum_n 1\cdot W_N^{kn}$ is $N$ at $k = 0$ and $0$ for every other $k$: the rotating-vector sum of §8.2.2. The two answers agree.用對偶性的語言再講一次:$g[n] = \delta[n]$ 時 $G[k] = 1$(全為 1),所以依對偶性,全為 1 的序列做 DFT 應該得到 $N\cdot\delta[((-k))_N] = N\,\delta[k]$——本來就坐在索引 $0$ 的脈衝,循環反轉之後還是留在原位。直接計算:$\sum_n 1\cdot W_N^{kn}$ 在 $k = 0$ 時為 $N$,其他 $k$ 為 $0$,就是 §8.2.2 的那個旋轉向量和。兩邊結果一致。双対性の言葉で言い直そう。$g[n] = \delta[n]$ なら $G[k] = 1$(すべて 1)であるから、双対性によれば全要素が 1 の系列の DFT は $N\cdot\delta[((-k))_N] = N\,\delta[k]$ でなければならない —— もともと索引 $0$ に乗っているインパルスは、円状反転を受けてもその場に残るからである。直接計算すると、$\sum_n 1\cdot W_N^{kn}$ は $k = 0$ で $N$、ほかのすべての $k$ で $0$ である。§8.2.2 の回転ベクトルの和そのものである。両者は一致する。
Example 1 is a case where the reversal has nothing to move, so take $N = 4$ and $g[n] = \delta[n-1] = \{0, 1, 0, 0\}$ instead.例 1 裡反轉沒有東西可以搬,所以改取 $N = 4$,$g[n] = \delta[n-1] = \{0, 1, 0, 0\}$。例 1 では反転が動かすものを持たない。そこで $N = 4$、$g[n] = \delta[n-1] = \{0, 1, 0, 0\}$ をとってみる。
The impulse started at position $1$ and, after two DFTs, has arrived at position $3$. That is the circular time reversal ($1 \leftrightarrow N-1$) made visible.脈衝原本在位置 $1$,做兩次 DFT 後跑到位置 $3$,這就是循環時間反轉($1 \leftrightarrow N-1$)看得見的樣子。インパルスはもともと位置 $1$ にあり、DFT を二度かけたあとは位置 $3$ に着いている。これが円状時間反転($1 \leftrightarrow N-1$)の目に見える形である。
If the DFT and the IDFT were exactly symmetric, transforming twice would hand back the sequence unchanged. Two things stand in the way:如果 DFT 和 IDFT 完全對稱,做兩次 DFT 應該回到原序列。實際上差了兩樣東西:DFT と IDFT が完全に対称であったなら、二度変換すれば系列はそのまま戻ってくるはずである。実際には二つのものが立ちはだかる:
Hence the word almost. Carrying the idea further:這就是「幾乎」兩個字的由來。延伸來看:ゆえに「ほぼ」なのである。この考えをさらに延長すると:
It takes four transforms to return to the original sequence (up to the factor $N^2$), because the second circular reversal cancels the first.做四次 DFT 才會回到原序列(差一個倍數 $N^2$),因為兩次循環反轉會互相抵消。元の系列へ戻るには DFT を四度かける必要がある(係数 $N^2$ を除いて)。二度目の円状反転が一度目を打ち消すからである。
1. Computing an IDFT with a forward-only FFT. When only a forward transform is on hand, it can be computed like this:1. 用 DFT 程式算 IDFT。只有正向 FFT 時,可以這樣算:1. 順方向の FFT だけで IDFT を計算する。順方向の変換しか手元にないときは、次のように計算できる:
$$\text{IDFT}\{X\}[n] = \frac{1}{N}\,\text{DFT}\{X\}[((-n))_N]$$
That is: transform, then circularly reverse the result and divide by $N$. Another common way of writing it is $\text{IDFT}\{X\} = \frac{1}{N}\big(\text{DFT}\{X^{*}\}\big)^{*}$, which rests on the same principle — conjugation flips the sign of the exponent, which is the one difference between the two formulas.也就是先做 DFT,再把結果循環反轉並除以 $N$。另一種常見寫法是 $\text{IDFT}\{X\} = \frac{1}{N}\big(\text{DFT}\{X^{*}\}\big)^{*}$,原理相同——取共軛會把指數的正負號翻過來,而那正是兩個公式唯一的差別。すなわち、まず DFT をかけ、その結果を円状反転して $N$ で割ればよい。もう一つのよく使われる書き方は $\text{IDFT}\{X\} = \frac{1}{N}\big(\text{DFT}\{X^{*}\}\big)^{*}$ であり、原理は同じである —— 共役は指数の符号を反転させるが、それこそが二つの式の唯一の違いだからである。
2. Deriving new transform pairs from known ones. Given the pair “rectangular sequence $\longleftrightarrow$ periodic sinc” of §8.2.4, duality hands over “periodic sinc sequence $\longleftrightarrow$ rectangular sequence” at once — multiplied by $N$ and circularly reversed. This is the same idea as duality for the continuous-time Fourier transform, where rect $\longleftrightarrow$ sinc works in both directions.2. 由已知的轉換對推出新的轉換對。例如已知 §8.2.4 的「矩形序列 $\longleftrightarrow$ 週期性 sinc」,立刻就知道「週期性 sinc 序列 $\longleftrightarrow$ 矩形序列」(乘上 $N$ 並循環反轉)。這和連續時間傅立葉轉換的對偶性(rect $\longleftrightarrow$ sinc)是同一個概念。2. 既知の変換対から新しい変換対を導く。たとえば §8.2.4 の「矩形系列 $\longleftrightarrow$ 周期 sinc」という対が分かっていれば、「周期 sinc 系列 $\longleftrightarrow$ 矩形系列」($N$ 倍して円状反転したもの)が直ちに得られる。これは連続時間フーリエ変換の双対性(rect $\longleftrightarrow$ sinc)と同じ考えである。
Parseval's relation(能量守恆). Direct consequence of $\frac{1}{\sqrt N}\mathbf{W}_N$ being unitary:Parseval 關係(能量守恆)。這是 $\frac{1}{\sqrt N}\mathbf{W}_N$ 為么正矩陣的直接結果:Parseval の関係(エネルギー保存)。$\frac{1}{\sqrt N}\mathbf{W}_N$ がユニタリであることの直接の帰結である:
Parseval's theorem says that the total energy of a signal comes out the same whether it is computed in the time domain or in the frequency domain — the DFT version carrying one extra $\frac{1}{N}$. The boxed statement above, with both sides named:Parseval 定理說的是:訊號的總能量,在時域算和在頻域算,結果相同(DFT 版本多一個 $\frac{1}{N}$)。把上面方框裡的敘述兩邊都標上名字:Parseval の定理が述べているのは、信号の総エネルギーは、時間領域で計算しても周波数領域で計算しても同じ値になるということである(DFT 版には $\frac{1}{N}$ が一つ余分に付く)。上の囲みの主張を、両辺に名前を付けて書き直そう:
$$\underbrace{\sum_{n=0}^{N-1} |x[n]|^2}_{\text{energy in the time domain}} = \frac{1}{N}\underbrace{\sum_{k=0}^{N-1} |X[k]|^2}_{\text{energy in the frequency domain}}$$$$\underbrace{\sum_{n=0}^{N-1} |x[n]|^2}_{\text{時域能量}} = \frac{1}{N}\underbrace{\sum_{k=0}^{N-1} |X[k]|^2}_{\text{頻域能量}}$$$$\underbrace{\sum_{n=0}^{N-1} |x[n]|^2}_{\text{時間領域のエネルギー}} = \frac{1}{N}\underbrace{\sum_{k=0}^{N-1} |X[k]|^2}_{\text{周波数領域のエネルギー}}$$
| Symbol | Meaning |
|---|---|
| $\lvert x[n]\rvert^2$ | The energy of sample $n$ (for a complex signal, $x[n]\,x^{*}[n]$) |
| $\lvert X[k]\rvert^2$ | The energy of frequency component $k$ |
| $\frac{1}{N}$ | A correction factor, inherited from the way the DFT is defined (see below) |
| 符號 | 意義 |
|---|---|
| $\lvert x[n]\rvert^2$ | 第 $n$ 個樣本的能量(複數時為 $x[n]\,x^{*}[n]$) |
| $\lvert X[k]\rvert^2$ | 第 $k$ 個頻率成分的能量 |
| $\frac{1}{N}$ | 修正因子,來自 DFT 的定義方式(見下文) |
| 記号 | 意味 |
|---|---|
| $\lvert x[n]\rvert^2$ | 第 $n$ 標本のエネルギー(複素数のときは $x[n]\,x^{*}[n]$) |
| $\lvert X[k]\rvert^2$ | 第 $k$ 周波数成分のエネルギー |
| $\frac{1}{N}$ | 補正係数。DFT の定義の仕方に由来する(下記参照) |
Write $|x[n]|^2$ as $x[n]\,x^{*}[n]$, then expand the $x^{*}[n]$ inside it with the IDFT of §8.2.2:把 $|x[n]|^2$ 寫成 $x[n]\,x^{*}[n]$,再用 §8.2.2 的 IDFT 展開其中的 $x^{*}[n]$:$|x[n]|^2$ を $x[n]\,x^{*}[n]$ と書き、その中の $x^{*}[n]$ を §8.2.2 の IDFT で展開する:
$$x^{*}[n] = \Big(\frac{1}{N}\sum_k X[k]\,W_N^{-kn}\Big)^{*} = \frac{1}{N}\sum_k X^{*}[k]\,W_N^{kn}$$
Substitute that in and swap the order of summation:代入並交換求和順序:これを代入し、和の順序を入れ替える:
$$\sum_n |x[n]|^2 = \sum_n x[n]\cdot\frac{1}{N}\sum_k X^{*}[k]\,W_N^{kn} = \frac{1}{N}\sum_k X^{*}[k]\underbrace{\sum_n x[n]\,W_N^{kn}}_{=\,X[k]} = \frac{1}{N}\sum_k |X[k]|^2$$
The inner sum is exactly the definition of the DFT, which is why the proof needs only one step.內層的和正好就是 DFT 的定義,所以證明只需要一步。内側の和はちょうど DFT の定義そのものであり、だからこそ証明は一歩で済む。
Take $x = \{1, 1, 0, 0\}$; its time-domain energy is $1^2 + 1^2 = 2$.取 $x = \{1, 1, 0, 0\}$,時域能量 $= 1^2 + 1^2 = 2$。$x = \{1, 1, 0, 0\}$ をとると、時間領域のエネルギーは $1^2 + 1^2 = 2$ である。
Its DFT is $X[k] = 1 + W_4^{k}$, where $W_4 = -j$:DFT 為 $X[k] = 1 + W_4^{k}$,其中 $W_4 = -j$:DFT は $X[k] = 1 + W_4^{k}$ である。ここで $W_4 = -j$:
| $k$ | $X[k]$ | $\lvert X[k]\rvert^2$ |
|---|---|---|
| 0 | $1 + 1 = 2$ | 4 |
| 1 | $1 - j$ | 2 |
| 2 | $1 - 1 = 0$ | 0 |
| 3 | $1 + j$ | 2 |
| $k$ | $X[k]$ | $\lvert X[k]\rvert^2$ |
|---|---|---|
| 0 | $1 + 1 = 2$ | 4 |
| 1 | $1 - j$ | 2 |
| 2 | $1 - 1 = 0$ | 0 |
| 3 | $1 + j$ | 2 |
| $k$ | $X[k]$ | $\lvert X[k]\rvert^2$ |
|---|---|---|
| 0 | $1 + 1 = 2$ | 4 |
| 1 | $1 - j$ | 2 |
| 2 | $1 - 1 = 0$ | 0 |
| 3 | $1 + j$ | 2 |
The frequency-domain sum is $8$; multiplying by $\frac{1}{4}$ gives $2$, which is the time-domain energy. ✓頻域總和 $= 8$,乘上 $\frac{1}{4}$ 得 $2$,與時域能量相同。✓周波数領域の総和は $8$ であり、$\frac{1}{4}$ を掛けると $2$ となって、時間領域のエネルギーと一致する。✓
The definition $X[k] = \sum_n x[n]\,W_N^{kn}$ carries no scaling at all, so $X[k]$ comes out roughly $N$ times the size of $x[n]$. For the all-ones sequence, for instance, $X[0] = N$.DFT 的定義 $X[k] = \sum_n x[n]\,W_N^{kn}$ 沒有任何縮放,所以 $X[k]$ 的大小大約是 $x[n]$ 的 $N$ 倍量級。例如全為 1 的序列,$X[0] = N$。DFT の定義 $X[k] = \sum_n x[n]\,W_N^{kn}$ には縮尺がいっさい入っていないので、$X[k]$ の大きさはおおよそ $x[n]$ の $N$ 倍の程度になる。たとえば全要素が 1 の系列では $X[0] = N$ である。
Geometrically, the DFT expands the signal over $N$ mutually orthogonal basis vectors $W_N^{-kn}$ — the “rotating-vector sum $= N$ or $0$” result of §8.2.2. Each basis vector has squared length $N$ rather than $1$, so the energy comes out inflated by $N$ and has to be divided back down. That is the same fact as the unitarity quoted above, seen from the side of the basis vectors: the rows of $\mathbf{W}_N$ are orthogonal with squared norm $N$ (§8.3.2), so $\mathbf{W}_N$ is exactly $\sqrt{N}$ times a unitary matrix — which is why $\frac{1}{\sqrt N}\mathbf{W}_N$, and not $\mathbf{W}_N$ itself, is the length-preserving one.從幾何角度看,DFT 是用 $N$ 個彼此正交的基底向量 $W_N^{-kn}$ 展開訊號——也就是 §8.2.2 那個「旋轉向量和 $= N$ 或 $0$」的結果。每個基底向量的長度平方是 $N$ 而不是 1,所以能量被放大了 $N$ 倍,要除回來。這和上面引用的么正性其實是同一件事,只是從基底向量那一側看:$\mathbf{W}_N$ 的各列互相正交、範數平方為 $N$(§8.3.2),所以 $\mathbf{W}_N$ 恰好是某個么正矩陣的 $\sqrt{N}$ 倍——這就是為什麼保長度的是 $\frac{1}{\sqrt N}\mathbf{W}_N$,而不是 $\mathbf{W}_N$ 本身。幾何的に見れば、DFT は互いに直交する $N$ 本の基底ベクトル $W_N^{-kn}$ で信号を展開する操作である —— §8.2.2 の「回転ベクトルの和は $N$ か $0$」という結果そのものである。各基底ベクトルの長さの二乗は 1 ではなく $N$ なので、エネルギーは $N$ 倍に膨らむ。だから割り戻さねばならない。これは上で引いたユニタリ性と同じ事実を、基底ベクトルの側から眺めたものである。$\mathbf{W}_N$ の各行は互いに直交し、ノルムの二乗は $N$ である(§8.3.2)。つまり $\mathbf{W}_N$ はちょうどユニタリ行列の $\sqrt{N}$ 倍であり、長さを保つのが $\mathbf{W}_N$ 自身ではなく $\frac{1}{\sqrt N}\mathbf{W}_N$ であるのはそのためである。
Switch to the normalized DFT instead — a $\frac{1}{\sqrt{N}}$ in front of both the forward and the inverse transform — and the basis vectors have length $1$, the transform becomes a length-preserving rotation (unitary), and Parseval loses its coefficient entirely: $\sum|x|^2 = \sum|X|^2$.如果改用正規化 DFT,即正轉換和反轉換都乘上 $\frac{1}{\sqrt{N}}$,基底向量長度變成 1,轉換就是一個保長度的旋轉(unitary),此時 Parseval 變成沒有係數的 $\sum|x|^2 = \sum|X|^2$。代わりに正規化 DFT、すなわち順変換と逆変換の双方に $\frac{1}{\sqrt{N}}$ を掛けたものを使えば、基底ベクトルの長さは 1 になり、変換は長さを保つ回転(ユニタリ)そのものになる。このとき Parseval は係数のない $\sum|x|^2 = \sum|X|^2$ という形になる。
It holds for two sequences as well — the second half of the box above:對兩個序列也成立,就是上面方框裡的第二式:二つの系列についても成り立つ —— 上の囲みの第二式がそれである:
$$\sum_{n} x[n]\,y^{*}[n] = \frac{1}{N}\sum_{k} X[k]\,Y^{*}[k]$$
That is: the inner product in the time domain equals the inner product in the frequency domain, up to the $\frac{1}{N}$. Setting $y = x$ brings back the Parseval relation above.也就是時域的內積等於頻域的內積(差 $\frac{1}{N}$)。令 $y = x$ 就回到上面的 Parseval。つまり、時間領域の内積は $\frac{1}{N}$ の差を除いて周波数領域の内積に等しい。$y = x$ とおけば上の Parseval に戻る。
| Property | Time domain | Frequency domain |
|---|---|---|
| Linearity | $a x_1[n] + b x_2[n]$ | $a X_1[k] + b X_2[k]$ |
| Circular time shift | $x[((n-m))_N]$ | $W_N^{km} X[k]$ |
| Circular frequency shift | $W_N^{-ln} x[n]$ | $X[((k-l))_N]$ |
| Circular time reversal | $x[((-n))_N]$ | $X[((-k))_N]$ |
| Conjugation | $x^{*}[n]$ | $X^{*}[((-k))_N]$ |
| Duality | $X[n]$ | $N\,x[((-k))_N]$ |
| Circular convolution | $x_1[n] \circledast x_2[n]$ | $X_1[k]\, X_2[k]$ |
| Multiplication | $x_1[n]\, x_2[n]$ | $\tfrac{1}{N}\, X_1[k] \circledast X_2[k]$ |
| Conjugate symmetry (real $x$) | $x[n]$ real | $X[k] = X^{*}[N-k]$ |
| Parseval | $\sum_n |x[n]|^2$ | $= \tfrac{1}{N}\sum_k |X[k]|^2$ |
| 性質 | 時域 | 頻域 |
|---|---|---|
| 線性 | $a x_1[n] + b x_2[n]$ | $a X_1[k] + b X_2[k]$ |
| 循環時間位移 | $x[((n-m))_N]$ | $W_N^{km} X[k]$ |
| 循環頻率位移 | $W_N^{-ln} x[n]$ | $X[((k-l))_N]$ |
| 循環時間反轉 | $x[((-n))_N]$ | $X[((-k))_N]$ |
| 取共軛 | $x^{*}[n]$ | $X^{*}[((-k))_N]$ |
| 對偶性 | $X[n]$ | $N\,x[((-k))_N]$ |
| 循環摺積 | $x_1[n] \circledast x_2[n]$ | $X_1[k]\, X_2[k]$ |
| 相乘 | $x_1[n]\, x_2[n]$ | $\tfrac{1}{N}\, X_1[k] \circledast X_2[k]$ |
| 共軛對稱($x$ 為實數) | $x[n]$ 為實數 | $X[k] = X^{*}[N-k]$ |
| Parseval | $\sum_n |x[n]|^2$ | $= \tfrac{1}{N}\sum_k |X[k]|^2$ |
| 性質 | 時間領域 | 周波数領域 |
|---|---|---|
| 線形性 | $a x_1[n] + b x_2[n]$ | $a X_1[k] + b X_2[k]$ |
| 円状時間シフト | $x[((n-m))_N]$ | $W_N^{km} X[k]$ |
| 円状周波数シフト | $W_N^{-ln} x[n]$ | $X[((k-l))_N]$ |
| 円状時間反転 | $x[((-n))_N]$ | $X[((-k))_N]$ |
| 共役 | $x^{*}[n]$ | $X^{*}[((-k))_N]$ |
| 双対性 | $X[n]$ | $N\,x[((-k))_N]$ |
| 円状畳み込み | $x_1[n] \circledast x_2[n]$ | $X_1[k]\, X_2[k]$ |
| 乗算 | $x_1[n]\, x_2[n]$ | $\tfrac{1}{N}\, X_1[k] \circledast X_2[k]$ |
| 共役対称性($x$ が実数) | $x[n]$ が実数 | $X[k] = X^{*}[N-k]$ |
| Parseval | $\sum_n |x[n]|^2$ | $= \tfrac{1}{N}\sum_k |X[k]|^2$ |
§8.1.3 sampled the DTFT of a sequence that was short enough: $L \le N$, so nothing was lost. Nothing stops you sampling the DTFT of a longer sequence, though — the formula $X[k] = X(e^{j\omega})\big|_{\omega = 2\pi k/N}$ still produces $N$ perfectly good numbers. Taking their $N$-point IDFT gives an $N$-point sequence $\tilde{x}[n]$. The question this section answers is the obvious one:§8.1.3 對 DTFT 取樣時,序列是夠短的:$L \le N$,所以什麼都沒損失。但沒有什麼能阻止你去對一個更長序列的 DTFT 取樣——公式 $X[k] = X(e^{j\omega})\big|_{\omega = 2\pi k/N}$ 照樣會給出 $N$ 個完全合法的數。再對它們取 $N$ 點 IDFT,就得到一個 $N$ 點的序列 $\tilde{x}[n]$。本節要回答的,就是那個最自然的問題:§8.1.3 で DTFT を標本化したときは、系列が十分に短かった。$L \le N$ だったので何も失われなかった。しかし、もっと長い系列の DTFT を標本化してはいけない理由はどこにもない。公式 $X[k] = X(e^{j\omega})\big|_{\omega = 2\pi k/N}$ は相変わらず $N$ 個のまっとうな数を返す。それらの $N$ 点 IDFT をとれば、$N$ 点の系列 $\tilde{x}[n]$ が得られる。本節が答えるのは、ごく自然な次の問いである:
It cannot simply be $x[n]$: $x$ has $L > N$ values and $\tilde{x}$ has only $N$. Information has to go somewhere. The answer — derived below — is that the surplus does not get thrown away, it gets folded back onto the first $N$ samples.它不可能就等於 $x[n]$:$x$ 有 $L > N$ 個值,而 $\tilde{x}$ 只有 $N$ 個。資訊總得去某個地方。答案(下面會推導)是:多出來的部分並沒有被丟掉,而是被摺疊回前 $N$ 個樣本上。それが単に $x[n]$ そのものであるはずはない。$x$ は $L > N$ 個の値をもち、$\tilde{x}$ は $N$ 個しかもたない。情報はどこかへ行かねばならない。答えは —— 以下で導くように —— 余りは捨てられるのではなく、最初の $N$ 標本の上へ折り返される、というものである。
Pin the notation down first. The sequence is allowed to be two-sided here: it is nonzero on $-A \le n < B$, so its length is $L = A+B$, and nothing obliges $L$ to be smaller than $N$.先把符號定下來。這裡允許序列是雙邊的:它在 $-A \le n < B$ 範圍內非零,所以長度是 $L = A+B$,而且沒有任何東西逼著 $L$ 一定要小於 $N$。まず記号を決めておく。ここでは系列が両側であってよい。$-A \le n < B$ の範囲で非零であり、長さは $L = A+B$ となる。$L$ が $N$ より小さくなければならない理由はどこにもない。
| Symbol | Meaning |
|---|---|
| $x[n]$ | the original sequence, nonzero on $-A \le n < B$; its length $L = A+B$ may exceed $N$ |
| $X(e^{j\omega})$ | its DTFT, a continuous function of $\omega$ |
| $X[k]$ | the $N$ samples of that DTFT: $X[k] = X(e^{j2\pi k/N})$, $k = 0,\dots,N-1$ |
| $\tilde{x}[n]$ | what the $N$-point IDFT of those samples returns, on $0 \le n < N$ |
| $\ell$ | the dummy time index inside the DTFT sum; it runs over every integer |
| $r$ | an integer — how many whole periods $N$ a sample has been shifted by |
| $W_N$ | $e^{-j2\pi/N}$, as before |
| 符號 | 意義 |
|---|---|
| $x[n]$ | 原始序列,在 $-A \le n < B$ 範圍內非零;長度 $L = A+B$ 可能大於 $N$ |
| $X(e^{j\omega})$ | 它的 DTFT,是 $\omega$ 的連續函數 |
| $X[k]$ | DTFT 的 $N$ 個取樣:$X[k] = X(e^{j2\pi k/N})$,$k = 0,\dots,N-1$ |
| $\tilde{x}[n]$ | 對這 $N$ 個取樣做 $N$ 點 IDFT 所得到的結果,$0 \le n < N$ |
| $\ell$ | DTFT 求和中的虛擬時間索引;它跑遍所有整數 |
| $r$ | 整數——表示樣本被平移了幾個完整的週期 $N$ |
| $W_N$ | $e^{-j2\pi/N}$,與前面相同 |
| 記号 | 意味 |
|---|---|
| $x[n]$ | もとの系列。$-A \le n < B$ の範囲で非零であり、長さ $L = A+B$ は $N$ を超えてよい |
| $X(e^{j\omega})$ | その DTFT。$\omega$ の連続関数である |
| $X[k]$ | その DTFT の $N$ 個の標本:$X[k] = X(e^{j2\pi k/N})$、$k = 0,\dots,N-1$ |
| $\tilde{x}[n]$ | これら $N$ 個の標本の $N$ 点 IDFT が返すもの。$0 \le n < N$ 上で定義される |
| $\ell$ | DTFT の和の中のダミー時間索引。すべての整数を走る |
| $r$ | 整数 —— 標本が周期 $N$ の何個ぶん平行移動されたかを表す |
| $W_N$ | $e^{-j2\pi/N}$。これまでと同じ |
Step 1 — write both transforms out步驟 1 — 把兩個變換都寫出來ステップ 1 — 両方の変換を書き下す
The DTFT sum runs over every nonzero sample, all $L$ of them, not just the first $N$:DTFT 的和要跑過每一個非零樣本,全部 $L$ 個,而不只是前 $N$ 個:DTFT の和は非零の標本すべて、全部で $L$ 個にわたって走る。最初の $N$ 個だけではない:
$$X[k] = X(e^{j\omega})\Big|_{\omega = 2\pi k/N} = \sum_{\ell=-\infty}^{\infty} x[\ell]\,W_N^{k\ell}, \qquad \tilde{x}[n] = \frac{1}{N}\sum_{k=0}^{N-1} X[k]\,W_N^{-kn}$$Step 2 — substitute and swap the sums步驟 2 — 代入並交換求和次序ステップ 2 — 代入して和の順序を交換する
$$\tilde{x}[n] = \frac{1}{N}\sum_{k=0}^{N-1}\Big(\sum_{\ell} x[\ell]\,W_N^{k\ell}\Big) W_N^{-kn} = \sum_{\ell} x[\ell]\;\underbrace{\frac{1}{N}\sum_{k=0}^{N-1} W_N^{k(\ell-n)}}_{\text{orthogonality, §8.2.2}}$$Step 3 — the delta now fires more than once步驟 3 — 這次 delta 不只響一次ステップ 3 — 今度はデルタが一度では済まない
This is the same rotated-vector sum proved in §8.2.2, and it equals $1$ when the exponent multiplier is a multiple of $N$ and $0$ otherwise. In §8.2.2 both indices lived in $0,\dots,N-1$, so $\ell=n$ was the only possibility. Here $\ell$ ranges past $N-1$, so the sum fires at every $\ell$ congruent to $n$ modulo $N$ — that is, at $\ell = n, n+N, n+2N, \dots$:這就是 §8.2.2 證過的那個旋轉向量和:當指數的倍數是 $N$ 的倍數時它等於 $1$,其餘情況為 $0$。在 §8.2.2 裡兩個索引都落在 $0,\dots,N-1$ 之內,所以 $\ell=n$ 是唯一的可能。但這裡 $\ell$ 會跑超過 $N-1$,於是只要 $\ell$ 與 $n$ 對 $N$ 同餘,這個和就會響一次——也就是在 $\ell = n, n+N, n+2N, \dots$ 處:これは §8.2.2 で証明した回転ベクトルの和と同じものであり、指数の係数が $N$ の倍数のとき $1$、それ以外では $0$ になる。§8.2.2 では両方の索引が $0,\dots,N-1$ の中にあったので $\ell=n$ しかありえなかった。ここでは $\ell$ が $N-1$ を越えて走るので、$\ell$ が $n$ と $N$ を法として合同になるたびに、この和は鳴る —— すなわち $\ell = n, n+N, n+2N, \dots$ においてである:
$$\frac{1}{N}\sum_{k=0}^{N-1} W_N^{k(\ell-n)} = \begin{cases} 1, & \ell - n = rN \;\;(r \text{ an integer})\\ 0, & \text{otherwise} \end{cases}$$This is exactly where the overlength case parts company with the IDFT proof. There both indices were locked inside the window, so the only way for $\ell - n$ to be a multiple of $N$ was to be $0$, and a single term survived. Here $\ell$ is free, and since $W_N^{N} = 1$ the braced sum equals $1$ at every $\ell = n + rN$ — for any integer $r$, not just $r = 0$. Every one of those terms survives.這正是超長情形與 IDFT 證明分道揚鑣的地方。在那裡兩個索引都被鎖在視窗之內,所以 $\ell - n$ 要成為 $N$ 的倍數,唯一的辦法就是等於 $0$,於是只有一項留下來。這裡 $\ell$ 是自由的,而且因為 $W_N^{N} = 1$,只要 $\ell = n + rN$,括號裡的和就等於 $1$——$r$ 可以是任意整數,不只是 $r = 0$,每一個這樣的 $\ell$ 都算數。這些項全部都會留下來。超長の場合が IDFT の証明と袂を分かつのは、まさにここである。あちらでは両方の索引が窓の中に閉じ込められていたので、$\ell - n$ が $N$ の倍数になる道は $0$ になること以外になく、残る項は一つだけだった。ここでは $\ell$ は自由であり、$W_N^{N} = 1$ であるから、$\ell = n + rN$ でありさえすれば括弧の中の和は $1$ に等しい —— $r$ は 任意 の整数でよく、$r = 0$ に限らず、そのすべてが効いてくる。それらの項はすべて生き残る。
Step 4 — collect what is left步驟 4 — 把留下來的收攏起來ステップ 4 — 残ったものを集める
Keeping only those terms leaves one sum over $r$. Because $r$ sweeps every integer, the sign of the shift makes no difference — $\sum_r x[n+rN]$ and $\sum_r x[n-rN]$ are the same list of terms in a different order:只保留那些項,就剩下一個對 $r$ 的求和。因為 $r$ 跑遍所有整數,平移的正負號並不影響結果——$\sum_r x[n+rN]$ 與 $\sum_r x[n-rN]$ 是同一串項,只是順序不同:それらの項だけを残せば、$r$ についての和が一つ残る。$r$ はすべての整数を走るので、平行移動の符号は結果に影響しない。$\sum_r x[n+rN]$ と $\sum_r x[n-rN]$ は、順序が違うだけの同じ項の並びである:
$$\tilde{x}[n] = \sum_{r=-\infty}^{\infty} x[n - rN] = \sum_{r=-\infty}^{\infty} x[n + rN], \qquad 0 \le n < N$$Every sample of $x$ is slid by a whole number of periods $N$ until it lands inside $0 \le n < N$, and samples that land on the same spot are added. That is time-domain aliasing.$x$ 的每個樣本都被平移 $N$ 的整數倍,直到落入 $0 \le n < N$ 之內;落在同一個位置的樣本會相加。這就是時域混疊。$x$ のどの標本も、周期 $N$ の整数倍だけずらされて $0 \le n < N$ の中へ落ちる。同じ位置に落ちた標本どうしは加算される。これが時間領域エイリアシングである。
So $\tilde{x}$ is $x$ chopped into blocks of length $N$ which are then stacked on top of each other and added. Everything beyond sample $N-1$ wraps around and lands back inside the window.所以 $\tilde{x}$ 就是把 $x$ 切成長度為 $N$ 的區塊,再把這些區塊疊在一起相加。第 $N-1$ 個樣本之後的所有東西都會繞回來,落回窗內。つまり $\tilde{x}$ は、$x$ を長さ $N$ のブロックに切り分け、それらを互いに重ねて足し合わせたものである。標本 $N-1$ より先にあるものはすべて巻き戻り、窓の中へ落ち直す。
| Case | What happens | Can $x$ be recovered? |
|---|---|---|
| $L \le N$ | only the $r=0$ block is nonzero — the copies never overlap | Yes, $\tilde{x}[n] = x[n]$ exactly |
| $L > N$ (overlength) | blocks overlap; samples add that were never meant to meet | No — the sum cannot be undone |
| 情況 | 會發生什麼 | 還原得回 $x$ 嗎? |
|---|---|---|
| $L \le N$ | 只有 $r=0$ 的區塊不為零——各複本永遠不重疊 | 可以,$\tilde{x}[n] = x[n]$ 完全成立 |
| $L > N$(超長) | 區塊重疊;本來不該相遇的樣本被加在一起 | 不行——這個相加無法還原 |
| 場合 | 何が起こるか | $x$ は復元できるか |
|---|---|---|
| $L \le N$ | 非零なのは $r=0$ のブロックだけ —— 複製が重なることはない | できる。$\tilde{x}[n] = x[n]$ が厳密に成り立つ |
| $L > N$(長すぎる) | ブロックが重なり、出会うはずのなかった標本どうしが加算される | できない —— この和はほどけない |
Take $x[n] = \{1,2,3,4,5,6\}$, so $L = 6$, and sample its DTFT at only $N = 4$ frequencies. The tail $x[4]=5$ and $x[5]=6$ has nowhere to live, so it folds onto $n=0$ and $n=1$:取 $x[n] = \{1,2,3,4,5,6\}$,也就是 $L = 6$,而只在 $N = 4$ 個頻率上對它的 DTFT 取樣。尾巴 $x[4]=5$ 與 $x[5]=6$ 沒有地方可以待,於是摺到 $n=0$ 與 $n=1$ 上:$x[n] = \{1,2,3,4,5,6\}$、すなわち $L = 6$ をとり、その DTFT を $N = 4$ 個の周波数でしか標本化しないとする。末尾の $x[4]=5$ と $x[5]=6$ には居場所がないので、$n=0$ と $n=1$ の上へ折り返される:
The same four numbers fall out of the index bookkeeping of §8.5.1 without drawing anything: for each $n$ in the window, collect every $\ell$ in $0,\dots,5$ whose difference $\ell - n$ is a multiple of $4$, and add those samples up.不必畫任何圖,光是照著 §8.5.1 的索引記帳就會掉出同樣這四個數:對視窗內的每個 $n$,把 $0,\dots,5$ 之中所有使 $\ell - n$ 為 $4$ 的倍數的 $\ell$ 收集起來,再把那些樣本加總。何も描かなくても、§8.5.1 の索引の帳尻合わせから同じ四つの数が落ちてくる。窓の中の各 $n$ について、$0,\dots,5$ のうち差 $\ell - n$ が $4$ の倍数になる $\ell$ をすべて集め、それらの標本を足し合わせればよい。
| $n$ | surviving $\ell$ | contribution | $\tilde{x}[n]$ |
|---|---|---|---|
| $0$ | $\ell = 0,\,4$ | $x[0] + x[4] = 1 + 5$ | $6$ |
| $1$ | $\ell = 1,\,5$ | $x[1] + x[5] = 2 + 6$ | $8$ |
| $2$ | $\ell = 2$ | $x[2]$ | $3$ |
| $3$ | $\ell = 3$ | $x[3]$ | $4$ |
| $n$ | 留下來的 $\ell$ | 貢獻 | $\tilde{x}[n]$ |
|---|---|---|---|
| $0$ | $\ell = 0,\,4$ | $x[0] + x[4] = 1 + 5$ | $6$ |
| $1$ | $\ell = 1,\,5$ | $x[1] + x[5] = 2 + 6$ | $8$ |
| $2$ | $\ell = 2$ | $x[2]$ | $3$ |
| $3$ | $\ell = 3$ | $x[3]$ | $4$ |
| $n$ | 生き残る $\ell$ | 寄与 | $\tilde{x}[n]$ |
|---|---|---|---|
| $0$ | $\ell = 0,\,4$ | $x[0] + x[4] = 1 + 5$ | $6$ |
| $1$ | $\ell = 1,\,5$ | $x[1] + x[5] = 2 + 6$ | $8$ |
| $2$ | $\ell = 2$ | $x[2]$ | $3$ |
| $3$ | $\ell = 3$ | $x[3]$ | $4$ |
Two samples are corrupted and two survive untouched — and nothing about $\tilde{x} = \{6,8,3,4\}$ announces which is which. That is what makes time aliasing dangerous: the result looks like a perfectly ordinary 4-point sequence.有兩個樣本被汙染,兩個則毫髮無傷——而且 $\tilde{x} = \{6,8,3,4\}$ 本身完全看不出哪個是哪個。這正是時域混疊危險的地方:結果看起來就是一個再正常不過的 4 點序列。二つの標本が壊れ、二つは無傷で生き残る —— しかも $\tilde{x} = \{6,8,3,4\}$ のどこを見ても、どちらがどちらかは分からない。時間領域エイリアシングが危険なのはそこである。結果はごくふつうの 4 点系列に見えてしまう。
Fig. 8-2b is one fixed case. Dragging $N$ below and above the length of the sequence shows the whole story at once: how many blocks the window has to swallow, which samples pile onto which, and the exact moment at which the piling stops. The sequence here is two-sided — it starts at $n = -4$ and ends at $n = 11$, so $A = 4$, $B = 12$ and $L = A+B = 16$. The legend labels each block by its $r$, using the $x[n-rN]$ sign convention of Step 4.圖 8-2b 只是一個固定的案例。把下面的 $N$ 拖到序列長度之下再拖到之上,整個故事就一次看完了:視窗必須吞下幾個區塊、哪些樣本疊到哪些樣本上,以及疊加停止的那個確切時刻。這裡的序列是雙邊的——從 $n = -4$ 開始,到 $n = 11$ 結束,所以 $A = 4$、$B = 12$、$L = A+B = 16$。圖例以 $r$ 標示每個區塊,採用步驟 4 中 $x[n-rN]$ 的正負號慣例。図 8-2b は固定された一例にすぎない。下の $N$ を系列長より小さい側から大きい側へ動かせば、話の全体が一度に見える。窓がいくつのブロックを飲み込まねばならないか、どの標本がどれの上に積まれるか、そして積み重なりが止まるちょうどその瞬間が分かる。ここでの系列は両側である。$n = -4$ に始まり $n = 11$ に終わるので、$A = 4$、$B = 12$、$L = A+B = 16$ である。凡例は各ブロックを $r$ で示し、ステップ 4 の $x[n-rN]$ の符号の約束に従う。
Sampling too coarsely in time makes spectral copies overlap — aliasing in frequency (§6.3.2). Sampling too coarsely in frequency makes time copies overlap — aliasing in time. The condition $N \ge L$ is the exact counterpart of $\Omega_s \ge 2\Omega_N$, and the remedy is the same in spirit: take more samples. Here that means zero-pad to a larger $N$ (§8.7.1).在時間上取樣太疏,頻譜的複本就會重疊——這是頻率上的混疊(§6.3.2)。在頻率上取樣太疏,時間的複本就會重疊——這是時間上的混疊。條件 $N \ge L$ 正是 $\Omega_s \ge 2\Omega_N$ 的對應物,而補救之道在精神上也相同:多取一些樣本。在這裡就是補零到更大的 $N$(§8.7.1)。時間での標本化が粗すぎればスペクトルの複製が重なる —— 周波数でのエイリアシング(§6.3.2)である。周波数での標本化が粗すぎれば時間の複製が重なる —— 時間でのエイリアシングである。条件 $N \ge L$ は $\Omega_s \ge 2\Omega_N$ の正確な対応物であり、処方箋も精神は同じである。標本をもっと取ればよい。ここでそれはより大きな $N$ までゼロ詰めすることを意味する(§8.7.1)。
Two places in this chapter are the same phenomenon wearing a different hat. Circular convolution (§8.6.2) is time aliasing of $y_{\text{lin}}$ rather than of $x$ — multiplying two spectra sampled too coarsely folds the convolution's tail onto its head, and the cure is again a larger $N$. And an infinite-length sequence can never satisfy $N \ge L$, so sampling its DTFT always aliases; Exercise 4 works that case for $x[n] = a^n u[n]$ and finds the closed form $a^n/(1-a^N)$.本章有兩個地方其實是同一個現象換了一頂帽子。循環摺積(§8.6.2)是 $y_{\text{lin}}$ 的時域混疊,而不是 $x$ 的——把兩個取樣太疏的頻譜相乘,會把摺積的尾巴摺到頭上,解法同樣是加大 $N$。另外,無限長的序列永遠不可能滿足 $N \ge L$,所以對它的 DTFT 取樣必定會混疊;習題 4 就以 $x[n] = a^n u[n]$ 處理這個情況,得到封閉形式 $a^n/(1-a^N)$。本章の二つの箇所は、同じ現象が別の帽子をかぶっているだけである。円状畳み込み(§8.6.2)は $x$ ではなく $y_{\text{lin}}$ の時間領域エイリアシングである。粗く標本化しすぎた二つのスペクトルを掛ければ、畳み込みの尾が頭へ折り重なる。治療法はやはり $N$ を大きくすることである。また、無限長の系列は $N \ge L$ を決して満たせないので、その DTFT を標本化すればかならずエイリアシングが起こる。演習 4 はこの場合を $x[n] = a^n u[n]$ について扱い、閉じた形 $a^n/(1-a^N)$ を得る。
The formula just derived is itself an important working tool. It states exactly what the time domain hands back when only $N$ frequency samples are taken. Practice divides its use into roughly two classes: one that avoids aliasing on the strength of it, and one that provokes aliasing deliberately.這個公式本身就是實務上很重要的工具。它精確地告訴你「只取 $N$ 個頻率樣本時,時域會得到什麼」。實務上的用法大致分兩類:一類是據此避開混疊,另一類是刻意利用混疊。いま導いた公式は、それ自体が実務上きわめて重要な道具である。「$N$ 個の周波数標本だけを取ったとき、時間領域に何が返ってくるか」を正確に述べているからである。実務での使い方は大きく二つに分かれる。一つはこれを根拠にエイリアシングを避ける使い方、もう一つはあえてエイリアシングを利用する使い方である。
Through §8.5.4–§8.5.6, $L$ is the signal length, $M$ the filter length, $N$ the FFT length, and in item 5 $P$ is the number of $N$-sample segments a long window spans. Be warned that §8.6 writes the filter length as $P$ — the same letter in a different role — so when the two sections are read side by side, read §8.6's $P$ as this section's $M$. One further letter to watch: §8.6.4 writes $L$ for the length of a single block of the signal, not of the whole signal.在 §8.5.4–§8.5.6 中,$L$ 是訊號長度,$M$ 是濾波器長度,$N$ 是 FFT 長度,而第 5 項中的 $P$ 是長視窗橫跨的 $N$ 樣本區段數。要留意的是,§8.6 把濾波器長度寫成 $P$——同一個字母,不同的角色——所以兩節對照著讀時,請把 §8.6 的 $P$ 讀成本節的 $M$。還有一個字母要留意:§8.6.4 的 $L$ 指的是訊號單一區塊的長度,不是整段訊號的長度。§8.5.4–§8.5.6 では、$L$ が信号の系列長、$M$ がフィルタの系列長、$N$ が FFT の系列長であり、第 5 項の $P$ は長い窓関数がまたぐ $N$ 標本区間の個数である。注意すべきは、§8.6 がフィルタの系列長を $P$ と書くことである。同じ文字が別の役を担うので、二つの節を並べて読むときは §8.6 の $P$ を本節の $M$ と読み替えてほしい。もう一つ注意すべき文字がある。§8.6.4 は $L$ を、信号全体ではなくその一ブロックの長さとして用いている。
In practice, when a long signal has to be filtered or correlated, the route "FFT → multiply → IFFT" is used to speed the job up. But multiplying two DFTs corresponds to circular convolution, not linear convolution.實務上做長訊號濾波、相關運算時,常用「FFT → 相乘 → IFFT」來加速。但兩個 DFT 相乘,對應的是循環摺積,不是線性摺積。実務で長い信号を濾波したり相関をとったりするときには、「FFT → 乗算 → IFFT」という経路で計算を速める。しかし二つの DFT を掛け合わせることに対応するのは円状畳み込みであって、線形畳み込みではない。
That distinction has to be made precise here, because the rest of this item depends on it and §8.6 has not been read yet. The linear convolution of $x$ with $h$ slides one past the other along the whole infinite axis, $y[n] = \sum_m x[m]\,h[n-m]$, and the answer is allowed to be longer than either input. The circular convolution of two length-$N$ sequences keeps everything inside a window of length $N$: the shift of $h$ is taken modulo $N$, so a sample pushed past the right-hand end of the window reappears at the left-hand end.這個區別在這裡必須說清楚,因為本項後面都靠它,而 §8.6 還沒讀到。$x$ 與 $h$ 的線性摺積是讓兩者沿著整條無限長的軸互相滑過去,$y[n] = \sum_m x[m]\,h[n-m]$,而且答案允許比任何一個輸入都長。兩個長度為 $N$ 的序列的循環摺積則把一切都關在長度 $N$ 的視窗裡:$h$ 的平移是對 $N$ 取模的,所以被推出視窗右端的樣本會從左端冒出來。この区別はここで明確にしておかねばならない。本項の以降はすべてそれに依っており、しかも §8.6 はまだ読んでいないからである。$x$ と $h$ の線形畳み込みは、両者を無限に伸びた軸の上で互いに滑らせるもので、$y[n] = \sum_m x[m]\,h[n-m]$ と書かれ、答えはどちらの入力より長くなってよい。長さ $N$ の二つの系列の円状畳み込みは、いっさいを長さ $N$ の窓の中に閉じ込める。$h$ のシフトを $N$ を法としてとるので、窓の右端から押し出された標本は左端に現れる。
Why does the product of two DFTs land on the circular version and not the linear one? Because an $N$-point DFT only ever sees a signal as periodic with period $N$ — that is what §8.1.2 built it out of — so the shift it performs is a shift of a periodic sequence, which is a rotation inside the window. §8.6.1 and §8.6.2 develop this properly; here only the consequence is needed.為什麼兩個 DFT 相乘會落在循環版本而不是線性版本?因為 $N$ 點 DFT 看一個訊號時,永遠把它看成週期為 $N$ 的週期序列——§8.1.2 就是這樣把它建起來的——所以它做的平移是週期序列的平移,也就是視窗內部的旋轉。§8.6.1 與 §8.6.2 會把這件事好好展開;這裡只需要它的後果。なぜ二つの DFT の積は線形ではなく円状のほうに落ちるのか。$N$ 点 DFT は信号を常に周期 $N$ の周期系列としてしか見ないからである —— §8.1.2 はまさにそこから DFT を組み立てた —— したがってそれが行うシフトは周期系列のシフト、すなわち窓の内部での回転になる。§8.6.1 と §8.6.2 がこれをきちんと展開する。ここで必要なのはその帰結だけである。
Convolving a length-$L$ signal linearly with a length-$M$ filter gives a result of length $L + M - 1$. If the FFT length satisfies $N < L + M - 1$, the part that does not fit wraps round onto the front and is added there, exactly as the formula of this section says, and the result is wrong.長度 $L$ 的訊號與長度 $M$ 的濾波器做線性摺積,結果長度是 $L + M - 1$。若 FFT 長度 $N < L + M - 1$,超出的部分就會依本節的公式繞回前面相加,結果出錯。長さ $L$ の信号と長さ $M$ のフィルタとの線形畳み込みの結果は、長さ $L + M - 1$ になる。FFT の系列長が $N < L + M - 1$ であれば、収まりきらない分は本節の公式のとおりに前へ巻き戻って加算され、結果は誤ったものになる。
It is worth seeing the damage at the level of individual samples. Write $y_{\text{lin}}$ for the correct answer of length $L+M-1$ and $\tilde{y}$ for what the $N$-point route returns. The formula of this section, applied to $y_{\text{lin}}$ instead of to $x$, gives值得把損傷看到單一樣本的層次。令 $y_{\text{lin}}$ 為長度 $L+M-1$ 的正確答案,$\tilde{y}$ 為 $N$ 點路線實際給出的東西。把本節的公式用在 $y_{\text{lin}}$ 而不是 $x$ 上,就得到損傷を標本一つ一つの水準で見ておく値打ちがある。長さ $L+M-1$ の正しい答えを $y_{\text{lin}}$、$N$ 点の経路が実際に返すものを $\tilde{y}$ と書く。本節の公式を $x$ ではなく $y_{\text{lin}}$ に適用すれば、
Only the $r = 1$ term can be nonzero, and only while $n + N \le L+M-2$, i.e. for $n \le L+M-2-N$. So the first $L+M-1-N$ outputs are corrupted and the rest are exactly right. Push $N$ up to $L+M-1$ and that count falls to zero.只有 $r = 1$ 這一項可能非零,而且只在 $n + N \le L+M-2$ 時,也就是 $n \le L+M-2-N$。所以前 $L+M-1-N$ 個輸出壞掉,其餘完全正確。把 $N$ 推到 $L+M-1$,這個數目就降到零。非零になりうるのは $r = 1$ の項だけであり、しかも $n + N \le L+M-2$、すなわち $n \le L+M-2-N$ のあいだだけである。したがって先頭の $L+M-1-N$ 個の出力が壊れ、残りは厳密に正しい。$N$ を $L+M-1$ まで上げれば、この個数は零に落ちる。
So the formula hands the design rule over directly:所以這個公式直接給出設計規則:こうしてこの公式は、設計規則をそのまま手渡してくれる:
This is why zeros are appended before an FFT convolution. Zero padding means nothing more than writing the length-$L$ signal into a length-$N$ buffer and leaving the remaining $N-L$ positions at zero before transforming — the signal itself is untouched, and so is its DTFT; only the grid of frequency points on which that DTFT is sampled gets finer. §8.7.1 takes up what zero padding does and does not buy in the frequency domain; here its job is purely to make room so that nothing has to wrap.這就是為什麼做 FFT 摺積之前要補零。補零(zero-padding)的意思不過是:把長度 $L$ 的訊號寫進一個長度 $N$ 的緩衝區,剩下的 $N-L$ 個位置留成零,然後再做變換——訊號本身沒被動過,它的 DTFT 也沒有;變細的只是取樣那條 DTFT 的頻率格點。§8.7.1 會討論補零在頻域買得到什麼、買不到什麼;在這裡它的工作純粹是騰出空間,讓任何東西都不必繞回。これが FFT 畳み込みの前にゼロを付け足す理由である。ゼロ詰めとは、長さ $L$ の信号を長さ $N$ の緩衝区へ書き込み、残る $N-L$ 個の位置を零のままにしてから変換する、それだけのことである。信号そのものは手つかずであり、その DTFT も変わらない。細かくなるのは、その DTFT を標本化する周波数格子だけである。ゼロ詰めが周波数領域で何を買い、何を買わないかは §8.7.1 が引き受ける。ここでのその役目は、何も巻き戻らずに済むよう場所をあけること、ただそれだけである。
In practice $N$ is then rounded up to the next power of two (or to whatever length the FFT library likes), because the cost of the transform depends on the factorisation of $N$ far more than on its size. Padding beyond $L+M-1$ never hurts the answer — the extra terms of $\sum_r$ are all zero — it only costs arithmetic. The same rule read backwards is the one §8.6.3 states and §8.6.4 turns into overlap-add; what this section adds is the reason it is true.實務上接著會把 $N$ 往上取到下一個 2 的冪次(或 FFT 函式庫喜歡的任何長度),因為變換的代價取決於 $N$ 的因式分解,遠多於取決於它的大小。補到超過 $L+M-1$ 絕不會傷害答案——$\sum_r$ 多出來的那些項全是零——只是多花算術而已。同一條規則倒過來讀,就是 §8.6.3 所陳述、而 §8.6.4 化成重疊相加法的那一條;本節補上的是它為什麼成立。実務ではこのあと $N$ を次の 2 の冪(あるいは FFT ライブラリの好む系列長)まで切り上げる。変換の計算量は $N$ の大きさよりも $N$ の素因数分解にはるかに強く依存するからである。$L+M-1$ を超えて詰めても答えは決して傷つかない。$\sum_r$ の余分な項はすべて零だからである。余計にかかるのは演算だけである。同じ規則を逆から読んだものが §8.6.3 の述べる規則であり、§8.6.4 がそれを重畳加算法に仕立てる。本節が付け加えるのは、それがなぜ成り立つのかという理由である。
Take an IIR filter, for instance: its impulse response $h[n]$ is endless. Suppose you sample $H(e^{j\omega})$ at $N$ frequency points and take the IFFT, hoping to read off $h[n]$. What you actually get is例如一個 IIR 濾波器的脈衝響應 $h[n]$ 是無限長的。如果你在 $N$ 個頻率點上取樣 $H(e^{j\omega})$,再做 IFFT 想得到 $h[n]$,得到的其實是たとえば IIR フィルタのインパルス応答 $h[n]$ は無限に続く。$N$ 個の周波数点で $H(e^{j\omega})$ を標本化し、IFFT をとって $h[n]$ を読み取ろうとしたとき、実際に得られるのは
Because $h[n]$ decays, this formula lets you estimate the error: as long as $N$ is large enough that $h[n]$ is already small for $n \ge N$, the part that wraps round can be ignored. Which is to say, the formula tells you how many frequency points are enough to be accurate.因為 $h[n]$ 會衰減,這個公式讓你估計誤差:只要 $N$ 夠大,使 $h[n]$ 在 $n \ge N$ 之後已經很小,繞回來的部分就可以忽略。也就是說,這個公式告訴你需要多少頻率點才夠準。$h[n]$ は減衰するので、この公式によって誤差を見積もることができる。$n \ge N$ のあたりで $h[n]$ がすでに十分小さくなる程度に $N$ を大きくとりさえすれば、巻き戻ってくる分は無視できる。すなわちこの公式は、どれだけの周波数点があれば十分に正確かを教えてくれる。
No finite $N$ makes this exact — $h$ is endless, so the $r = 1$ block is never empty. But a stable filter has a decaying $h[n]$, and that turns a vague "use a long enough FFT" into an error budget. The error at index $n$ is just the tail that landed on it:沒有任何有限的 $N$ 能讓這件事精確成立——$h$ 沒有盡頭,所以 $r = 1$ 的那一塊永遠不會是空的。但穩定濾波器的 $h[n]$ 會衰減,這就把含糊的「FFT 取夠長就好」變成一份誤差預算。索引 $n$ 處的誤差,就只是落到它上面的那條尾巴:有限の $N$ でこれが厳密に成り立つことはない。$h$ は終わらないので、$r = 1$ のブロックが空になることはないからである。しかし安定なフィルタの $h[n]$ は減衰するので、漠然とした「十分に長い FFT を使え」が誤差の見積もりに変わる。索引 $n$ における誤差は、そこへ落ちてきた尾そのものである:
For a stable IIR filter whose poles have the largest magnitude $\rho < 1$, the envelope obeys $|h[n]| \le C\rho^{\,n}$, so the bound is $C\rho^{\,N}/(1-\rho)$: the required $N$ grows only like $\log(1/\varepsilon)/\log(1/\rho)$ for an accuracy $\varepsilon$. A pole at $|z| = 0.9$ needs roughly ten times as many points as a pole at $|z| = 0.35$ for the same error. The formula does not merely warn that $N$ must be "large"; it says how large, and why.對一個極點最大半徑為 $\rho < 1$ 的穩定 IIR 濾波器,包絡滿足 $|h[n]| \le C\rho^{\,n}$,於是上界是 $C\rho^{\,N}/(1-\rho)$:若要達到精度 $\varepsilon$,所需的 $N$ 只以 $\log(1/\varepsilon)/\log(1/\rho)$ 的速度成長。在同樣的誤差要求下,$|z| = 0.9$ 的極點大約需要 $|z| = 0.35$ 的極點十倍的點數。這個公式不只是警告 $N$ 要「夠大」,它說得出要多大,以及為什麼。極の最大半径が $\rho < 1$ である安定な IIR フィルタでは包絡が $|h[n]| \le C\rho^{\,n}$ に従うので、上界は $C\rho^{\,N}/(1-\rho)$ となる。精度 $\varepsilon$ を得るために必要な $N$ は $\log(1/\varepsilon)/\log(1/\rho)$ の程度でしか増えない。同じ誤差を求めるなら、$|z| = 0.9$ の極は $|z| = 0.35$ の極のおよそ十倍の点数を要する。この公式は $N$ が「大きく」なければならないと警告するだけではない。どれだけ大きく、なぜそうなのかまで述べている。
First specify the wanted response $H_d[k]$ at $N$ frequency points, then take the IDFT to obtain the FIR coefficients. The impulse response of an ideal response — an ideal lowpass, say — is an endless sinc, so the coefficients you obtain are a time-aliased version of it. That explains why a filter designed by frequency sampling has ripple between the sample points.先在 $N$ 個頻率點指定想要的響應 $H_d[k]$,再做 IDFT 得到 FIR 係數。理想響應(例如理想低通)的脈衝響應是無限長的 sinc,所以得到的係數是它的時域混疊版本。這解釋了頻率取樣法設計出的濾波器,為什麼在取樣點之間會有漣波。まず $N$ 個の周波数点で望みの応答 $H_d[k]$ を指定し、次に IDFT をとって FIR 係数を得る。理想的な応答(たとえば理想低域通過)のインパルス応答は無限に続く sinc なので、得られる係数はそれを時間領域エイリアシングさせたものになる。周波数標本化法で設計したフィルタが標本点のあいだでリプルをもつのは、これで説明がつく。
This design route runs in the opposite direction to the windowed-sinc method of §14.2. By construction the finished filter passes exactly through every specified value — the DFT guarantees it. The question is what it does between the grid points, and the formula of this section answers it.這條設計路線的方向,與 §14.2 的加窗 sinc 法恰好相反。依照構造,做好的濾波器會精確通過每一個指定值——這是 DFT 保證的。問題在於它在格點之間做了什麼,而本節的公式正好回答了這一點。この設計の道筋は、§14.2 の窓掛け sinc 法とちょうど逆向きに進む。構成上、出来上がったフィルタは指定値のすべてを厳密に通る。DFT がそれを保証するからである。問題はそれが格子点のあいだで何をするかであり、本節の公式がまさにそれに答える。
What the IDFT returns is therefore not the ideal sinc truncated to $N$ samples — it is the sinc time-aliased onto $N$ samples, tails folded back and added. Windowing (Ch 14) cuts the tails off; frequency sampling wraps them around. Both are approximations of the same endless sequence, and the characteristic behaviour of each follows from which one it does: the windowed design is smooth but misses the specification everywhere, while the frequency-sampled design is exact on the grid and overshoots between the grid points. Those overshoots are the method's ripple, and this section names their source.所以 IDFT 給出的並不是把理想 sinc 截到 $N$ 點,而是把它時域混疊到 $N$ 點:尾巴被摺回來相加。加窗(第 14 章)是把尾巴剪掉;頻率取樣是把尾巴繞回來。兩者都是同一條無限序列的近似,而各自的典型行為正來自它用的是哪一種:加窗設計平滑,但處處都偏離規格;頻率取樣設計在格點上完全準確,卻在格點之間過衝。那些過衝就是這個方法的漣波,而本節說出了它們的來源。したがって IDFT が返すのは、理想の sinc を $N$ 点に打ち切ったものではなく、$N$ 点の上へ時間領域エイリアシングさせたもの、つまり尾を折り返して足し合わせたものである。窓掛け(第 14 章)は尾を切り落とし、周波数標本化は尾を巻き戻す。どちらも同じ終わらない系列の近似であり、それぞれに特徴的なふるまいは、どちらを選んだかから出てくる。窓掛け設計はなめらかだが至るところで仕様を外し、周波数標本化設計は格子点上では厳密でありながら格子点のあいだで行きすぎる。その行きすぎがこの手法のリプルであり、本節はその出どころを言い当てている。
When a very long streaming signal has to be processed, cut it into blocks of length $N$ and run an $N$-point FFT on each block to perform a circular convolution. Here the aliasing is allowed to happen on purpose; but it is known in advance that the first $M - 1$ output samples are contaminated by the part that wrapped round, so they are simply discarded and only the $N - M + 1$ correct samples that follow are kept.處理很長的串流訊號時,把訊號切成長度 $N$ 的區塊,每塊都用 $N$ 點 FFT 做循環摺積。此時故意讓混疊發生,但事先知道前 $M - 1$ 個輸出樣本被繞回的部分污染了,所以直接丟掉它們,只保留後面正確的 $N - M + 1$ 個樣本。非常に長い流れ込む信号を処理するときには、信号を長さ $N$ のブロックに切り、各ブロックに $N$ 点 FFT をかけて円状畳み込みを行う。ここではわざとエイリアシングを起こさせる。ただし、先頭の $M - 1$ 個の出力標本が巻き戻ってきた分で汚染されることが前もって分かっているので、それらはそのまま捨て、後に続く正しい $N - M + 1$ 個の標本だけを残す。
This is more efficient than zero-padding every block, and it is a common method for real-time filtering.這比每塊都補零更有效率,是即時濾波常用的方法。これはブロックごとにゼロ詰めするよりも効率がよく、実時間濾波でよく使われる方法である。
The arithmetic behind the claim is the formula of this section again, applied to the block's own output. The linear convolution of an $N$-sample block with a length-$M$ response is $N+M-1$ long, so $M-1$ samples overhang the end of the window. In $\tilde{y}[n] = \sum_r y[n-rN]$ only the $r = 1$ term is ever nonzero, and only for $n \le M-2$. That is the whole method in one line: outputs $n = 0, \dots, M-2$ are contaminated, outputs $n = M-1, \dots, N-1$ are untouched and exactly right. Discard the first $M-1$, keep the remaining $N-M+1$, and advance the input by $N-M+1$ so consecutive blocks overlap by $M-1$ samples — the input samples that the name says are saved.這個主張背後的算術,又是本節的公式,只是這次用在區塊自己的輸出上。$N$ 個樣本的區塊與長度 $M$ 的響應做線性摺積,結果長 $N+M-1$,所以有 $M-1$ 個樣本懸在視窗尾端之外。在 $\tilde{y}[n] = \sum_r y[n-rN]$ 裡,非零的永遠只有 $r = 1$ 這一項,而且只出現在 $n \le M-2$。整個方法就是這一行:輸出的 $n = 0, \dots, M-2$ 受到汙染,輸出的 $n = M-1, \dots, N-1$ 毫髮無傷、完全正確。把前 $M-1$ 個丟掉,留下剩餘的 $N-M+1$ 個,輸入則前進 $N-M+1$,於是相鄰區塊重疊 $M-1$ 個樣本——這就是方法名稱裡被保留下來的那些輸入樣本。この主張を支える算術は、やはり本節の公式であり、今度はそれをブロック自身の出力に適用する。$N$ 標本のブロックと長さ $M$ の応答との線形畳み込みは $N+M-1$ の長さをもつので、$M-1$ 個の標本が窓の末尾からはみ出す。$\tilde{y}[n] = \sum_r y[n-rN]$ において非零になるのは常に $r = 1$ の項だけであり、しかも $n \le M-2$ の範囲だけである。手法の全体はこの一行に尽きる。出力の $n = 0, \dots, M-2$ は汚染され、出力の $n = M-1, \dots, N-1$ は無傷で厳密に正しい。先頭の $M-1$ 個を捨て、残る $N-M+1$ 個を保ち、入力は $N-M+1$ だけ進める。こうして隣り合うブロックは $M-1$ 標本ぶん重なる —— 名前のいう、保留される入力標本である。
A practical detail follows from the bookkeeping: the first block has no predecessor to overlap with, so it is started with $M-1$ zeros in front of the first real sample. After that the machine runs forever with no further special cases, consuming $N-M+1$ new samples and emitting $N-M+1$ finished ones per transform. Efficiency is measured by the fraction $(N-M+1)/N$ of the transform that does useful work, which is why $N$ is usually chosen several times $M$ — large enough that the discarded head is a small tax, small enough that the $\log N$ cost per sample stays low.由這本帳可以推出一個實務細節:第一個區塊沒有前一塊可以重疊,所以要在第一個真實樣本前面放 $M-1$ 個零把它啟動。此後這台機器就可以永遠跑下去,不再有任何特例:每做一次變換,吃進 $N-M+1$ 個新樣本,吐出 $N-M+1$ 個完成品。效率由變換中做有用功的比例 $(N-M+1)/N$ 衡量,這就是為什麼 $N$ 通常取成 $M$ 的好幾倍——大到讓丟掉的那顆頭只是一點小稅,又小到讓每個樣本的 $\log N$ 代價維持在低檔。この勘定から実務上の細かな点が出てくる。最初のブロックには重ねるべき前のブロックがないので、最初の実標本の前に $M-1$ 個の零を置いて起動する。それ以降この機械は特例なしに永久に回り、変換一回あたり $N-M+1$ 個の新しい標本を飲み込み、$N-M+1$ 個の仕上がった標本を吐き出す。効率は、変換のうち有用な仕事をしている割合 $(N-M+1)/N$ で測られる。$N$ をふつう $M$ の数倍にとるのはそのためである。捨てる頭が小さな税で済む程度には大きく、標本あたりの $\log N$ の費用が低いままである程度には小さく、という具合である。
Overlap-add (§8.6.4) keeps every output sample correct by never letting the fold happen at all: it pads each block to $N \ge L+M-1$ first, so $M-1$ zeros ride into the FFT doing no useful work, and each block's tail has to be held until the next block's head arrives to complete it. Overlap-save fills the transform with data instead, needs no adder on the output side at all — just a copy — and a block's output is final the instant it is computed. For a real-time filter that difference is latency and state, not arithmetic: the asymptotic cost of the two methods is the same. Note that §8.6.4 writes the filter length as $P$ where this section writes $M$.重疊相加法(§8.6.4)讓每個輸出樣本都正確,靠的是根本不讓摺疊發生:它先把每個區塊補零到 $N \ge L+M-1$,於是有 $M-1$ 個零搭著便車進了 FFT,什麼也沒做;而且每個區塊的尾巴必須留著,等下一個區塊的頭到了才補齊。重疊保留法則把整個變換都填滿資料,輸出端根本不需要加法器——只要複製——而且一個區塊的輸出在算完的那一刻就是定案。對即時濾波器而言,這個差別在於延遲與狀態,而不在於算術:兩種方法的漸近計算量是相同的。請注意 §8.6.4 把濾波器長度寫成 $P$,本節寫成 $M$。重畳加算法(§8.6.4)は、すべての出力標本を正しく保つために、そもそも折り返しを起こさせない。各ブロックをまず $N \ge L+M-1$ までゼロ詰めするので、$M-1$ 個の零が何の役にも立たないまま FFT に乗り込み、しかも各ブロックの尾は、次のブロックの頭が届いて完成するまで抱えておかねばならない。重畳保留法はその代わりに変換をデータで埋め尽くす。出力側に加算器はいっさい要らず、複写するだけでよい。ブロックの出力は計算し終えたその瞬間に確定する。実時間の濾波器にとって、この差は演算量ではなく遅延と状態の差である。二つの手法の漸近的な計算量は同じである。なお §8.6.4 はフィルタの系列長を $P$ と書き、本節は $M$ と書く。
This is the most direct use of the formula there is. Suppose you want better frequency selectivity than an ordinary FFT gives, which calls for a long window function $w[n]$ of length $P \cdot N$ — but you only want to perform an $N$-point FFT:這是最直接使用這個公式的例子。假設你想要比一般 FFT 更好的頻率選擇性,需要用一個長度為 $P \cdot N$ 的長視窗函數 $w[n]$,但你只想做 $N$ 點 FFT:これはこの公式をもっとも直接に使う例である。ふつうの FFT よりよい周波数選択性が欲しく、そのために長さ $P \cdot N$ の長い窓関数 $w[n]$ が要るが、行いたい FFT は $N$ 点だけだとしよう:
By the derivation of this section, the result of that $N$-point FFT is exactly equal to the DTFT of the length-$P \cdot N$ windowed sequence, sampled at $N$ frequency points. You have spent only the arithmetic of an $N$-point FFT, yet you obtain the low sidelobes and narrow transition band that the long window brings.依照本節的推導,這個 $N$ 點 FFT 的結果,恰好等於長度 $P \cdot N$ 的加窗序列在 $N$ 個頻率點上的 DTFT 取樣。你只花了 $N$ 點 FFT 的運算量,卻得到長窗所帶來的低旁瓣、窄過渡帶。本節の導出によれば、この $N$ 点 FFT の結果は、長さ $P \cdot N$ の窓掛け系列の DTFT を $N$ 個の周波数点で標本化したものにちょうど等しい。支払ったのは $N$ 点 FFT の演算量だけなのに、長い窓がもたらす低いサイドローブと狭い遷移域が手に入る。
Observing a signal for $N$ samples and no more is itself a multiplication by a rectangular window, and a rectangular window's own spectrum — the periodic sinc of §8.2.4 — has a main lobe $4\pi/N$ wide and sidelobes only $13$ dB down. Every tone in the signal arrives in the DFT wearing that shape, so a strong tone smears energy across distant bins and buries a weak neighbour. That smearing is spectral leakage, and §8.7.2–§8.7.3 take it up in full. A longer, smoothly tapered window has lower sidelobes and leaks less; but a window longer than the FFT cannot be used — unless the fold of this section is used to bring it back inside $N$ points first. That is exactly what WOLA does. The $P$ here is the $P$ of the note on letters at the head of this section.只觀察一個訊號 $N$ 個樣本、不再多,這件事本身就是乘上一個矩形窗,而矩形窗自己的頻譜——§8.2.4 的週期性 sinc——主瓣寬 $4\pi/N$,旁瓣只低 $13$ dB。訊號裡的每一個音進到 DFT 時都穿著那個形狀,所以強音會把能量抹到很遠的頻格上去,把弱的鄰居埋掉。這種抹開就是頻譜洩漏,§8.7.2–§8.7.3 會完整處理它。比較長、邊緣平緩收斂的視窗旁瓣較低、洩漏較少;但比 FFT 還長的視窗是用不了的——除非先用本節的摺疊把它收回 $N$ 點之內。WOLA 做的正是這件事。這裡的 $P$ 就是本節開頭「關於符號」那則註記裡的 $P$。信号をちょうど $N$ 標本だけ観測するという行為は、それ自体が矩形窓を掛けることであり、矩形窓そのもののスペクトル —— §8.2.4 の周期 sinc —— は主ローブの幅が $4\pi/N$、サイドローブはわずか $13$ dB しか下がらない。信号中のどの音も DFT にはその形をまとって現れるので、強い音は遠くのビンまでエネルギーを塗り広げ、弱い隣人を埋めてしまう。この塗り広がりがスペクトル漏れであり、§8.7.2–§8.7.3 が本格的に扱う。長く、端がなだらかに絞られた窓はサイドローブが低く、漏れも少ない。しかし FFT より長い窓は使えない —— 本節の折りたたみでそれをまず $N$ 点の中へ戻してやらないかぎりは。WOLA が行うのはまさにそれである。ここでの $P$ は、本節の冒頭の「記号についての注意」で述べた $P$ である。
What makes it work is one line of algebra, and the only fact it uses is that the twiddle factor cannot tell $n$ from $n + rN$, because $W_N^{kN} = 1$:讓它成立的只有一行代數,而它用到的唯一事實是:旋轉因子分不出 $n$ 與 $n + rN$ 的差別,因為 $W_N^{kN} = 1$:これが成り立つ理由は一行の代数にすぎず、使う事実は一つだけである。$W_N^{kN} = 1$ なので、回転因子には $n$ と $n + rN$ の区別がつかない:
Read right to left, that chain is this section run backwards. There, DTFT samples were taken first and a fold was discovered in the time domain; here the fold is performed first, and the $N$-point DFT of the folded block is — by the same identity — the DTFT of the entire $PN$-sample windowed segment, sampled on the $N$-point grid. You paid for one $N$-point FFT and $PN$ multiply-accumulates, and you received the resolution and sidelobe suppression of a $PN$-long window. Nothing was approximated: the equality is exact.從右往左讀,這條等式鏈就是本節倒過來跑。在那裡是先取 DTFT 的樣本,然後在時域發現了一個摺疊;在這裡是先把摺疊做出來,而摺疊後區塊的 $N$ 點 DFT——依據同一個恆等式——就是整段 $PN$ 個樣本的加窗序列的 DTFT,在 $N$ 點格子上取樣的結果。你付的是一次 $N$ 點 FFT 加 $PN$ 次乘加,拿到的是長度 $PN$ 的視窗所給的解析度與旁瓣抑制。這裡沒有任何近似:這個等號是精確的。右から左へ読めば、この等式の連なりは本節を逆向きに走らせたものである。あちらでは先に DTFT の標本をとり、時間領域に折り返しを見つけた。こちらでは先に折りたたみを実行し、折りたたんだブロックの $N$ 点 DFT が —— 同じ恒等式によって —— 窓を掛けた $PN$ 標本全体の DTFT を $N$ 点格子上で標本化したものになる。支払ったのは $N$ 点 FFT 一回と $PN$ 回の積和であり、受け取ったのは長さ $PN$ の窓がもたらす分解能とサイドローブ抑制である。近似はどこにもない。この等号は厳密である。
Written as a filter instead of as a fold, step 2 is a bank of $N$ short FIR filters: output sample $n$ of the folded block is $\sum_{r} w[n+rN]\,x[n+rN]$, which touches only every $N$-th input sample, so each of the $N$ positions gets its own length-$P$ filter taken from a different phase of the long window. That decomposition is the polyphase(多相)form, and the whole structure — long prototype window, fold, FFT — is a polyphase filter bank, or a channelizer when the point of it is to split a band. Each DFT bin $k$ becomes a bandpass channel centred at $\omega = 2\pi k / N$, whose shape is the frequency response of the prototype window. The number of channels and the quality of each channel have been decoupled: $N$ sets the first, $P$ sets the second.若把第 2 步寫成濾波器而不是摺疊,它就是一組 $N$ 個短 FIR 濾波器:摺疊後區塊的第 $n$ 個輸出樣本是 $\sum_{r} w[n+rN]\,x[n+rN]$,它只碰到每隔 $N$ 個的輸入樣本,所以這 $N$ 個位置各自有一個長度為 $P$ 的濾波器,取自長視窗的不同相位。這個分解就是多相(polyphase)形式,而整個結構——長原型視窗、摺疊、FFT——就是多相濾波器組;當它的目的是把一個頻帶切開時,也叫通道化器(channelizer)。每一個 DFT 頻格 $k$ 都變成一條中心在 $\omega = 2\pi k / N$ 的帶通通道,形狀就是原型視窗的頻率響應。通道的數目與每條通道的品質因此被解耦了:$N$ 決定前者,$P$ 決定後者。第 2 段階を折りたたみではなくフィルタとして書けば、それは $N$ 個の短い FIR フィルタの集まりである。折りたたんだブロックの第 $n$ 標本は $\sum_{r} w[n+rN]\,x[n+rN]$ であり、$N$ 個おきの入力標本にしか触れない。したがって $N$ 個の位置はそれぞれ、長い窓の異なる位相から取った長さ $P$ のフィルタをもつ。この分解が多相(polyphase)形式であり、全体の構造 —— 長いプロトタイプ窓、折りたたみ、FFT —— が多相フィルタバンクである。帯域を切り分けることが目的ならチャネライザ(channelizer)とも呼ばれる。DFT の各ビン $k$ は $\omega = 2\pi k / N$ を中心とする帯域通過チャネルになり、その形はプロトタイプ窓の周波数応答そのものである。チャネルの数と一本一本の品質は、こうして切り離された。前者を決めるのが $N$、後者を決めるのが $P$ である。
§9.5 arrives at this picture from time–frequency analysis rather than from the DFT: it reads the short-time Fourier transform as a bank of $N$ bandpass channels, each one shifting the band around $\omega_k = 2\pi k/N$ down to DC, lowpass filtering with the window, and downsampling by the hop. Weighted overlap-add is what that filter bank becomes when the window is deliberately made several times longer than the FFT — which is exactly why the method is named after overlap-add: the fold here is the analysis-side mirror of the overlapped blocks §9.6 adds back on the synthesis side.§9.5 是從時頻分析而不是從 DFT 這一側走到同一幅圖的:它把短時傅立葉變換讀成 $N$ 條帶通通道,每一條把 $\omega_k = 2\pi k/N$ 附近的頻帶搬到直流、用視窗做低通濾波,再依跳距降取樣。加權疊加法就是當視窗被刻意做成 FFT 長度的好幾倍時,那個濾波器組所變成的樣子——這也正是這個方法要以「疊加」命名的原因:這裡的摺疊,是 §9.6 在合成端重新加回去的那些重疊區塊在分析端的鏡像。§9.5 は、DFT の側からではなく時間周波数解析の側から同じ絵にたどり着く。短時間フーリエ変換を $N$ 本の帯域通過チャネルの集まりとして読み、各チャネルは $\omega_k = 2\pi k/N$ のまわりの帯域を直流へ移し、窓関数で低域通過濾波し、ホップだけ間引く。重み付き重畳加算とは、窓を FFT の何倍にもわざと長くしたときに、そのフィルタバンクがなるものである。この手法が「重畳加算」の名を冠するのもまさにそのためで、ここでの折りたたみは、§9.6 が合成側で足し戻す重なったブロックの、分析側における鏡像なのである。
This way of working is used widely in:這種做法廣泛用於:このやり方は、次のような場面で広く使われている:
OFDM — used by Wi-Fi and by 4G and 5G alike — puts a stretch of cyclic prefix in front of every symbol. The aim is to make the channel's linear convolution "look", at the receiver, exactly like a circular convolution. The receiver then only has to take an $N$-point FFT, and every subcarrier is equalised by dividing by a single complex number.OFDM(Wi-Fi、4G/5G 都使用)在每個符元前面加上一段循環字首。目的是讓通道的線性摺積,在接收端「看起來」恰好等於循環摺積。這樣接收端只要做 $N$ 點 FFT,每個子載波就只需除以一個複數就能完成等化。OFDM(Wi-Fi も 4G/5G も使っている)は、どのシンボルの前にも巡回プレフィックスの一区間を置く。狙いは、チャネルの線形畳み込みを受信側で「ちょうど円状畳み込みに見える」ようにすることである。そうすれば受信側は $N$ 点 FFT をとるだけでよく、どのサブキャリアも複素数一個で割れば等化が済む。
Why that is worth doing is the contrast between the two deconvolutions. A radio channel convolves the transmitted symbol with its impulse response $h[n]$ — the multipath echoes — and that convolution is linear. Undoing a linear convolution means deconvolution, which is expensive and badly conditioned wherever $H(e^{j\omega})$ is small. Undoing a circular convolution costs one complex division per bin, because the DFT diagonalises it: $x \circledast h \leftrightarrow X[k]H[k]$, the property §8.6.1 proves.這件事值得做的理由,在於兩種解摺積的對比。無線通道會把送出去的符元與它的脈衝響應 $h[n]$ 做摺積——那些多重路徑的回波——而這個摺積是線性的。要還原線性摺積就得做解摺積,代價昂貴,而且在 $H(e^{j\omega})$ 很小的地方條件極差。要還原循環摺積,每個頻格只要一次複數除法,因為 DFT 把它對角化了:$x \circledast h \leftrightarrow X[k]H[k]$,這是 §8.6.1 證明的性質。これを行う値打ちは、二種類の逆畳み込みの対比にある。無線チャネルは、送られたシンボルを自身のインパルス応答 $h[n]$ —— すなわち多重経路の反射 —— と畳み込む。そしてその畳み込みは線形である。線形畳み込みをほどくには逆畳み込みが要る。高価であり、$H(e^{j\omega})$ の小さいところでは条件が悪い。円状畳み込みをほどくのはビンあたり一回の複素除算で済む。DFT がそれを対角化するからであり、$x \circledast h \leftrightarrow X[k]H[k]$ は §8.6.1 が証明する性質である。
So OFDM buys the circular convolution outright. Before each $N$-sample symbol it transmits a copy of that symbol's own last $M-1$ samples, the cyclic prefix(循環字首). While the prefix goes by, the channel's delay line fills with samples that are, modulo $N$, precisely the ones a circular convolution would have called for. The receiver discards the prefix, and the $N$ samples it keeps are exactly $x \circledast h$. One $N$-point FFT later, every subcarrier is equalised by dividing by a single complex number $H[k]$.所以 OFDM 乾脆把循環摺積買下來。在每個 $N$ 樣本的符元之前,它先送出該符元自己最後 $M-1$ 個樣本的複本,也就是循環字首(cyclic prefix)。在字首通過的這段期間,通道的延遲線被填進去的樣本,對 $N$ 取模之後,恰好就是循環摺積會要用到的那些。接收端把字首丟掉,留下的 $N$ 個樣本正是 $x \circledast h$。再做一次 $N$ 點 FFT,每個子載波就只要除以一個複數 $H[k]$ 即可完成等化。そこで OFDM は、円状畳み込みを正面から買い取る。$N$ 標本のシンボルごとに、その直前へシンボル自身の末尾 $M-1$ 標本の複製を送る。これが巡回プレフィックス(cyclic prefix)である。プレフィックスが通り過ぎるあいだに、チャネルの遅延線は、$N$ を法として見ればまさに円状畳み込みが必要としたはずの標本で満たされる。受信側はプレフィックスを捨て、残した $N$ 標本はちょうど $x \circledast h$ になる。$N$ 点 FFT を一回かければ、どのサブキャリアも一個の複素数 $H[k]$ で割るだけで等化できる。
This too is exploiting the exact relationship between the DFT and circular (aliased) convolution: rather than avoid the wrap-around, design the system so that the result of the wrap-around is precisely the one you wanted.這也是在利用 DFT 與循環(混疊)摺積之間的精確關係:與其避免繞回,不如把系統設計成繞回的結果正好是我們要的。これもまた、DFT と円状(エイリアシングを受けた)畳み込みとのあいだの厳密な関係を利用している。巻き戻りを避けるのではなく、巻き戻った結果がちょうど望みのものになるように系を設計するのである。
The price is the prefix itself: it must be at least as long as the channel's delay spread, $M-1$ samples, and those samples carry no new information. That is the same $M-1$ overlap-save throws away — paid for in advance here, discarded afterwards there.代價就是字首本身:它的長度至少要等於通道的延遲擴展,也就是 $M-1$ 個樣本,而這些樣本不帶任何新資訊。這和重疊保留法丟掉的是同一個 $M-1$——只是在這裡是事先付掉,在那裡是事後丟掉。代償はプレフィックスそのものであり、その長さは少なくともチャネルの遅延スプレッド、すなわち $M-1$ 標本なければならず、しかもその標本は新しい情報を何も運ばない。これは重畳保留法が捨てるのと同じ $M-1$ である。こちらでは前払いし、あちらでは後から捨てる。
| Use | Attitude to aliasing | What this formula contributes |
|---|---|---|
| FFT convolution, zero padding (§8.6.3, §8.7.1) | Avoid | Fixes the minimum FFT length, $N \ge L+M-1$ |
| Numerical computation of an endless impulse response | Control | Estimates how many frequency points are enough to be accurate |
| Frequency-sampling FIR design | Understand | Explains where the design error comes from |
| Overlap-save (§8.6.4) | Exploit, then discard | Points out exactly which samples are contaminated |
| WOLA / polyphase filter bank | Create on purpose | Obtains a long window's spectrum from a short FFT |
| OFDM cyclic prefix | Shape it into the wanted form | Turns channel equalisation into a simple division |
| 用途 | 對混疊的態度 | 這個公式的角色 |
|---|---|---|
| FFT 摺積、補零(§8.6.3、§8.7.1) | 避免 | 決定 FFT 長度至少要多少,$N \ge L+M-1$ |
| 無限長脈衝響應的數值計算 | 控制 | 估計需要多少頻率點才夠準 |
| 頻率取樣法設計 FIR | 理解 | 解釋設計誤差從哪裡來 |
| Overlap-save(§8.6.4) | 利用後丟棄 | 指出哪些樣本被污染 |
| WOLA/多相濾波器組 | 刻意製造 | 用短 FFT 得到長窗的頻譜 |
| OFDM 循環字首 | 讓它變成想要的形式 | 使通道等化變成簡單的除法 |
| 使い道 | エイリアシングへの構え | この公式が果たす役割 |
|---|---|---|
| FFT 畳み込み、ゼロ詰め(§8.6.3、§8.7.1) | 避ける | FFT の最小の系列長 $N \ge L+M-1$ を定める |
| 無限長インパルス応答の数値計算 | 制御する | 十分に正確であるために周波数点がいくつ要るかを見積もる |
| 周波数標本化法による FIR 設計 | 理解する | 設計誤差の出どころを説明する |
| Overlap-save(§8.6.4) | 利用してから捨てる | どの標本が汚染されるかを正確に指す |
| WOLA/多相フィルタバンク | わざと起こす | 短い FFT で長い窓関数のスペクトルを得る |
| OFDM 巡回プレフィックス | 欲しい形に仕立てる | チャネル等化を単純な除算に変える |
So the value of this result is not "aliasing is bad, avoid it". It is that it describes the aliasing exactly. Once you know how the aliasing happens, you can design a system to avoid it, to control it, or even to exploit it.所以這個公式的價值不在於「混疊很糟,要避開」,而在於它精確地描述了混疊。知道它怎麼發生,就能設計系統去避開、控制,甚至利用它。つまりこの結果の値打ちは、「エイリアシングは悪いから避けよ」という点にあるのではない。エイリアシングを正確に記述しているという点にある。それがどう起こるかを知ってしまえば、それを避ける系も、制御する系も、さらには利用する系さえも設計できる。
What time-domain operation corresponds to multiplying two DFTs? Not linear convolution — because of the implicit periodicity, it is circular convolution(循環摺積), written $\circledast$ or $\overset{N}{\circledast}$:把兩個 DFT 相乘,對應到時域的哪一種運算?不是線性摺積——因為那個隱含的週期性,對應到的是循環摺積,記為 $\circledast$ 或 $\overset{N}{\circledast}$:二つの DFT を掛けることは、時間領域のどんな演算に対応するのか。線形畳み込みではない。暗黙の周期性のために、対応するのは円状畳み込みであり、$\circledast$ または $\overset{N}{\circledast}$ と書く:
Mechanically it is the same flip-shift-multiply-sum recipe as linear convolution, except the flip and shift are circular: $x_2$ is reversed around the circle and rotated by $n$ positions. Both sequences must be defined on (or zero-padded to) the same length $N$, and the output also has length $N$.操作上,它和線性摺積是同一套「翻轉—平移—相乘—求和」的流程,只是翻轉與平移都是循環的:$x_2$ 沿著圓周反轉,再旋轉 $n$ 格。兩個序列都必須定義在(或補零到)同樣的長度 $N$,輸出的長度也是 $N$。手順としては線形畳み込みと同じ「反転・シフト・乗算・総和」の段取りだが、反転とシフトが円状である点が違う。$x_2$ は円に沿って反転され、$n$ 目盛りだけ回転される。二つの系列はどちらも同じ長さ $N$ の上で定義されていなければならない(あるいはそこまでゼロ詰めする)。出力の長さも $N$ である。
That recipe hides a sign trap. Reversing is the easy half: §8.4.2 already turned $((-m))_N$ into a picture. The half that is routinely got backwards is the shift, because the bracket already carries a minus sign and the shift has to pass through it. Write $g$ for $x_1$ and $h$ for $x_2$, so that the definition above reads $y[n] = \sum_m g[m]\,h[((n-m))_N]$.這套流程藏了一個正負號的陷阱。反轉那一半是容易的:§8.4.2 已經把 $((-m))_N$ 畫成圖了。真正容易弄反的是平移,因為括號裡本來就帶著一個負號,而平移必須穿過這個負號。以下把 $x_1$ 寫成 $g$、$x_2$ 寫成 $h$,上面的定義就讀作 $y[n] = \sum_m g[m]\,h[((n-m))_N]$。この段取りには符号の落とし穴が一つ隠れている。反転のほうは易しい。§8.4.2 がすでに $((-m))_N$ を絵にしてある。取り違えられやすいのはシフトのほうである。括弧の中にはもともと負号があり、シフトはその負号を通り抜けなければならないからである。以下では $x_1$ を $g$、$x_2$ を $h$ と書く。すると上の定義は $y[n] = \sum_m g[m]\,h[((n-m))_N]$ と読める。
Nothing beyond substitution is needed. The row that produces $y[0]$ is the reversal on its own and calls for no shift at all, which is why that row is almost always right; the first row that does need a shift is where the sign goes astray. Put $n = 1$ into the general formula — which is the definition itself — and read off what the bracket contains:要做的事不過是代入。算 $y[0]$ 的那一排就是反轉本身,根本不必平移,所以那一排幾乎不會錯;第一排真正需要平移的,才是正負號走偏的地方。一般式就是定義本身,把 $n = 1$ 代進去,再看看括號裡留下什麼:必要なのは代入だけである。$y[0]$ を作る一行は反転そのものであってシフトをまったく含まないので、その行はまず間違えない。符号が狂うのは、シフトを要する最初の一行である。一般式とは定義そのものであり、そこに $n = 1$ を代入して括弧の中に何が残るかを読めばよい。
What stands inside the bracket is $+1$, not $-1$.括號裡的是 $+1$,不是 $-1$。括弧の中に立っているのは $+1$ であって、$-1$ ではない。
Why it is $+1$. Let the reversed sequence be $h_r[m] = h[((-m))_4]$. "Shifting $h_r$ one step to the right" subtracts $1$ from the variable $m$ — not from the argument of $h$ inside the bracket:為什麼是 $+1$。令反轉後的序列為 $h_r[m] = h[((-m))_4]$。所謂「把 $h_r$ 往右平移 1 格」,是在變數 $m$ 上減 1,而不是在 $h$ 的括號裡減 1:なぜ $+1$ になるのか。反転後の系列を $h_r[m] = h[((-m))_4]$ とおく。「$h_r$ を右へ 1 目盛りずらす」とは、変数 $m$ から $1$ を引くことであって、括弧の中にある $h$ の引数から $1$ を引くことではない。
The minus sign in front turns the subtraction over, so what is left inside the bracket is $+1$. The same two lines with a shift of $n$ in place of $1$ hand the definition straight back:減號被前面的負號翻了過來,所以括號裡變成 $+1$。把 1 換成 $n$,同樣這兩行就把定義本身原封不動地還了回來:前に付いた負号が引き算をひっくり返すので、括弧の中に残るのは $+1$ である。$1$ の代わりに $n$ だけずらしても同じ二行であり、こんどは定義そのものがそのまま戻ってくる。
Checking it on numbers. Take $g = [1, 2, 3, 4]$ and $h = [1, 1, 0, 0]$, $N = 4$. Each row below is one whole multiply-and-sum pass: the four values the shifted $h$ presents at $m = 0, 1, 2, 3$, and the total they produce against $g$.用數字驗證。取 $g = [1, 2, 3, 4]$、$h = [1, 1, 0, 0]$,$N = 4$。下表每一列都是一整輪「相乘—求和」:平移後的 $h$ 在 $m = 0, 1, 2, 3$ 上交出的四個值,以及它們與 $g$ 相配之後的總和。数値で確かめる。$g = [1, 2, 3, 4]$、$h = [1, 1, 0, 0]$、$N = 4$ とする。下の表の各行は、掛けて足す操作をひと通り行ったものである。ずらした $h$ が $m = 0, 1, 2, 3$ で差し出す四つの値と、それらを $g$ と突き合わせて得られる総和である。
| $m = 0$ | $m = 1$ | $m = 2$ | $m = 3$ | $\sum_m g[m]\cdot(\cdot)$ | |
|---|---|---|---|---|---|
| $h[((-m))_4]$ (reversal) | $1$ | $0$ | $0$ | $1$ | $1 + 4 = 5 = y[0]$ ✓ |
| $h[((1 - m))_4]$ (shifted right by 1) | $1$ | $1$ | $0$ | $0$ | $1 + 2 = 3 = y[1]$ ✓ |
| $h[((-m - 1))_4]$ (the usual slip) | $0$ | $0$ | $1$ | $1$ | $3 + 4 = 7$ ✗ |
| $m = 0$ | $m = 1$ | $m = 2$ | $m = 3$ | $\sum_m g[m]\cdot(\cdot)$ | |
|---|---|---|---|---|---|
| $h[((-m))_4]$(反轉) | $1$ | $0$ | $0$ | $1$ | $1 + 4 = 5 = y[0]$ ✓ |
| $h[((1 - m))_4]$(右移 1 格) | $1$ | $1$ | $0$ | $0$ | $1 + 2 = 3 = y[1]$ ✓ |
| $h[((-m - 1))_4]$(常見的寫錯) | $0$ | $0$ | $1$ | $1$ | $3 + 4 = 7$ ✗ |
| $m = 0$ | $m = 1$ | $m = 2$ | $m = 3$ | $\sum_m g[m]\cdot(\cdot)$ | |
|---|---|---|---|---|---|
| $h[((-m))_4]$(反転) | $1$ | $0$ | $0$ | $1$ | $1 + 4 = 5 = y[0]$ ✓ |
| $h[((1 - m))_4]$(右へ 1 目盛り) | $1$ | $1$ | $0$ | $0$ | $1 + 2 = 3 = y[1]$ ✓ |
| $h[((-m - 1))_4]$(よくある誤り) | $0$ | $0$ | $1$ | $1$ | $3 + 4 = 7$ ✗ |
The third row is a shift one step to the left, not to the right. It is not meaningless — it computes a genuine output sample of the very same circular convolution, merely the wrong one: $y[((-1))_4] = y[3] = 7$, not $y[1]$.第三列其實是往左平移 1 格,不是往右。它並非沒有意義——它算出來的確實是同一個循環摺積的某個輸出樣本,只是算錯了那一個:$y[((-1))_4] = y[3] = 7$,不是 $y[1]$。三行目は右ではなく左へ 1 目盛りずらしたものである。無意味な値ではない。同じ円状畳み込みの本物の出力標本を計算してはいるのだが、求めたいものとは別の標本である。すなわち $y[((-1))_4] = y[3] = 7$ であって、$y[1]$ ではない。
The rule is: reverse first, then shift right by $n$ positions — the index is $((n-m))_N$. A minus sign in front of $m$ and a plus sign in front of $n$: those two signs are the whole of it. Writing $((-m-n))_N$ shifts the reversed sequence to the left instead and returns $y[((-n))_N]$.正確的規律是:先反轉,再往右平移 $n$ 格,索引是 $((n-m))_N$。$m$ 前面是負號、$n$ 前面是正號——整件事就只有這兩個符號。寫成 $((-m-n))_N$ 等於把反轉後的序列往左平移,拿回來的會是 $y[((-n))_N]$。規則はこうである。まず反転し、つぎに右へ $n$ 目盛りずらす。添字は $((n-m))_N$ である。$m$ の前が負号、$n$ の前が正号 —— 要するにこの二つの符号がすべてである。$((-m-n))_N$ と書けば、反転した系列を左へずらすことになり、戻ってくるのは $y[((-n))_N]$ である。
Let $x_1[n] = \{1, 1, 1, 1\}$ and $x_2[n] = \{1, 2, 3, 4\}$, $N = 4$.令 $x_1[n] = \{1, 1, 1, 1\}$、$x_2[n] = \{1, 2, 3, 4\}$,$N = 4$。$x_1[n] = \{1, 1, 1, 1\}$、$x_2[n] = \{1, 2, 3, 4\}$、$N = 4$ とする。
Let $x_1$ have length $L$ and $x_2$ length $P$. Their linear convolution $y_{\text{lin}}[n] = x_1[n] * x_2[n]$ has length $L + P - 1$. The $N$-point circular convolution is the linear result wrapped around a circle of length $N$:設 $x_1$ 長度為 $L$、$x_2$ 長度為 $P$。它們的線性摺積 $y_{\text{lin}}[n] = x_1[n] * x_2[n]$ 長度為 $L + P - 1$。而 $N$ 點的循環摺積,就是把這個線性結果繞在一個長度為 $N$ 的圓上:$x_1$ の長さを $L$、$x_2$ の長さを $P$ とする。両者の線形畳み込み $y_{\text{lin}}[n] = x_1[n] * x_2[n]$ の長さは $L + P - 1$ である。$N$ 点円状畳み込みとは、この線形の結果を長さ $N$ の円に巻きつけたものである:
If $N \ge L+P-1$ nothing wraps and $y_c = y_{\text{lin}}$. If $N$ is too small, the tail of $y_{\text{lin}}$ folds back onto its head — time aliasing again, this time caused by multiplying spectra sampled too coarsely.若 $N \ge L+P-1$,什麼都不會繞出去,$y_c = y_{\text{lin}}$。若 $N$ 太小,$y_{\text{lin}}$ 的尾巴就會折回來疊到頭上——又是時域混疊,這一次的成因是把取樣得太稀疏的頻譜相乘。$N \ge L+P-1$ であれば何も巻き込まれず、$y_c = y_{\text{lin}}$ となる。$N$ が小さすぎると、$y_{\text{lin}}$ の尾が頭の上へ折り返る —— またもや時間領域エイリアシングであり、今度の原因は粗く標本化しすぎたスペクトルどうしを掛けたことである。
To compute a linear convolution of a length-$L$ and a length-$P$ sequence with DFTs, zero-pad both to $$N \ge L + P - 1$$ then $\mathrm{IDFT}\{\,\mathrm{DFT}\{x_1\}\cdot\mathrm{DFT}\{x_2\}\,\} = x_1 * x_2$ exactly. In practice choose the next power of two $\ge L+P-1$ for FFT efficiency.要用 DFT 計算長度 $L$ 與長度 $P$ 兩個序列的線性摺積,先把兩者都補零到 $$N \ge L + P - 1$$ 則 $\mathrm{IDFT}\{\,\mathrm{DFT}\{x_1\}\cdot\mathrm{DFT}\{x_2\}\,\} = x_1 * x_2$ 完全成立。實務上會取大於等於 $L+P-1$ 的下一個 2 的冪次,以提高 FFT 的效率。長さ $L$ の系列と長さ $P$ の系列の線形畳み込みを DFT で計算するには、まず両方を $$N \ge L + P - 1$$ までゼロ詰めする。そうすれば $\mathrm{IDFT}\{\,\mathrm{DFT}\{x_1\}\cdot\mathrm{DFT}\{x_2\}\,\} = x_1 * x_2$ が厳密に成り立つ。実務では FFT の効率のため、$\ge L+P-1$ となる次の 2 のべき乗を選ぶ。
The fast-convolution recipe(快速摺積流程):快速摺積的流程:高速畳み込みの手順は次のとおり:
Cost: three FFTs plus $N$ multiplies $\approx \tfrac{3}{2}N\log_2 N + N$ complex multiplications, versus $LP$ for direct convolution — a huge win when both sequences are long. In MATLAB: y = ifft( fft(x1,N) .* fft(x2,N) ).計算量:三次 FFT 加上 $N$ 次乘法,約 $\tfrac{3}{2}N\log_2 N + N$ 次複數乘法,相對於直接摺積的 $LP$ 次——當兩個序列都很長時,這是極大的勝利。在 MATLAB 中:y = ifft( fft(x1,N) .* fft(x2,N) )。計算量:FFT 三回に $N$ 回の乗算を加えて、$\approx \tfrac{3}{2}N\log_2 N + N$ 回の複素乗算。直接畳み込みの $LP$ 回に対して、どちらの系列も長いときには圧倒的な勝利である。MATLAB では y = ifft( fft(x1,N) .* fft(x2,N) ) とする。
The same wrap-around bites a second, less obvious case. The autocorrelation (Wiener–Khinchin) theorem of §4.5 is stated for the DTFT: it pairs $|X(e^{j\omega})|^2$ with the linear autocorrelation, which for a length-$N$ sequence runs over $2N-1$ lags $\ell = -(N\!-\!1)\dots N\!-\!1$. The obvious way to compute it — FFT, take $|\cdot|^2$, inverse FFT — silently gives something else: $N$ DFT magnitudes pair with the circular autocorrelation, and the outer lags fold back on top of the inner ones.同一種繞回還會在第二個、比較不明顯的地方咬人。§4.5 的自相關(Wiener–Khinchin)定理是針對 DTFT 敘述的:它把 $|X(e^{j\omega})|^2$ 與線性自相關配成一對;對長度 $N$ 的序列而言,線性自相關跑遍 $2N-1$ 個延遲 $\ell = -(N\!-\!1)\dots N\!-\!1$。而最直覺的算法——做 FFT、取 $|\cdot|^2$、再做反 FFT——悄悄給的是另一個東西:$N$ 個 DFT 振幅配的是循環自相關,外圍的延遲會摺回來疊在內圈上。同じ巻き込みは、二つめの、もっと気づきにくい場面でも噛みついてくる。§4.5 の自己相関(Wiener–Khinchin)定理は DTFT について述べられている。すなわち $|X(e^{j\omega})|^2$ と線形自己相関とを対にするものであり、長さ $N$ の系列ではその自己相関は $2N-1$ 個の遅れ $\ell = -(N\!-\!1)\dots N\!-\!1$ にわたる。ところが、いかにも素直な計算法 —— FFT をとり、$|\cdot|^2$ をとり、逆 FFT をとる —— は、黙って別のものを返す。$N$ 個の DFT 振幅が対になるのは円状自己相関であり、外側の遅れが内側の遅れの上へ折り返されるのである。
Two sequences can share all $N$ DFT magnitudes yet have genuinely different linear autocorrelations, because $2N-1$ lags carry more information than $N$ numbers. The fix is the same one as above: zero-pad to length $\ge 2N-1$ before the FFT.兩條序列可以共用全部 $N$ 個 DFT 振幅,卻有實實在在不同的線性自相關,因為 $2N-1$ 個延遲帶的資訊比 $N$ 個數字多。解法和上面完全一樣:做 FFT 之前先補零到長度 $\ge 2N-1$。二つの系列が $N$ 個の DFT 振幅をすべて共有していながら、線形自己相関は本当に異なる、ということがありうる。$2N-1$ 個の遅れは $N$ 個の数より多くの情報を担うからである。処方箋は上と同じで、FFT の前に長さ $\ge 2N-1$ までゼロ詰めすればよい。
Filtering a very long (possibly streaming) signal $x[n]$ with a length-$P$ FIR impulse response $h[n]$ cannot wait for the whole signal. Overlap-add(重疊相加法)processes it block by block:要用長度 $P$ 的 FIR 脈衝響應 $h[n]$ 去濾一個非常長(甚至是串流)的訊號 $x[n]$,不可能等整段訊號都到齊。重疊相加法(overlap-add)把它一塊一塊地處理:非常に長い(場合によっては流れ続ける)信号 $x[n]$ を長さ $P$ の FIR インパルス応答 $h[n]$ で濾波するとき、信号が全部そろうまで待つわけにはいかない。重畳加算法(overlap-add)はこれをブロックごとに処理する:
Linearity of convolution guarantees the sum is exactly $x[n]*h[n]$: since $x[n] = \sum_r x_r[n-rL]$, convolving term by term gives $y[n] = \sum_r (x_r * h)[n-rL]$.摺積的線性保證了這個總和恰好就是 $x[n]*h[n]$:因為 $x[n] = \sum_r x_r[n-rL]$,逐項摺積便得到 $y[n] = \sum_r (x_r * h)[n-rL]$。畳み込みの線形性が、この総和がちょうど $x[n]*h[n]$ になることを保証する。$x[n] = \sum_r x_r[n-rL]$ なので、項ごとに畳み込めば $y[n] = \sum_r (x_r * h)[n-rL]$ が得られる。
These are the letters this subsection uses. One of them is worth flagging: here $L$ is the length of a single block, not the length of the whole signal, which is the role $L$ plays in §8.5.4–§8.5.6.以下是本小節使用的字母。其中一個值得特別提醒:這裡的 $L$ 是單一區塊的長度,不是整段訊號的長度——後者才是 $L$ 在 §8.5.4–§8.5.6 中扮演的角色。本小節で用いる文字は次のとおりである。一つだけ注意を促しておきたい。ここでの $L$ は一つのブロックの長さであって、信号全体の系列長ではない。後者は §8.5.4–§8.5.6 における $L$ の役である。
| Symbol | Meaning |
|---|---|
| $x[n]$ | the very long input signal |
| $h[n]$ | the filter, of length $P$ (short) |
| $L$ | the length of one block |
| $x_r[n]$ | block $r$: the $L$ samples $x[rL], \dots, x[rL+L-1]$, re-indexed to start at $n = 0$ and zero everywhere else |
| $N$ | the FFT length, which has to satisfy $N \ge L+P-1$ (§8.6.3) |
| $*$ | linear convolution everywhere in this subsection — the result has to agree with ordinary convolution. §8.6.1 keeps $\circledast$ for the circular kind. |
| 符號 | 意義 |
|---|---|
| $x[n]$ | 很長的輸入訊號 |
| $h[n]$ | 濾波器,長度 $P$(很短) |
| $L$ | 每個區塊的長度 |
| $x_r[n]$ | 第 $r$ 個區塊:$x[rL], \dots, x[rL+L-1]$ 這 $L$ 個樣本,重新編號成從 $n = 0$ 開始,其餘位置為 $0$ |
| $N$ | FFT 長度,必須滿足 $N \ge L+P-1$(§8.6.3) |
| $*$ | 在本小節中一律指線性摺積——結果必須和一般摺積相同。§8.6.1 把 $\circledast$ 留給循環的那一種。 |
| 記号 | 意味 |
|---|---|
| $x[n]$ | 非常に長い入力信号 |
| $h[n]$ | フィルタ。系列長は $P$(短い) |
| $L$ | 一つのブロックの長さ |
| $x_r[n]$ | 第 $r$ ブロック:$x[rL], \dots, x[rL+L-1]$ の $L$ 標本を $n = 0$ から始まるように振り直したもの。他の位置は $0$ である |
| $N$ | FFT の系列長。$N \ge L+P-1$ を満たさねばならない(§8.6.3) |
| $*$ | 本小節では一貫して線形畳み込みを指す。結果はふつうの畳み込みと一致せねばならない。§8.6.1 は $\circledast$ を円状のほうに充てている。 |
The sentence above is worth writing out, because those two steps are the whole method. The blocks are a partition of $x[n]$ — nothing is dropped and nothing is counted twice — so putting each one back where it came from reassembles the signal exactly:上面那句話值得攝開來寫,因為那兩個步驟就是整個方法。這些區塊是 $x[n]$ 的一個分割——沒有漏掉任何東西,也沒有重複計算——所以把每一塊放回它原來的位置,就原原本本地拼回了整段訊號:上の一文は書き下しておく価値がある。その二つの段階こそが手法のすべてだからである。これらのブロックは $x[n]$ の分割である。落ちるものもなく、二重に数えられるものもない。したがって各ブロックを元の位置へ戻せば、信号はそのまま組み上がる:
Convolution is a linear operation, so $h$ may be pushed inside that sum and applied to one block at a time:摺積是線性運算,所以可以把 $h$ 推進這個總和裡面,一次只對一個區塊作用:畳み込みは線形演算なので、$h$ をその総和の内側へ押し込み、一度に一つのブロックへ作用させてよい:
Those two lines are the whole mathematical basis of the method. Everything that follows — the FFT, the zero padding, the overlapping tails — is bookkeeping in their service.這兩行就是整個方法的數學基礎。後面的一切——FFT、補零、重疊的尾巴——都只是為它們服務的帳務工作。この二行が手法の数学的な基礎のすべてである。これに続くもの —— FFT、ゼロ詰め、重なり合う尾 —— はいずれも、その二行に仕える帳簿づけにすぎない。
A block has length $L$. Convolved linearly with an $h$ of length $P$, its output has length一個區塊的長度是 $L$。它和長度 $P$ 的 $h$ 做線性摺積之後,輸出的長度是ブロックの長さは $L$ である。それを長さ $P$ の $h$ と線形に畳み込むと、出力の系列長は
— that is $P-1$ samples longer than the block it came from. Block $r$'s output therefore trails $P-1$ samples past the end of block $r$'s own stretch of time and into block $r+1$'s, so consecutive output blocks share exactly $P-1$ samples, and on that stretch the two contributions have to be added. Both halves of the name come from this one sentence: the outputs overlap, and the overlap is settled by an add. Note that the figure $P-1$ does not involve $L$ at all — lengthening the blocks does not lengthen the overlap, it only makes the overlap a smaller fraction of each block.——比它來自的那個區塊長了 $P-1$ 個樣本。於是第 $r$ 塊的輸出會拖著 $P-1$ 個樣本,越過第 $r$ 塊自己那段時間的尾端,伸進第 $r+1$ 塊的範圍,所以相鄰的輸出區塊恰好共用 $P-1$ 個樣本,在這一段上兩邊的貢獻必須相加。名稱的兩半都出自這一句話:輸出會重疊,而重疊是用相加來結清的。請注意 $P-1$ 這個數字裡完全沒有 $L$——把區塊拉長並不會把重疊拉長,只會讓重疊在每塊中所佔的比例變小。—— すなわち、元のブロックより $P-1$ 標本だけ長い。したがって第 $r$ ブロックの出力は $P-1$ 標本ぶんの尾を引き、第 $r$ ブロック自身の時間区間の終わりを越えて第 $r+1$ ブロックの領域へ入り込む。隣り合う出力ブロックはちょうど $P-1$ 標本を共有し、その区間では両者の寄与を加算せねばならない。名前の前半も後半もこの一文から出ている。出力が重なり、その重なりは加算で決着する。$P-1$ という数には $L$ がまったく入っていないことに注意したい。ブロックを長くしても重なりは長くならず、重なりが各ブロックに占める割合が小さくなるだけである。
Two practical points that the three steps above leave implicit. First, the zero-padding condition $N \ge L+P-1$ is exactly the conclusion of §8.6.3: a product of DFTs is a circular convolution, and it agrees with the linear one only when the transform is long enough that nothing folds back onto itself (§8.6.2). Second, $H[k]$ — the $N$-point FFT of the zero-padded $h$ — depends on no block at all, so it is computed once and reused by every block; the recurring cost is one forward FFT, $N$ complex multiplies and one inverse FFT per block.上面三個步驟還留了兩個實務上的要點沒有講明。其一,補零條件 $N \ge L+P-1$ 正是 §8.6.3 的結論:DFT 相乘得到的是循環摺積,只有當變換長到不會有任何東西摺回自己身上時(§8.6.2),它才等於線性摺積。其二,$H[k]$——補零後的 $h$ 的 $N$ 點 FFT——根本不依賴於任何區塊,所以只需算一次,所有區塊共用;每塊反覆要付的代價是一次正向 FFT、$N$ 次複數乘法與一次反向 FFT。上の三つの手順が明言せずに残している実務上の要点が二つある。第一に、ゼロ詰めの条件 $N \ge L+P-1$ は §8.6.3 の結論そのものである。DFT の積は円状畳み込みであり、それが線形畳み込みと一致するのは、変換が十分に長く、何も自分自身の上へ折り返らないときだけである(§8.6.2)。第二に、$H[k]$ —— ゼロ詰めした $h$ の $N$ 点 FFT —— はどのブロックにも依存しないので、一度だけ計算してすべてのブロックで使い回せる。ブロックごとに繰り返し払う費用は、順変換の FFT 一回、$N$ 回の複素乗算、逆変換の FFT 一回である。
Choosing $L$ — the tradeoff. The larger $L$ is, the more output samples share the cost of one transform, so the arithmetic per sample falls; but latency and buffer memory both grow with $L$. The usual practice is to fix $N$ at a power of two and then take $L = N - P + 1$, the longest block that transform can carry without aliasing.選擇 $L$ 的取捨。$L$ 越大,一次變換的成本就被更多輸出樣本分攤,每個樣本的算術量就越低;但延遲與緩衝區記憶體也都隨 $L$ 一起變大。常見的做法是把 $N$ 固定為 2 的冪次,然後取 $L = N - P + 1$,也就是該變換在不產生混疊的前提下載得動的最長區塊。$L$ の選び方 —— 釣り合いの問題。$L$ が大きいほど一回の変換の費用をより多くの出力標本で分け合えるので、標本あたりの演算は減る。しかし遅延も緩衝記憶も $L$ とともに増える。よく行われるのは、$N$ を 2 の冪に固定したうえで $L = N - P + 1$ ととることである。これはその変換がエイリアシングを起こさずに運べる最長のブロックである。
A sibling method, overlap-save, runs the same block machinery on the opposite bargain: rather than padding the circular aliasing out of existence, it lets the aliasing happen and throws away the samples it spoiled. §8.5.5 item 4 derives it; the table sets the two side by side. Of the pair, overlap-add is the easier to reason about, because no output sample it produces is ever wrong — only ever incomplete until its tail arrives.另有一個兄弟方法叫重疊保留(overlap-save),它用同一套區塊機制,做的卻是相反的交易:它不靠補零把循環混疊消滅掉,而是讓混疊發生,再把被它弄壞的樣本丟掉。§8.5.5 第 4 項推導了它;下表把兩者並排對照。兩者之中,重疊相加比較好理解,因為它算出來的輸出樣本從來不會是錯的,只是在尾巴到齊之前暫時不完整而已。兄弟分の方法に重畳保留法(overlap-save)がある。同じブロックの仕掛けを、正反対の取引で回すものである。ゼロ詰めで円状のエイリアシングを消し去るのではなく、エイリアシングを起こさせたうえで、それが傷つけた標本を捨てる。§8.5.5 の第 4 項がこれを導いている。下の表は両者を並べて対照したものである。二つのうちでは重畳加算法のほうが筋道を追いやすい。生み出す出力標本が誤った値になることは決してなく、尾が届くまで未完成なだけだからである。
| Overlap-add | Overlap-save | |
|---|---|---|
| Input blocks | do not overlap; each is zero-padded | overlap by $P-1$ samples; no padding |
| Aliasing of the circular convolution | avoided outright by the padding | provoked on purpose |
| What happens to the output | the overlapping $P-1$ samples are added | the first $P-1$ contaminated samples are discarded |
| Extra arithmetic | an adder on the output side | none needed |
| 重疊相加 | 重疊保留 | |
|---|---|---|
| 輸入區塊 | 彼此不重疊,每塊補零 | 彼此重疊 $P-1$ 點,不補零 |
| 循環摺積的混疊 | 靠補零徹底避免 | 刻意讓它發生 |
| 輸出的處理 | 重疊的 $P-1$ 點相加 | 丟掉前 $P-1$ 個被污染的樣本 |
| 額外運算 | 輸出端要做加法 | 不需要加法 |
| 重畳加算法 | 重畳保留法 | |
|---|---|---|
| 入力ブロック | 互いに重ならず、各ブロックをゼロ詰めする | 互いに $P-1$ 標本ぶん重なり、ゼロ詰めはしない |
| 円状畳み込みのエイリアシング | ゼロ詰めによって完全に避ける | わざと起こさせる |
| 出力の扱い | 重なった $P-1$ 標本を加算する | 汚染された先頭 $P-1$ 標本を捨てる |
| 追加の演算 | 出力側に加算が要る | 加算は要らない |
The two cost about the same, and both are standard practice for real-time FFT filtering.兩者的運算量差不多,也都是即時 FFT 濾波的標準做法。両者の計算量はほぼ同じであり、どちらも実時間 FFT 濾波の標準的なやり方である。
Appending zeros to a length-$L$ signal before taking an $N$-point DFT ($N > L$) does not change its DTFT at all — the extra terms contribute nothing to the sum. It only changes where the DTFT is sampled: the grid spacing shrinks from $2\pi/L$ to $2\pi/N$. Zero padding(補零)therefore:在對長度為 $L$ 的訊號做 $N$ 點 DFT($N > L$)之前補上一些零,完全不會改變它的 DTFT——那些多出來的項對總和沒有任何貢獻。改變的只是在哪些地方對 DTFT 取樣:格點間距從 $2\pi/L$ 縮小為 $2\pi/N$。因此補零:長さ $L$ の信号に零を付け足してから $N$ 点 DFT($N > L$)をとっても、その DTFT はまったく変わらない。付け足した項は和に何も寄与しないからである。変わるのはDTFT をどこで標本化するかだけで、格子の間隔が $2\pi/L$ から $2\pi/N$ へ縮む。したがってゼロ詰めは:
Resolution is governed by the window's main-lobe width: a length-$L$ rectangular window has main-lobe width $4\pi/L$ (rad/sample), so two real tones closer than about $F_s/L$ Hz produce overlapping main lobes that merge into one bump. More data — not more zeros — is the only cure:解析度是由視窗主瓣的寬度決定的:長度 $L$ 的矩形窗主瓣寬度為 $4\pi/L$(rad/sample),所以兩個相距小於約 $F_s/L$ Hz 的實數音,其主瓣會重疊而糊成一個包。唯一的解法是增加資料,而不是增加零:分解能を支配するのは窓の主ローブ幅である。長さ $L$ の矩形窓の主ローブ幅は $4\pi/L$(rad/sample)なので、およそ $F_s/L$ Hz より近い二つの実数の音は主ローブが重なり、一つの膨らみに融けてしまう。唯一の治療法は零ではなくデータを増やすことである:
"Does zero padding improve frequency resolution?" No. It improves the apparent resolution (denser frequency grid, $F_s/N$) but the true resolution is fixed by the data record length ($\approx F_s/L$ for a rectangular window, worse for tapered windows). Be ready to state both formulas and the distinction.「補零能不能改善頻率解析度?」不能。它改善的是表面上的解析度(頻率格點更密,$F_s/N$),但真正的解析度由資料紀錄長度決定(矩形窗約為 $F_s/L$,錐形窗還更差)。要能同時寫出這兩條公式,並說清楚兩者的差別。「ゼロ詰めは周波数分解能を改善するか」しない。改善されるのは見かけの分解能(周波数格子が $F_s/N$ と密になる)だけで、真の分解能はデータ記録長で決まる(矩形窓なら $\approx F_s/L$、先細りの窓ではさらに悪い)。この二つの式と、その違いをいつでも述べられるようにしておくこと。
What if the signal is not time-limited? Keeping only $N$ samples is equivalent to multiplying by a window(窗函數): $x_w[n] = x[n]\,w[n]$. By the multiplication property, the spectrum becomes a convolution:如果訊號本身不是時間受限的呢?只保留 $N$ 個樣本,等同於乘上一個視窗:$x_w[n] = x[n]\,w[n]$。根據相乘性質,頻譜就變成一個摺積:信号が時間制限されていない場合はどうなるか。標本を $N$ 個だけ残すことは、窓関数を掛けることと等価である:$x_w[n] = x[n]\,w[n]$。乗算の性質により、スペクトルは畳み込みになる:
Each spectral line of $x[n]$ is replaced by a copy of the window's frequency response $W(e^{j\omega})$ — main lobe (width = blur) plus sidelobes (leakage). The windows highlighted in the lecture:$x[n]$ 的每一根譜線,都被換成視窗頻率響應 $W(e^{j\omega})$ 的一份複本——主瓣(寬度=模糊程度)加上旁瓣(洩漏)。課堂上強調的幾種視窗:$x[n]$ のスペクトル線は一本ごとに、窓の周波数応答 $W(e^{j\omega})$ の複製に置き換わる —— 主ローブ(幅=ぼけの度合い)とサイドローブ(漏れ)である。講義で取り上げた窓は次のとおり:
| Window ($0 \le n \le N-1$) | $w[n]$ | Main-lobe width | Peak sidelobe |
|---|---|---|---|
| Rectangular(矩形窗) | $1$ | $4\pi/N$ | $-13$ dB |
| Triangular / Bartlett(三角窗) | $1 - \dfrac{\left|\,n - \frac{N-1}{2}\right|}{\frac{N-1}{2}}$ | $8\pi/N$ | $-27$ dB |
| Generalized Hanning(廣義漢寧窗) | $\alpha - (1-\alpha)\cos\dfrac{2\pi n}{N-1}$ | $8\pi/N$ | — |
| · Hann ($\alpha = 0.5$) | $0.5 - 0.5\cos\dfrac{2\pi n}{N-1}$ | $8\pi/N$ | $-31$ dB |
| · Hamming ($\alpha = 0.54$) | $0.54 - 0.46\cos\dfrac{2\pi n}{N-1}$ | $8\pi/N$ | $-41$ dB |
| 視窗($0 \le n \le N-1$) | $w[n]$ | 主瓣寬度 | 最大旁瓣 |
|---|---|---|---|
| 矩形窗(rectangular) | $1$ | $4\pi/N$ | $-13$ dB |
| 三角窗/Bartlett | $1 - \dfrac{\left|\,n - \frac{N-1}{2}\right|}{\frac{N-1}{2}}$ | $8\pi/N$ | $-27$ dB |
| 廣義漢寧窗(generalized Hanning) | $\alpha - (1-\alpha)\cos\dfrac{2\pi n}{N-1}$ | $8\pi/N$ | — |
| · Hann($\alpha = 0.5$) | $0.5 - 0.5\cos\dfrac{2\pi n}{N-1}$ | $8\pi/N$ | $-31$ dB |
| · Hamming($\alpha = 0.54$) | $0.54 - 0.46\cos\dfrac{2\pi n}{N-1}$ | $8\pi/N$ | $-41$ dB |
| 窓($0 \le n \le N-1$) | $w[n]$ | 主ローブ幅 | 最大サイドローブ |
|---|---|---|---|
| 矩形窓(rectangular) | $1$ | $4\pi/N$ | $-13$ dB |
| 三角窓/Bartlett | $1 - \dfrac{\left|\,n - \frac{N-1}{2}\right|}{\frac{N-1}{2}}$ | $8\pi/N$ | $-27$ dB |
| 一般化 Hanning 窓 | $\alpha - (1-\alpha)\cos\dfrac{2\pi n}{N-1}$ | $8\pi/N$ | — |
| · Hann($\alpha = 0.5$) | $0.5 - 0.5\cos\dfrac{2\pi n}{N-1}$ | $8\pi/N$ | $-31$ dB |
| · Hamming($\alpha = 0.54$) | $0.54 - 0.46\cos\dfrac{2\pi n}{N-1}$ | $8\pi/N$ | $-41$ dB |
For fixed $N$, narrowing the main lobe (better resolution) and lowering the sidelobes (less leakage) pull in opposite directions. The rectangular window has the narrowest possible main lobe but the worst sidelobes; tapered windows (Hann, Hamming) double the main-lobe width in exchange for 20–30 dB less leakage. The only way to win on both axes is to increase $N$.在 $N$ 固定的前提下,把主瓣變窄(解析度更好)與把旁瓣壓低(洩漏更少)是互相拉扯的兩個方向。矩形窗有可能達到的最窄主瓣,但旁瓣也最糟;錐形窗(Hann、Hamming)把主瓣寬度加倍,換來 20–30 dB 更低的洩漏。唯一能在兩個軸上同時贏的方法,就是把 $N$ 加大。$N$ を固定したまま、主ローブを狭める(分解能を上げる)ことと、サイドローブを下げる(漏れを減らす)ことは互いに逆方向へ引っ張り合う。矩形窓は可能なかぎり狭い主ローブをもつが、サイドローブは最悪である。先細りの窓(Hann、Hamming)は主ローブ幅を倍にする代わりに、漏れを 20–30 dB 減らす。両方の軸で勝つ唯一の方法は $N$ を増やすことである。
Everything so far has accounted for leakage from the frequency side: the spectrum is convolved with $W(e^{j\omega})$ and the window's sidelobes smear each line. The same fact has a second account in the time domain, and it is that one which makes the cure obvious. Two matters of lettering first. Throughout this subsection $N$ is both the window length and the DFT length — nothing here is zero-padded — so the letter agrees with the window table above, which defines its windows over $0 \le n \le N-1$. §8.7.3 instead writes $L$ for the window length and keeps $N$ for the DFT length; as that section says where it fixes its own convention, the two spellings name one and the same quantity. And $((n))_N$ means $n$ modulo $N$, the notation of §8.2.1.到這裡為止,洩漏都是從頻域那一側解釋的:頻譜與 $W(e^{j\omega})$ 做摺積,視窗的旁瓣把每一根譜線抹開。同一件事還有第二種說法,在時域裡,而且是那個說法讓「要怎麼治」變得顯而易見。先交代兩件符號的事。在這一小節裡,$N$ 同時是視窗長度與 DFT 點數——這裡沒有補零——所以這個字母與上面那張視窗表一致,該表把視窗定義在 $0 \le n \le N-1$ 上。§8.7.3 則把視窗長度寫成 $L$,把 $N$ 留給 DFT 點數;正如該節立下自己的慣例時所說,兩種寫法指的是同一個量。另外,$((n))_N$ 表示 $n$ 對 $N$ 取餘數,是 §8.2.1 的記號。ここまで、漏れはつねに周波数領域の側から説明してきた。スペクトルが $W(e^{j\omega})$ と畳み込まれ、窓のサイドローブが各スペクトル線をにじませる、という説明である。同じ事実には時間領域からの第二の説明があり、処方箋が自明になるのはそちらのほうである。先に記号を二つ決めておく。本小節を通じて $N$ は窓の系列長であり、同時に DFT の系列長でもある——ここではゼロ詰めを行わない——ので、窓を $0 \le n \le N-1$ の上で定義する上の窓の表と文字が一致する。§8.7.3 は窓の系列長を $L$ と書き、$N$ を DFT の系列長に残している。同節が自らの約束を定める箇所で述べているとおり、二つの書き方は同一の量を指す。また $((n))_N$ は $n$ を $N$ で割った余りであり、§8.2.1 の記法である。
Time domain (panel ② of the figure below): the $N$ points hold exactly 3 whole periods, so when the DFT extends them periodically the seam joins smoothly and the result agrees exactly with the true continuous cosine (dashed). What the DFT "sees" is an infinitely long pure cosine.時域(下圖面板 ②):$N$ 點內剛好 3 個完整週期,DFT 把這段週期延伸後,接縫處平順銜接,和真正的連續餘弦(虛線)完全一致。DFT「看到」的就是一個無限長的純餘弦。時間領域(下図のパネル ②):$N$ 点のなかにちょうど 3 周期分が収まっているので、DFT がこれを周期的に延長しても継ぎ目はなめらかにつながり、真の連続余弦(破線)と完全に一致する。DFT が「見ている」のは無限に長い純粋な余弦である。
Frequency domain (panel ③): the grey curve is the periodic sinc that the finite length produces (§8.2.4), centred on $k = r$ and $k = N - r$. The DFT samples that curve one bin apart, and the zeros of the sinc also fall exactly one bin apart. So apart from the two peaks, every sample lands precisely on a zero and only two lines appear. This is why the cosine of §8.2.3 gives exactly two spikes.頻域(面板 ③):灰色曲線是有限長度造成的週期性 sinc(§8.2.4),以 $k = r$ 和 $k = N - r$ 為中心。DFT 的取樣點間距是 1 個 bin,而 sinc 的零點也恰好每隔 1 個 bin 出現一次。所以除了兩個峰值以外,每個取樣點都正好落在零點上,看起來只有兩根。這就是 §8.2.3 那個餘弦例子只有兩根譜線的原因。周波数領域(パネル ③):灰色の曲線は有限の長さが生む周期 sinc(§8.2.4)であり、$k = r$ と $k = N - r$ を中心にもつ。DFT の標本点の間隔は 1 bin であり、この sinc の零点もちょうど 1 bin ごとに現れる。したがって二つの頂点を除けば、どの標本点もぴたりと零点の上に落ちるので、線は二本しか見えない。§8.2.3 の余弦がちょうど二本のスペクトル線になるのはこのためである。
Note that the grey curve — the DTFT — has sidelobes of its own: the leakage is there the whole time. The samples merely happen to miss it, so the DFT does not show it.注意:灰色曲線(DTFT)本身其實有旁瓣,洩漏一直都在。只是取樣點剛好避開了它,所以在 DFT 中看不出來。注意すべきは、灰色の曲線(DTFT)そのものにはサイドローブがあり、漏れはつねに存在しているということである。標本点がたまたまそれを避けているだけなので、DFT には現れない。
Time domain: the $N$ points no longer hold a whole number of periods, and after the periodic extension a jump appears at the seam (the red bar). What the DFT sees is no longer a pure cosine but a signal that breaks once every $N$ points, and that break carries a great many other frequency components.時域:$N$ 點內不是整數個週期,週期延伸後在接縫處出現跳變(紅色直條)。DFT 看到的不再是純餘弦,而是一個每 $N$ 點就斷開一次的訊號,這個跳變帶有大量其他頻率成分。時間領域:$N$ 点のなかの周期数が整数でなくなり、周期的に延長すると継ぎ目に跳びが現れる(赤い縦棒)。DFT が見ているのはもはや純粋な余弦ではなく、$N$ 点ごとに一度断ち切られる信号であり、その断ち切りは他の多くの周波数成分をともなう。
Frequency domain: the shape of the sinc has not changed; the whole curve has simply moved by half a bin. The samples no longer line up with the zeros but land on the flank of the main lobe and on the sidelobes, so every bin carries a value and the energy spreads across the whole spectrum. The leakage figure in the readout jumps from 0 % to something plainly visible.頻域:sinc 的形狀沒變,只是整條移動了半個 bin。取樣點不再對準零點,而是落在主瓣側面與旁瓣上,所以每個 bin 都有值,能量散到整個頻譜。讀數中的洩漏比例會從 0 % 跳到明顯的數值。周波数領域:sinc の形は変わらず、曲線全体が半 bin だけ動いただけである。標本点はもう零点に合わず、主ローブの斜面とサイドローブの上に落ちるので、どの bin にも値がのることになり、エネルギーはスペクトル全体へ散る。読み出しの漏れの割合は 0 % からはっきりした値へ跳ね上がる。
Ticking dB scale makes it plainer still. On a bin, the other bins sit at $-\infty$ dB — they are exactly zero. Half a bin off, the distant bins are still only $-15$ to $-25$ dB down, the larger $N$ the lower.勾選 dB 刻度會更清楚:頻率在格點上時,其他 bin 是 $-\infty$ dB(完全為零);偏離半格時,遠處的 bin 仍停在 $-15$ 到 $-25$ dB 之間($N$ 越大越低)。dB 目盛りにすればさらにはっきりする。格子点上では他の bin は $-\infty$ dB、すなわち厳密に零である。半 bin ずれると、遠方の bin もなお $-15$ から $-25$ dB にとどまる($N$ が大きいほど低くなる)。
The jump at the seam in the time domain and the samples landing on sidelobes in the frequency domain are two descriptions of a single phenomenon:時域的「接縫跳變」和頻域的「取樣點落在旁瓣上」是同一個現象的兩種描述:時間領域の「継ぎ目の跳び」と、周波数領域の「標本点がサイドローブに落ちる」は、一つの現象の二通りの記述である:
| Time domain | Frequency domain | |
|---|---|---|
| A whole number of periods | The periodic extension joins smoothly | Every sample sits on a zero of the sinc |
| Not a whole number of periods | A jump at the seam | The samples land on the sidelobes |
| 時域 | 頻域 | |
|---|---|---|
| 整數週期 | 週期延伸平順 | 取樣點都在 sinc 零點 |
| 非整數週期 | 接縫處跳變 | 取樣點落在旁瓣上 |
| 時間領域 | 周波数領域 | |
|---|---|---|
| 整数個の周期 | 周期延長がなめらかにつながる | どの標本点も sinc の零点の上にある |
| 非整数個の周期 | 継ぎ目に跳びが出る | 標本点がサイドローブの上に落ちる |
This also says why a window works: press the two ends down to 0 and the seam cannot jump wherever the frequency happens to be, so the sidelobes come down of their own accord. A real signal's frequency will almost never land exactly on a bin, which is why spectral analysis in practice is almost always windowed. The word "jump" (discontinuity) here means this: after the DFT has extended the $N$ points periodically, the value at the seam — going from $n = N-1$ on to $n = N$ — disagrees with the value the original signal would really have continued to.這也說明了窗函數為什麼有效:把兩端壓到 0,不論頻率在哪裡,接縫處都不會跳變,旁瓣自然就降低了。實際訊號的頻率幾乎不可能恰好落在格點上,所以實務上做頻譜分析通常都會加窗。這裡說的「跳變」(discontinuity),指的是:DFT 把 $N$ 點週期延伸後,在接縫處(從 $n = N-1$ 接到 $n = N$)的值,和原本訊號真正應該延續下去的值不一致。ここから窓関数が効く理由も見えてくる。両端を 0 まで押し下げれば、周波数がどこにあろうと継ぎ目は跳ばず、サイドローブは自然に下がる。実際の信号の周波数がちょうど格子点に乗ることはまずないので、実務のスペクトル分析はほとんどつねに窓を掛ける。ここでいう「跳び」(不連続)とは次のことである。DFT が $N$ 点を周期的に延長したあと、継ぎ目($n = N-1$ から $n = N$ へ移るところ)の値が、もとの信号が本来続いていくはずだった値と一致しない。
Write the original continuous signal — or infinitely long sequence — as $x_c$, of which the DFT takes $N$ points, $x[n] = x_c(n)$ for $0 \le n \le N-1$. The periodic extension the DFT implies is設原始的連續訊號(或無限長序列)為 $x_c$,DFT 取其中 $N$ 點 $x[n] = x_c(n)$,$0 \le n \le N-1$。DFT 隱含的週期延伸是もとの連続信号(あるいは無限に長い系列)を $x_c$ と書き、DFT はそのうち $N$ 点 $x[n] = x_c(n)$($0 \le n \le N-1$)をとるとする。DFT が暗に行う周期延長は
At $n = N$, the point just past the seam:在接縫的下一點 $n = N$:継ぎ目の次の点 $n = N$ では:
The jump is defined as the difference between the two:跳變量定義為兩者的差:跳びの大きさは両者の差として定義する:
When $\Delta \ne 0$ the periodic extension departs at the seam from the course the original signal was taking, and that is what having a jump means.$\Delta \ne 0$ 時,週期延伸在接縫處偏離了原訊號的走勢,就稱為有跳變。$\Delta \ne 0$ のとき、周期延長は継ぎ目でもとの信号の進み方から外れる。これが跳びがあるということである。
With $x_c(n) = \cos(2\pi r n / N)$,$x_c(n) = \cos(2\pi r n / N)$,則$x_c(n) = \cos(2\pi r n / N)$ とすれば、
Only when $r$ is an integer is $\cos(2\pi r) = 1$, giving $\Delta = 0$. Take $N = 16$:只有當 $r$ 是整數時 $\cos(2\pi r) = 1$,$\Delta = 0$。以 $N = 16$ 為例:$\cos(2\pi r) = 1$、すなわち $\Delta = 0$ となるのは $r$ が整数のときだけである。$N = 16$ でみると:
| $r$ | $x[N-1]$ | Next point from the extension, $x[0]$ | The true next point, $x_c(16)$ | $\Delta$ |
|---|---|---|---|---|
| 3 | $\cos(2\pi\cdot 3\cdot 15/16) \approx 0.383$ | 1 | $\cos(6\pi) = 1$ | 0 |
| 3.5 | $\cos(2\pi\cdot 3.5\cdot 15/16) \approx -0.195$ | 1 | $\cos(7\pi) = -1$ | 2 |
| $r$ | $x[N-1]$ | 週期延伸的下一點 $x[0]$ | 真正的下一點 $x_c(16)$ | $\Delta$ |
|---|---|---|---|---|
| 3 | $\cos(2\pi\cdot 3\cdot 15/16) \approx 0.383$ | 1 | $\cos(6\pi) = 1$ | 0 |
| 3.5 | $\cos(2\pi\cdot 3.5\cdot 15/16) \approx -0.195$ | 1 | $\cos(7\pi) = -1$ | 2 |
| $r$ | $x[N-1]$ | 周期延長が与える次の点 $x[0]$ | 本当の次の点 $x_c(16)$ | $\Delta$ |
|---|---|---|---|---|
| 3 | $\cos(2\pi\cdot 3\cdot 15/16) \approx 0.383$ | 1 | $\cos(6\pi) = 1$ | 0 |
| 3.5 | $\cos(2\pi\cdot 3.5\cdot 15/16) \approx -0.195$ | 1 | $\cos(7\pi) = -1$ | 2 |
At $r = 3.5$ the sequence is about $-0.195$ at $n = 15$; following its own course the next point should be $-1$, but the periodic extension jumps straight back to $+1$ — a gap of $\Delta = 2$. The red bar on the upper row of panel ② is exactly that gap. What matters in the table is the last column, not the size of $x[N-1]$ itself: $\Delta$ compares the extension against the true continuation, never against the last sample.$r = 3.5$ 時,序列在 $n = 15$ 約為 $-0.195$,照原本走勢下一點應該是 $-1$,週期延伸卻直接跳回 $+1$,落差 $\Delta = 2$。圖中面板 ② 上排那根紅色直條畫的就是這段落差。表裡真正重要的是最後一欄,而不是 $x[N-1]$ 本身的大小:$\Delta$ 比的是週期延伸與真正的延續,從來不是與最後一個樣本比。$r = 3.5$ では系列は $n = 15$ でおよそ $-0.195$ であり、そのまま進めば次の点は $-1$ のはずだが、周期延長は $+1$ へ直に跳び戻る。差は $\Delta = 2$ である。パネル ② 上段の赤い縦棒が、まさにこの差である。表で重要なのは最後の列であって $x[N-1]$ の大きさそのものではない。$\Delta$ が比べているのは周期延長と本当の続きであり、最後の標本との差ではない。
Comparing only "the value of the next point" is not the whole story. Put a phase in, $x_c(n) = \cos(2\pi r n/N + \varphi)$, and certain non-integer $r$ paired with a particular $\varphi$ can make $x_c(0) = x_c(N)$ exactly: the values agree while the slopes run in different directions, so the extended course is still wrong.只比較「下一點的值」還不夠完整。例如加上相位 $x_c(n) = \cos(2\pi r n/N + \varphi)$ 時,某些非整數 $r$ 配上特定的 $\varphi$,可能剛好讓 $x_c(0) = x_c(N)$,值相同但斜率方向不同,延伸後的走勢仍然不對。「次の点の値」だけを比べるのでは十分ではない。位相を入れて $x_c(n) = \cos(2\pi r n/N + \varphi)$ とすると、ある非整数の $r$ と特定の $\varphi$ の組み合わせで、ちょうど $x_c(0) = x_c(N)$ となりうる。値は一致しても傾きの向きが異なり、延長後の進み方はやはり正しくない。
The complete condition is therefore that the periodic extension agree with the original signal for every $n$:所以完整的條件是:週期延伸要對所有 $n$ 都和原訊號一致,したがって完全な条件は、周期延長がすべての $n$ でもとの信号と一致することである:
That is, $x_c$ must itself have period $N$. For a sinusoid this is equivalent to a whole number of periods inside the $N$ points. Anything else and a jump is certain to exist — a discontinuity at the seam either in the value or in the slope.也就是 $x_c$ 本身以 $N$ 為週期。對正弦波而言,這等價於 $N$ 點內恰好整數個週期。只要不是,就一定存在跳變(值或斜率在接縫處不連續)。つまり $x_c$ 自身が $N$ を周期にもつということである。正弦波についてはこれは $N$ 点のなかにちょうど整数個の周期が入ることと同値である。そうでなければ、継ぎ目に跳び——値または傾きの不連続——がかならず存在する。
The red bar on the upper row of panel ② checks only the gap in the value. The cosine in that example carries no phase, so the gap in the value happens to be equivalent to whether $r$ is an integer, and the conclusion drawn from it is sound. Read it as an instrument that is right for this particular signal, not as the definition of the condition — the definition is the displayed equation just above, and it is a statement about every $n$.面板 ② 上排的紅線只檢查了「值」的落差。因為那個例子的餘弦沒有相位,值的落差恰好和 $r$ 是否為整數等價,所以結論正確。要把它讀成「對這個特定訊號剛好管用的量具」,而不是條件本身的定義——定義是上面那條顯示式,講的是對每一個 $n$ 都要成立。パネル ② 上段の赤い線が調べているのは値の差だけである。あの例の余弦には位相がないので、値の差は $r$ が整数かどうかとちょうど同値になり、そこから引く結論は正しい。これは「この特定の信号にたまたま効く計器」として読むべきであって、条件の定義として読んではならない。定義はすぐ上の別行立ての式であり、それはすべての $n$ についての主張である。
A discrete sequence is a set of separate points to begin with; it has no "break" in the sense a continuous function does. The jump here means a sudden departure from the smooth course the original signal was taking.離散序列本來就是一個個分開的點,沒有連續函數那種「斷開」的意思。這裡的跳變指的是相對於原訊號平滑走勢的突然偏離。離散系列はそもそも離れた点の集まりであり、連続関数のような「断ち切れ」をもたない。ここでいう跳びとは、もとの信号のなめらかな進み方からの突然のずれのことである。
A smooth single frequency is interrupted once at every seam. Building a change that abrupt out of sinusoids takes components at many different frequencies, so the energy spreads over many bins — and that is leakage. A window presses the two ends down towards 0, which makes both $x[N-1]$ and $x[0]$ small, and the gap at the seam small with them.一個平滑的單一頻率,在每個接縫處都被打斷一次。要用正弦波組合出這種突然的變化,需要很多不同頻率的成分,所以能量會散到許多 bin 上,這就是洩漏。窗函數把頭尾壓到接近 0,讓 $x[N-1]$ 和 $x[0]$ 都很小,接縫處的落差自然就很小了。なめらかな単一周波数が、継ぎ目ごとに一度ずつ断ち切られる。これほど急な変化を正弦波で組み立てるには多くの異なる周波数の成分が要るので、エネルギーは多数の bin へ散る。これが漏れである。窓関数は両端を 0 近くまで押し下げ、$x[N-1]$ も $x[0]$ も小さくする。それにつれて継ぎ目の差も小さくなる。
The window $w[n]$ tends to 0 at the two ends and is 1 in the middle, and $x_w[n] = w[n]\,x[n]$ is the product written at the head of this subsection. After the multiplication, the values at both ends of the sequence are pressed down close to 0. In the periodic extension the seam then joins "almost 0" to "almost 0", and whether or not the original sinusoid held a whole number of periods inside the $N$ points, there is no longer an abrupt jump there.窗函數 $w[n]$ 在兩端趨近 0、中間為 1,而 $x_w[n] = w[n]\,x[n]$ 就是本小節開頭那個乘積。乘上之後,序列頭尾的值都被壓到接近 0。週期延伸時,接縫兩側都是「接近 0 接到接近 0」,不論原本的正弦波在 $N$ 點內是不是整數個週期,接縫處都不再有突然的跳變。窓関数 $w[n]$ は両端で 0 に近づき、中央で 1 である。$x_w[n] = w[n]\,x[n]$ は本小節の冒頭に書いた積にほかならない。掛けたあと、系列の先頭と末尾の値はどちらも 0 近くまで押し下げられる。周期延長では継ぎ目の両側が「ほぼ 0」と「ほぼ 0」になるので、もとの正弦波が $N$ 点のなかに整数個の周期をもつかどうかにかかわらず、そこにはもう急な跳びがない。
And the smoother the window, the less the seam can be made out at all, and the faster the leakage falls away:而且窗函數越平滑,接縫處就越「看不出來」,洩漏衰減得越快:さらに、窓がなめらかであるほど継ぎ目は見分けがつかなくなり、漏れの減衰も速くなる:
| Window | What happens at the seam | Rate of sidelobe decay |
|---|---|---|
| Rectangular (no window) | The value jumps | About $1/\omega$, $-6$ dB per octave |
| Triangular | The value is continuous, the slope jumps | About $1/\omega^2$, $-12$ dB per octave |
| Hann | Value and slope are both continuous | About $1/\omega^3$, $-18$ dB per octave |
| 窗 | 接縫處的情況 | 旁瓣衰減速度 |
|---|---|---|
| 矩形(不加窗) | 值會跳 | 約 $1/\omega$,每倍頻 $-6$ dB |
| 三角形 | 值連續,斜率會跳 | 約 $1/\omega^2$,每倍頻 $-12$ dB |
| Hann | 值和斜率都連續 | 約 $1/\omega^3$,每倍頻 $-18$ dB |
| 窓 | 継ぎ目での様子 | サイドローブの減衰の速さ |
|---|---|---|
| 矩形窓(窓なし) | 値が跳ぶ | おおむね $1/\omega$、1 オクターブあたり $-6$ dB |
| 三角窓 | 値は連続、傾きが跳ぶ | おおむね $1/\omega^2$、1 オクターブあたり $-12$ dB |
| Hann 窓 | 値も傾きも連続 | おおむね $1/\omega^3$、1 オクターブあたり $-18$ dB |
This is a general rule of Fourier analysis: the smoother the signal, the faster its spectrum decays. Each further derivative made continuous at the seam buys one more order of sidelobe decay. Measured on the window transforms themselves, the slopes come out at $-5.9$, $-11.9$ and $-18.2$ dB per octave for the rectangular, triangular and Hann windows — least squares through the sidelobe peaks between $\omega = 0.02\pi$ and $0.4\pi$ at $N = 256$, which keeps the fit clear of the main lobe at one end and of the fold-back at $\omega = \pi$ at the other.這是傅立葉分析的一般規律:訊號越平滑,頻譜衰減越快。接縫處每多一階導數連續,旁瓣就多衰減一階。直接對視窗本身的變換去量,矩形、三角、Hann 三者的斜率分別是 $-5.9$、$-11.9$、$-18.2$ dB/倍頻——取 $N = 256$,以 $\omega = 0.02\pi$ 到 $0.4\pi$ 之間的旁瓣峰值作最小平方擬合,一端避開主瓣,另一端避開 $\omega = \pi$ 處的折返。これはフーリエ解析の一般則である。信号がなめらかであるほど、スペクトルの減衰は速い。継ぎ目で連続な導関数が一階増えるごとに、サイドローブの減衰も一階ぶん増える。窓そのものの変換で測ると、傾きは矩形窓 $-5.9$、三角窓 $-11.9$、Hann 窓 $-18.2$ dB/オクターブとなる。$N = 256$ とし、$\omega = 0.02\pi$ から $0.4\pi$ のあいだのサイドローブ頂点を最小二乗で当てはめたもので、一方の端では主ローブを、他方の端では $\omega = \pi$ での折り返しを避けてある。
Multiplication in time is convolution in frequency — the equation at the head of this subsection. Window a sinusoid of a single frequency $\omega_0$ and its spectrum is simply the window's spectrum shifted there:時域相乘對應頻域摺積,也就是本小節開頭那條式子。單一頻率 $\omega_0$ 的正弦波加窗後,頻譜就是窗頻譜平移過去:時間領域の積は周波数領域の畳み込みである——本小節の冒頭の式がそれである。単一周波数 $\omega_0$ の正弦波に窓を掛ければ、スペクトルは窓のスペクトルをそこへ平行移動したものになる:
What the DFT sees is that curve, sampled on the grid.DFT 看到的,就是這條曲線在格點上的取樣。DFT が見ているのは、この曲線を格子点の上で標本化したものである。
A window does not make the problem of the frequency being off the bins go away. It makes the sidelobes themselves small, so it no longer matters where the samples land.窗函數並沒有讓「頻率不在格點上」的問題消失,而是把旁瓣本身做小,所以取樣點落在哪裡都沒關係。窓関数は「周波数が格子点に乗らない」という問題を消すわけではない。サイドローブそのものを小さくするので、標本点がどこに落ちても構わなくなるのである。
Pressing the ends down is the same as shortening the effective length, so the main lobe widens — Hann's is about twice the rectangular one — and two close frequencies become harder to separate. That is the whole subject of §8.7.3. The peak drops as well: Hann's coherent gain measures $0.484$, about half the rectangular window's, so an amplitude read off the spectrum has to be multiplied back by a correction factor.兩端被壓低,等於有效長度變短,所以主瓣變寬(Hann 約為矩形的 2 倍),兩個很接近的頻率較難分開——這正是 §8.7.3 整節在談的事。另外峰值也會降低(Hann 的相干增益量得 $0.484$,約為矩形的一半),量振幅時要乘回修正係數。両端を押し下げることは実効的な長さを縮めることに等しいので、主ローブは広がり(Hann は矩形のおよそ 2 倍)、近接した二つの周波数は分離しにくくなる。これはまさに §8.7.3 が一節をかけて論じている事柄である。さらに頂点も下がる。Hann のコヒーレント利得は測ると $0.484$ で、矩形窓のおよそ半分であるから、振幅を読むときは補正係数を掛け戻す必要がある。
The equation at the head of this subsection states the whole mechanism, but it states it in one line. Unpack it for a spectrum made of pure lines. If $x[n]$ is a sum of complex exponentials at $\omega_1, \omega_2, \ldots$ with amplitudes $A_1, A_2, \ldots$, its spectrum is a row of impulses; and convolving a row of impulses with $W$ does nothing but drop a copy of $W$ onto each of them:本小節開頭那條式子已經把整個機制說完了,只是壓成了一行。把它對純譜線的情形展開來看。若 $x[n]$ 是一些複指數之和,頻率為 $\omega_1, \omega_2, \ldots$、振幅為 $A_1, A_2, \ldots$,其頻譜就是一排脈衝;而一排脈衝與 $W$ 做摺積,所做的事情不過是把 $W$ 的一份複本放到每一根脈衝上:本小節の冒頭の式は機構のすべてを述べているが、それを一行に圧縮して述べている。純粋なスペクトル線からなるスペクトルについて、これを展開してみる。$x[n]$ が周波数 $\omega_1, \omega_2, \ldots$、振幅 $A_1, A_2, \ldots$ の複素指数関数の和であれば、そのスペクトルはインパルスの列である。そしてインパルスの列と $W$ との畳み込みがすることは、$W$ の複製をその一本ごとに置くこと以外にない:
So the leakage picture is not a vague blur. It is a finite sum of copies of one fixed curve — the window's own transform — each copy centred on a frequency that is genuinely present and scaled by that line's amplitude. Everything a window does to a spectrum follows from the shape of that single curve. How wide its main lobe is decides whether two nearby lines keep two peaks or run together into one; how far its sidelobes reach decides whether a weak line far away survives or disappears under the tails of the strong ones. Resolution and leakage are two readings of the same curve.所以洩漏的樣子並不是一團含糊的模糊。它是同一條固定曲線的有限多份複本之和——那條曲線就是視窗自己的頻譜——每一份都以一個真實存在的頻率為中心,並依該譜線的振幅縮放。視窗對頻譜所做的一切,都是這一條曲線的形狀決定的。主瓣有多寬,決定兩根靠近的譜線還能不能保有兩個峰、還是併成一個;旁瓣伸得多遠,決定遠處一根微弱的譜線是活下來、還是被強譜線的拖尾淹沒。解析度與洩漏,是同一條曲線的兩種讀法。したがって漏れの姿は、漠然としたぼけではない。それは一本の固定した曲線の、有限個の複製の和である —— その曲線とは窓自身の変換であり、複製はそれぞれ実在する周波数を中心とし、その線の振幅で拡大縮小されている。窓がスペクトルに対して行うことはすべて、この一本の曲線の形から従う。主ローブの幅は、近接する二本の線が二つの山を保つか一つに溶け合うかを決める。サイドローブの届く範囲は、遠方の弱い線が生き残るか強い線の裾に消えるかを決める。分解能と漏れは、同じ曲線の二通りの読み方である。
The figure takes the window chosen on the buttons, draws its transform once on its own, and then puts three lines through it: two of equal height a distance $\Delta\omega$ apart, and one weak line far off at $\omega_1$, about $34$ dB down. The window is taken centred on $n = 0$ rather than running from $0$ to $N-1$; that costs only the linear phase $e^{-j\omega(N-1)/2}$, which no magnitude plot shows anyway, and in exchange $W$ is real, so the copies really can be added as drawn. $N$ is odd for the same reason — it keeps the centred indices whole. Everything but the first panel is in dB.圖中取按鈕上選定的視窗,先單獨畫一次它的頻譜,再讓三根譜線穿過它:兩根等高、相距 $\Delta\omega$,以及遠處一根微弱的譜線,位在 $\omega_1$,大約低 $34$ dB。這裡的視窗取成以 $n = 0$ 為中心,而不是從 $0$ 排到 $N-1$;代價只是一個線性相位 $e^{-j\omega(N-1)/2}$,而振幅圖本來就看不到它,換來的是 $W$ 為實數,於是那些複本真的可以照畫出來的樣子相加。$N$ 取奇數也是同一個理由——這樣置中之後的索引才是整數。除了第一個面板之外,其餘都是 dB 刻度。図はボタンで選んだ窓を取り、その変換をまず単独で一度描き、そこへ三本の線を通す。等しい高さの二本が $\Delta\omega$ だけ離れて並び、遠方に弱い線が一本、$\omega_1$ におよそ $34$ dB 下がって置かれている。窓は $0$ から $N-1$ へ並べるのではなく $n = 0$ を中心に取ってある。その代償は線形位相 $e^{-j\omega(N-1)/2}$ だけであり、振幅の図にはもともと現れない。引き換えに $W$ は実数になり、複製は図のとおりに足し合わせられる。$N$ を奇数にしてあるのも同じ理由で、中心に取った添字が整数のままになる。最初の面板以外はすべて dB 目盛りである。
The figure below puts both matters into one picture. Set the window to "rectangular (no window)" and drag the frequency $r$, or press either button, and what is on show is bin alignment alone. Switch to triangular, Hann or Hamming and the grey trace stays as the unwindowed reference while the blue one becomes the windowed result. The two knobs turn independently, so the relation between "misalignment causes leakage" and "a window suppresses it" can be watched directly, instead of meeting two demonstrations that merely look alike.下圖把兩件事放在同一張圖裡。先把視窗選成「矩形(不加窗)」,拖動頻率 $r$ 或按那兩個按鈕,看的就只是格點對不對齊這一件事;再換成三角形、Hann 或 Hamming,灰色那一份仍然是不加窗的對照,藍色那一份就是加窗以後的結果。兩個旋鈕可以各自轉,所以「不對齊造成洩漏」與「加窗壓低洩漏」之間的關係是直接看得到的,而不是兩個長得很像的示範。下の図は二つの事柄を一枚にまとめたものである。まず窓を「矩形(窓なし)」にして周波数 $r$ を動かすか、二つのボタンを押してみれば、見えているのは格子点に合うかどうかという一事だけである。つぎに三角窓、Hann、Hamming へ切り替えれば、灰色は窓なしの対照のまま残り、青が窓を掛けた結果になる。二つのつまみは別々に回せるので、「ずれが漏れを生む」ことと「窓が漏れを抑える」ことの関係を直接見てとれる。よく似た二つのデモに出会うのではなく、である。
① The window. The grey horizontal line is "no window", which is the rectangular window. The blue curve is the window chosen, falling to near 0 at both ends.① 窗函數:灰色水平線是「不加窗」,等於矩形窗。藍色是所選的窗,兩端降到接近 0。① 窓関数。灰色の水平線が「窓なし」、すなわち矩形窓である。青は選んだ窓であり、両端で 0 近くまで下がる。
② The periodic extension — the time-domain view.② 週期延伸(時域角度):② 周期延長——時間領域からの見方。
③ The spectrum — the frequency-domain view.③ 頻譜(頻域角度):③ スペクトル——周波数領域からの見方。
| View | The problem without a window | What a window does about it |
|---|---|---|
| Time domain | The periodic extension jumps at the seam | The two ends are pressed to 0 and the seam is smooth |
| Frequency domain | The periodic sinc has high sidelobes and the samples land on them | A $W$ with low sidelobes takes its place, so the value is small wherever they land |
| The price | — | A wider main lobe (resolution falls) and a lower peak (the amplitude needs correcting) |
| 角度 | 不加窗的問題 | 加窗怎麼解決 |
|---|---|---|
| 時域 | 週期延伸在接縫處跳變 | 頭尾壓到 0,接縫平滑 |
| 頻域 | 週期性 sinc 旁瓣高,取樣點落在旁瓣上 | 換成旁瓣低的 $W$,落在哪裡都很小 |
| 代價 | — | 主瓣變寬(解析度下降)、峰值變小(需修正振幅) |
| 見方 | 窓なしの問題 | 窓がどう解決するか |
|---|---|---|
| 時間領域 | 周期延長が継ぎ目で跳ぶ | 両端を 0 へ押し下げ、継ぎ目をなめらかにする |
| 周波数領域 | 周期 sinc のサイドローブが高く、標本点がその上に落ちる | サイドローブの低い $W$ に置き換える。どこに落ちても値は小さい |
| 代償 | — | 主ローブが広がる(分解能が下がる)、頂点が下がる(振幅の補正が要る) |
The spectrum of a windowed sinewave is the window response shifted to the tone frequency. For closely spaced sinewaves there is leakage(洩漏)between their spectra: the sidelobes of a strong tone can completely bury a nearby weak tone. The lecture's example — three sinewaves analyzed with rectangular vs. Hamming windows — reproduced numerically:加窗後正弦波的頻譜,就是把視窗響應平移到該音的頻率上。對於彼此靠得很近的正弦波,它們的頻譜之間會有洩漏:強音的旁瓣可以把附近的弱音完全埋掉。課堂上的例子——用矩形窗與 Hamming 窗分析三個正弦波——以數值方式重現如下:窓掛けした正弦波のスペクトルは、窓の応答をその音の周波数へ移したものである。間隔の狭い正弦波どうしでは、スペクトルのあいだに漏れが生じる。強い音のサイドローブが、近くの弱い音を完全に埋めてしまうのである。講義の例 —— 三つの正弦波を矩形窓と Hamming 窓で分析したもの —— を数値的に再現すると次のようになる:
The slide behind that figure makes a sharper point than leakage on its own: the spectral smearing that windowing causes is what decides whether several sinusoids can be told apart in the spectrum at all. It is the consequence, for real spectral estimation, of the smearing introduced in §8.7.2. One matter of lettering first, because the chapter carries two conventions. From here to the end of this section $L$ is the window length — the number of data samples actually used — and $N$ is the DFT length, exactly as in §8.7.1 and §8.7.4. The window table of §8.7.2 defines its windows over $0 \le n \le N-1$ and therefore calls that same length $N$; its $4\pi/N$ and the widths used here are one and the same quantity, written with a different letter.那張圖所根據的投影片,講的比單純的洩漏更進一步:加窗造成的頻譜抹開,會影響我們從頻譜中辨認出多個正弦波的能力。這是 §8.7.2 的「抹開」概念在實際頻譜估計上的後果。先講符號,因為本章並存兩套寫法。從這裡到本節結束,$L$ 一律是視窗長度——也就是真正用到的資料樣本數——而 $N$ 是 DFT 點數,與 §8.7.1、§8.7.4 完全一致。§8.7.2 的視窗表把視窗定義在 $0 \le n \le N-1$ 上,因此把同一個長度叫作 $N$;那裡的 $4\pi/N$ 與這裡用到的寬度是同一個量,只是換了一個字母來寫。あの図のもとになったスライドが述べているのは、漏れそのものより一歩踏み込んだことである。窓掛けによるスペクトルのにじみは、複数の正弦波をスペクトル上で見分けられるかどうかを左右する。これは §8.7.2 で導入したにじみが、実際のスペクトル推定にもたらす帰結である。先に記号を決めておく。本章には二つの流儀が同居しているからである。ここから本節の終わりまで、$L$ はつねに窓の系列長——実際に用いるデータ標本の数——であり、$N$ は DFT の系列長である。§8.7.1 や §8.7.4 とまったく同じ約束である。§8.7.2 の窓の表は窓を $0 \le n \le N-1$ の上で定義しているので、同じ長さを $N$ と呼んでいる。そこの $4\pi/N$ とここで用いる幅は同一の量であり、文字が違うだけである。
In the left half of the slide's upper figure there is one sinusoid at frequency $\omega_1$, whose ideal spectrum is a single impulse $\delta(\omega - \omega_1)$. Windowing convolves that impulse with the window spectrum, and convolution with an impulse is nothing but a shift:投影片右上圖的左半邊:一個頻率 $\omega_1$ 的正弦波,理想頻譜是一根脈衝 $\delta(\omega - \omega_1)$。加窗後,這根脈衝與視窗頻譜摺積,而與脈衝摺積不過就是平移:スライド右上の図の左半分には、周波数 $\omega_1$ の正弦波が一つあり、その理想的なスペクトルは一本のインパルス $\delta(\omega - \omega_1)$ である。窓を掛けると、このインパルスは窓のスペクトルと畳み込まれる。インパルスとの畳み込みは平行移動にほかならない:
That is, the window spectrum translated to $\omega_1$. The figure labels two features of it:也就是視窗頻譜平移到 $\omega_1$。圖中標出它的兩個特徵:すなわち、窓のスペクトルを $\omega_1$ へ移したものである。図はその二つの特徴に名前を与えている:
In the right half of the same figure there are two sinusoids, $A_1$ at $\omega_1$ and $A_2$ at $\omega_2$, a distance $\Delta\omega = \omega_2 - \omega_1$ apart. Convolution is linear, so the result is simply the two smears added together:同一張圖的右半邊:兩個正弦波,$A_1$ 在 $\omega_1$、$A_2$ 在 $\omega_2$,間距 $\Delta\omega = \omega_2 - \omega_1$。摺積是線性的,所以結果就是兩條抹痕相加:同じ図の右半分には、$\omega_1$ の $A_1$ と $\omega_2$ の $A_2$ という二つの正弦波があり、間隔は $\Delta\omega = \omega_2 - \omega_1$ である。畳み込みは線形なので、結果は二つのにじみを足し合わせたものにすぎない:
This creates two distinct failure modes, and they are governed by two different parts of $W(\omega)$:這會造成兩種問題,而且分別由 $W(\omega)$ 的兩個不同部位決定:ここから二種類の破綻が生まれ、しかもそれぞれ $W(\omega)$ の別々の部分に支配される:
| Failure | Decided by | What is seen |
|---|---|---|
| Resolution lost | main-lobe width $\Delta\omega_m$ against the spacing $\Delta\omega$ | when $\Delta\omega$ is too small the two main lobes merge into a single peak and there is no telling two signals from one |
| Leakage interference | sidelobe height | one signal's sidelobes land on the other's position and bias its peak high or low; a weak signal can be covered over completely by a strong one's sidelobes |
| 問題 | 由什麼決定 | 現象 |
|---|---|---|
| 解析度不足 | 主瓣寬度 $\Delta\omega_m$ 對上間距 $\Delta\omega$ | $\Delta\omega$ 太小時,兩個主瓣合成一個峰,分不出是兩個訊號 |
| 洩漏干擾 | 旁瓣高度 | 一個訊號的旁瓣疊到另一個訊號的位置,讓它的峰值偏高或偏低;弱訊號甚至會被強訊號的旁瓣完全蓋住 |
| 破綻 | 何が決めるか | 現れ方 |
|---|---|---|
| 分解能の不足 | 主ローブ幅 $\Delta\omega_m$ と間隔 $\Delta\omega$ との兼ね合い | $\Delta\omega$ が小さすぎると二つの主ローブが一つの山に融け、信号が二つあることを見分けられない |
| 漏れによる妨害 | サイドローブの高さ | 一方の信号のサイドローブが他方の位置に重なり、その頂点を高くも低くも偏らせる。弱い信号は強い信号のサイドローブに完全に覆い隠されることさえある |
The slide's lower-left figure sets the two windows side by side. Written in normalized frequency $f/f_s$ (cycles per sample), with $L$ the window length:投影片左下圖把兩種窗擺在一起對照。以正規化頻率 $f/f_s$(每樣本的週期數)表示,$L$ 為視窗長度:スライド左下の図は二つの窓を並べて示している。正規化周波数 $f/f_s$(標本あたりの周期数)で書けば、$L$ を窓の系列長として:
| Window | Main-lobe full width | Peak sidelobe |
|---|---|---|
| Rectangular | $\approx 2/L$ | about $-13$ dB |
| Hamming | $\approx 4/L$ | about $-43$ dB |
| 窗 | 主瓣全寬 | 最高旁瓣 |
|---|---|---|
| 矩形窗 | $\approx 2/L$ | 約 $-13$ dB |
| Hamming 窗 | $\approx 4/L$ | 約 $-43$ dB |
| 窓 | 主ローブ全幅 | 最大サイドローブ |
|---|---|---|
| 矩形窓 | $\approx 2/L$ | およそ $-13$ dB |
| Hamming 窓 | $\approx 4/L$ | およそ $-43$ dB |
Two remarks on the numbers, so that nothing here contradicts what has already been quoted. First, $2/L$ cycles/sample is $4\pi/L$ rad/sample, so the rectangular row is the very same main-lobe width already used in §8.7.1 and tabulated in §8.7.2, merely in the other unit; the $-13$ dB is likewise the figure quoted there and in Fig. 8-6. Second, the Hamming entries are large-$L$ limits measured from the window's own transform: the main lobe comes out $4.09/L$ wide at $L = 100$ and $4.24/L$ at $L = 40$, and the highest sidelobe is $-42.6$ dB at $L = 100$ and $-42.1$ dB at $L = 40$ — the first sidelobe being lower still, at $-45.8$ dB, so the peak is not the nearest one. The $-41$ dB that §8.7.2's table and Fig. 8-6 give is the conventional textbook rounding of that same quantity. Read either as "a little over 40 dB down".關於這些數字有兩點要說明,以免與前面已經引用過的說法互相牴觸。第一,$2/L$ 週期/樣本就是 $4\pi/L$ rad/sample,所以矩形窗那一列,正是 §8.7.1 用過、§8.7.2 列表過的同一個主瓣寬度,只是換了單位;$-13$ dB 同樣就是那裡與圖 8-6 引用的數值。第二,Hamming 的兩個數字是從該視窗本身的變換量出來的大 $L$ 極限值:主瓣在 $L = 100$ 時量得 $4.09/L$、在 $L = 40$ 時量得 $4.24/L$;最高旁瓣在 $L = 100$ 時為 $-42.6$ dB、在 $L = 40$ 時為 $-42.1$ dB——而第一個旁瓣還更低,是 $-45.8$ dB,所以最高的那個並不是最靠近主瓣的那個。§8.7.2 表格與圖 8-6 所寫的 $-41$ dB,是同一個量在教科書上慣用的取整寫法。兩者都可以讀成「比主瓣低四十幾 dB」。数値について二点ことわっておく。すでに引用した値と食い違わないようにするためである。第一に、$2/L$ 周期/標本は $4\pi/L$ rad/sample であるから、矩形窓の行は §8.7.1 で用い §8.7.2 で表にした主ローブ幅そのものであり、単位が違うだけである。$-13$ dB もそこと図 8-6 が引用している値と同じである。第二に、Hamming の二つの値は、窓そのものの変換から測った大きな $L$ の極限である。主ローブは $L = 100$ で $4.09/L$、$L = 40$ で $4.24/L$ と測れ、最大サイドローブは $L = 100$ で $-42.6$ dB、$L = 40$ で $-42.1$ dB である。最初のサイドローブはさらに低く $-45.8$ dB なので、最大のものは主ローブに最も近いものではない。§8.7.2 の表と図 8-6 が挙げる $-41$ dB は、同じ量の教科書的な丸め方である。どちらも「四十数 dB 下」と読めばよい。
Reading the slide's four panels against that table:用這張表去對照投影片的四個面板:この表を手がかりにスライドの四つの面板を読むと:
The slide says to "use a window with a narrower main lobe to reduce leakage", and that "at the same number of points the Hamming window separates the sinusoids". Both sentences have to be read carefully.投影片寫「用主瓣較窄的窗來減輕洩漏」以及「相同點數下 Hamming 窗能分開正弦波」。這兩句要小心理解。スライドには「主ローブの狭い窓を使って漏れを軽くする」、「同じ点数なら Hamming 窓は正弦波を分離できる」とある。どちらの文も慎重に読む必要がある。
The accurate statement is: the Hamming window buys a far lower sidelobe level at the price of a wider main lobe; as soon as $L$ is large enough to make that main lobe narrower than the spacing between the signals, it delivers a spectrum that is both separated and clean. This is the same trade already stated in §8.7.2's concept box — only the direction of the main-lobe change is what the slide's wording gets backwards.比較準確的說法是:Hamming 窗用較寬的主瓣換取低很多的旁瓣;只要 $L$ 夠大,讓主瓣窄於訊號間距,它就能得到既分得開、又乾淨的頻譜。這與 §8.7.2 觀念方塊裡已經講過的取捨是同一件事——投影片的措辭弄反的,只是主瓣變化的方向。より正確な言い方はこうである。Hamming 窓は、広い主ローブと引き換えにはるかに低いサイドローブを買う。$L$ が十分に大きく、その主ローブが信号間隔より狭くなりさえすれば、分離でき、しかも清潔なスペクトルが得られる。これは §8.7.2 の概念の囲みですでに述べた釣り合いと同じものである。スライドの文言が取り違えているのは、主ローブが変化する向きだけである。
Computational cost? Applying a window costs only $N$ extra multiplications before the FFT — negligible compared to the $\frac{N}{2}\log_2 N$ butterflies of the transform itself. Window choice is essentially free performance.計算代價呢?加一個視窗只需要在 FFT 之前多做 $N$ 次乘法——相對於變換本身的 $\frac{N}{2}\log_2 N$ 次蝶形運算根本可以忽略。挑選視窗基本上是不用付錢的效能提升。計算量はどうか。窓を掛けるのに必要なのは FFT の前の $N$ 回の余分な乗算だけであり、変換そのものの $\frac{N}{2}\log_2 N$ 回のバタフライに比べれば無視できる。窓の選択は実質ただ同然の性能改善である。
The paragraph above settles only the first half of the slide's closing question (and writes the multiplication count with $N$, the transform length; with no zero padding it is the same count as the $L$ used here). There are two costs, and they are of very different sizes:上一段只回答了投影片最後那個問題的前半(而且乘法次數是用變換長度 $N$ 來寫的;在不補零時,它與這裡用的 $L$ 是同一個數)。其實成本有兩種,而且大小差得很遠:直前の段落はスライド最後の問いの前半を片づけただけである(しかも乗算の回数を変換の系列長 $N$ で書いている。ゼロ詰めをしなければ、ここで用いる $L$ と同じ数である)。費用は二種類あり、その大きさはまるで違う:
The figure below carries three sinusoids: two strong ones close together, whose spacing $\Delta f$ can be moved, and one weak one whose level can be set. Both failure modes — resolution and leakage — can be watched at once. It is the same experiment as Fig. 8-6 with the three fixed numbers of that figure turned into controls.下圖有三個正弦波:兩個靠近的強訊號(間距 $\Delta f$ 可調),以及一個可調大小的弱訊號。可以同時觀察解析度和洩漏兩種問題。這其實就是圖 8-6 的同一個實驗,只是把那張圖裡固定的三個數字改成了可以調的控制項。下の図には三つの正弦波がある。間隔 $\Delta f$ を動かせる近接した二つの強い信号と、大きさを設定できる一つの弱い信号である。分解能と漏れという二つの破綻を同時に観察できる。これは図 8-6 と同じ実験であり、あの図で固定されていた三つの数値をつまみに変えただけである。
These settings reproduce the slide's four panels and make the trade visible:可以試試以下組合,重現投影片的四張圖並看出取捨:次の組み合わせを試せば、スライドの四つの図を再現でき、取引の構造が見えてくる:
Main-lobe width decides whether two close signals can be separated; sidelobe height decides whether a weak signal can be seen at all. Changing the window only trades one against the other. To improve both at once there is nothing for it but to increase the observation length $L$ — which is the same conclusion §8.7.1 reached about zero padding, from the other direction.主瓣寬度決定能否分開靠近的訊號,旁瓣高度決定能否看見弱訊號。換窗只能在兩者之間取捨,要同時改善兩者,只能增加觀察長度 $L$——這與 §8.7.1 從補零那一邊得到的結論,是同一句話。主ローブ幅は近接した信号を分離できるかどうかを決め、サイドローブの高さは弱い信号が見えるかどうかを決める。窓を取り替えても、両者のあいだで取引をするだけである。両方を同時に良くするには、観測の系列長 $L$ を増やすほかない。これは §8.7.1 がゼロ詰めの側から到達した結論と同じ一文である。
It can be done — but strictly speaking the DFT itself is always an "$N$ points in, $N$ points out" square operation. When the sequence length $L$ and the number of frequency points $N$ differ, what is done in practice is to bring the sequence to length $N$ first and then take an $N$-point DFT. There are two cases.可以,但嚴格來說 DFT 本身一定是「$N$ 點進、$N$ 點出」的方陣運算。當序列長度 $L$ 和頻率點數 $N$ 不同時,實務上會先把序列調整成長度 $N$,再做 $N$ 點 DFT。分成兩種情況:できる。ただし厳密にいえば、DFT 自体はつねに「$N$ 点入れて $N$ 点出す」正方の演算である。系列長 $L$ と周波数点の数 $N$ が異なるときは、実務上はまず系列を長さ $N$ に整えてから $N$ 点 DFT をとる。場合は二つに分かれる。
Append $N - L$ zeros to the end of the sequence and take the $N$-point DFT. The result is one and the same DTFT curve, sampled on a denser frequency grid:在序列後面補 $N - L$ 個零,再做 $N$ 點 DFT。結果是同一條 DTFT 曲線在更密的頻率點上取樣:系列の後ろに $N - L$ 個の零を付け足し、$N$ 点 DFT をとる。結果はまったく同じ DTFT 曲線を、より密な周波数格子の上で標本化したものである:
Why the appended zeros change nothing about the curve itself is the subject of §8.7.1 — the extra terms contribute nothing to the DTFT sum, so all that moves is the sampling grid, from spacing $2\pi/L$ to $2\pi/N$. Nothing new has to be said about that here.補上的零為什麼完全不會改變曲線本身,正是 §8.7.1 的主題——多出來的那些項對 DTFT 的和沒有任何貢獻,所以動到的只有取樣格點,間距從 $2\pi/L$ 變成 $2\pi/N$。這裡不必再重講一次。付け足した零が曲線そのものを何も変えないのはなぜか —— それはまさに §8.7.1 の主題である。余分な項は DTFT の和に何も寄与しないので、動くのは標本化の格子だけであり、その間隔が $2\pi/L$ から $2\pi/N$ へ変わる。ここで改めて述べる必要はない。
Example: $x = \{1, 1\}$, so $L = 2$.例子:$x = \{1, 1\}$,$L = 2$。例:$x = \{1, 1\}$、すなわち $L = 2$ とする。
Zero padding only draws the curve more finely, so that its shape can be read off; whether two frequencies lying close together can be told apart is settled by the original length $L$ — through the main-lobe width $4\pi/L$ — and not by $N$. Grid spacing $2\pi/N$ and resolution $\sim 2\pi/L$ are two different things. That is the distinction already drawn in §8.7.1, $\Delta f_{\text{grid}} = F_s/N$ set by the total DFT length against $\Delta f_{\text{res}} \approx F_s/L$ set by the number of actual data samples, written here in rad/sample; the $4\pi/L$ is the same length-$L$ rectangular main lobe quoted there, and §8.7.3 shows what it does to a real spectrum.補零只是把曲線畫得更細,讓你看清楚它的形狀,但兩個靠得很近的頻率能不能分辨,是由原始長度 $L$ 決定的(主瓣寬度約 $4\pi/L$),而不是 $N$。頻率點間距 $2\pi/N$ 和解析度 $\sim 2\pi/L$ 是兩件不同的事。這就是 §8.7.1 已經分清楚的那個區別——由 DFT 總長度決定的 $\Delta f_{\text{grid}} = F_s/N$,對上由實際資料樣本數決定的 $\Delta f_{\text{res}} \approx F_s/L$——這裡只是改用 rad/sample 來寫;$4\pi/L$ 就是那裡引用的長度 $L$ 矩形窗主瓣,而 §8.7.3 展示了它在真實頻譜上的後果。ゼロ詰めは曲線を細かく描いて形を読み取りやすくするだけである。近接した二つの周波数を見分けられるかどうかを決めるのは、もとの系列長 $L$ であり(主ローブ幅はおよそ $4\pi/L$)、$N$ ではない。周波数点の間隔 $2\pi/N$ と分解能 $\sim 2\pi/L$ は別物である。これは §8.7.1 ですでに引かれた区別、すなわち DFT 全体の系列長が決める $\Delta f_{\text{grid}} = F_s/N$ と、実際のデータ標本の数が決める $\Delta f_{\text{res}} \approx F_s/L$ との区別を、ここでは rad/sample で書き直したものにすぎない。$4\pi/L$ はそこで引用した長さ $L$ の矩形窓の主ローブそのものであり、それが実際のスペクトルに何をもたらすかは §8.7.3 が示している。
Parseval still holds. The zeros that were appended carry no energy, soParseval 仍成立:補的零不帶能量,所以Parseval は依然として成り立つ。付け足した零はエネルギーを持たないので
Check it with the numbers above: at $N = 2$, $\frac{1}{2}(4 + 0) = 2$; at $N = 4$, $\frac{1}{4}(4 + 2 + 0 + 2) = 2$. The second line is not a new example — the $\lvert X[k]\rvert^2 = \{4, 2, 0, 2\}$ it uses is the table already computed in §8.4.4, where the frequency-domain sum $8$ was multiplied by $\frac{1}{4}$ to give $2$. Both lines come out equal to the time-domain energy $2$. Note that the coefficient has to be $N$ and not $L$: dividing the $N = 4$ sum by $L = 2$ would give $4$.用上面的數字檢查:$N = 2$ 時 $\frac{1}{2}(4 + 0) = 2$,$N = 4$ 時 $\frac{1}{4}(4 + 2 + 0 + 2) = 2$,兩者都等於時域能量 $2$。第二行並不是新的例子——它用的 $\lvert X[k]\rvert^2 = \{4, 2, 0, 2\}$ 就是 §8.4.4 已經算過的那張表,那裡把頻域總和 $8$ 乘上 $\frac{1}{4}$ 得到 $2$。注意係數要用 $N$,不是 $L$:把 $N = 4$ 的總和除以 $L = 2$ 會得到 $4$。上の数字で確かめよう。$N = 2$ では $\frac{1}{2}(4 + 0) = 2$、$N = 4$ では $\frac{1}{4}(4 + 2 + 0 + 2) = 2$ となり、どちらも時間領域のエネルギー $2$ に等しい。二行目は新しい例ではない。そこで使った $\lvert X[k]\rvert^2 = \{4, 2, 0, 2\}$ は §8.4.4 ですでに計算した表そのものであり、そこでは周波数領域の総和 $8$ に $\frac{1}{4}$ を掛けて $2$ を得ていた。係数は $L$ ではなく $N$ でなければならないことに注意する。$N = 4$ の総和を $L = 2$ で割れば $4$ になってしまう。
Method A — truncation. Keep only the first $N$ samples, in practice after multiplying by a window function first. What comes out is the spectrum of that truncated stretch, not of the whole sequence. What the truncation costs — the widened main lobe and the sidelobe leakage bought with it, and which window makes which trade — is the subject of §8.7.2 and §8.7.3, so the choice of window is made there and not here.方式 A:截斷。只取前 $N$ 個樣本(實務上通常會先乘上窗函數)。得到的是被截斷那一段的頻譜,不是整個序列的。截斷要付的代價——主瓣被加寬、以及隨之買到的旁瓣洩漏,還有哪種視窗做哪種取捨——是 §8.7.2 與 §8.7.3 的主題,所以視窗的選擇在那裡決定,不在這裡。方法 A —— 打ち切り。最初の $N$ 標本だけを残す(実務ではたいてい先に窓関数を掛ける)。得られるのは打ち切られたその区間のスペクトルであって、系列全体のものではない。打ち切りの代価 —— 広がった主ローブと、その代わりに買うサイドローブの漏れ、そしてどの窓がどの取引をするか —— は §8.7.2 と §8.7.3 の主題であり、窓の選択はここではなくそちらで決まる。
Method B — time-domain folding. This is the "DFT from an overlength DTFT" of §8.5. If the DTFT of the whole long sequence is sampled directly at $N$ frequency points, the time sequence belonging to those samples is方式 B:時域摺疊。這就是前面 §8.5「由超長序列的 DTFT 取得 DFT」那一節:若直接在 $N$ 個頻率點上取樣整個長序列的 DTFT,對應的時域序列是方法 B —— 時間領域での折り返し。これは §8.5「長すぎる系列の DTFT から DFT を得る」そのものである。長い系列全体の DTFT を $N$ 個の周波数点で直接標本化すると、その標本に対応する時間系列は
In practice: lay the sequence out in length-$N$ segments, add them on top of one another, and take the $N$-point DFT of the result. The $N$ values that come out are exactly equal to the samples of the long sequence's DTFT at those $N$ frequencies. §8.5.1 derives this with figures and §8.5.2 works it through by hand, so it is not re-derived here.做法是把序列每 $N$ 點一段疊加起來,再對結果做 $N$ 點 DFT。得到的 $N$ 個值精確等於原長序列 DTFT 在那 $N$ 個頻率點上的取樣。§8.5.1 連圖帶推導講過,§8.5.2 還用手算了一遍,所以這裡不再重推。やり方は、系列を $N$ 点ごとの区間に並べ、それらを重ねて足し合わせ、その結果の $N$ 点 DFT をとる、というものである。出てくる $N$ 個の値は、長い系列の DTFT をその $N$ 個の周波数で標本化したものに厳密に等しい。§8.5.1 が図つきで導出し、§8.5.2 が手で追ってみせているので、ここでは導き直さない。
At this point, however:不過此時:ただしこのときには:
The WOLA / polyphase filter bank met earlier (§8.5.5) is Method B used on purpose: multiply by a long window function, fold, and obtain the long window's spectral properties from a short $N$-point FFT alone.前面提過的 WOLA/多相濾波器組(§8.5.5)就是刻意使用方式 B:乘上長窗函數後折疊,只用短的 $N$ 點 FFT 就得到長窗的頻譜特性。さきに出てきた WOLA /多相フィルタバンク(§8.5.5)は、方法 B をあえて使うものである。長い窓関数を掛けてから折り返し、短い $N$ 点 FFT だけで長い窓のスペクトル特性を手に入れる。
| Case | What is done | What you get | Can $x$ be recovered? |
|---|---|---|---|
| $L = N$ | Take the DFT directly | $N$ samples of the DTFT | Yes |
| $L < N$ | Zero padding | A denser sampling of the same DTFT | Yes |
| $L > N$ | Truncation (with a window) | The spectrum of the retained stretch | That stretch only |
| $L > N$ | Time-domain folding | $N$ exact samples of the long sequence's DTFT | No (aliasing) |
| 情況 | 處理方式 | 得到什麼 | 能否還原 $x$ |
|---|---|---|---|
| $L = N$ | 直接做 DFT | DTFT 的 $N$ 個取樣 | 可以 |
| $L < N$ | 補零 | 同一條 DTFT 的更密取樣 | 可以 |
| $L > N$ | 截斷(加窗) | 截取片段的頻譜 | 只能還原該片段 |
| $L > N$ | 時域摺疊 | 長序列 DTFT 的 $N$ 個精確取樣 | 不行(混疊) |
| 場合 | 扱い方 | 得られるもの | $x$ を復元できるか |
|---|---|---|---|
| $L = N$ | そのまま DFT をとる | DTFT の $N$ 個の標本 | できる |
| $L < N$ | ゼロ詰め | 同じ DTFT のより密な標本 | できる |
| $L > N$ | 打ち切り(窓掛け) | 切り取った区間のスペクトル | その区間だけ |
| $L > N$ | 時間領域での折り返し | 長い系列の DTFT の $N$ 個の厳密な標本 | できない(時間領域エイリアシング) |
If what is wanted is not $N$ equally spaced points over $0$ to $2\pi$ but the value of the DTFT at arbitrary frequencies, the DFT can be dispensed with and $X(e^{j\omega}) = \sum_n x[n]\,e^{-j\omega n}$ computed directly. Two methods are in common practical use:如果你要的不是 $0 \sim 2\pi$ 上等間距的 $N$ 個點,而是 DTFT 在任意頻率上的值,可以不用 DFT,直接計算 $X(e^{j\omega}) = \sum_n x[n]\,e^{-j\omega n}$。實務上常用的方法有:欲しいものが $0$ から $2\pi$ までを等間隔に刻んだ $N$ 点ではなく、任意の周波数における DTFT の値であるなら、DFT を使わずに $X(e^{j\omega}) = \sum_n x[n]\,e^{-j\omega n}$ を直接計算すればよい。実務でよく使われる方法が二つある:
Four different things have gone under the letter $r$ so far. They are all written $r$, but the domain each one lives in and what each one means are different. This subsection comes last in §8.7 because the fourth of them, ② below, only arrives with the two-knobs figure of §8.7.2; from here on the table is meant to be a reference to come back to.前面出現過的 $r$ 共有四種用法。雖然都叫 $r$,但所在的域和意義各不相同。這一小節放在 §8.7 的最後,是因為其中第四個——下表的 ②——要到 §8.7.2 的兩個旋鈕互動圖才出現;從這裡開始,下面這張表就是一張可以隨時回來查的對照表。ここまでに現れた $r$ には四つの用法がある。どれも $r$ と書かれるが、属する領域も意味もそれぞれ異なる。この項を §8.7 の最後に置いたのは、四つのうちの一つ、下表の ② が §8.7.2 の二つのつまみの図になってようやく現れるからである。ここから先、下の表はいつでも戻って参照できる一覧として読んでほしい。
| # | Where it appears | Formula | What $r$ means | Values | Domain |
|---|---|---|---|---|---|
| ① | The "periodic cosine" slide, §8.2.3 (Example 8-2) | $x[n] = \cos\!\big(\frac{2\pi rn}{N}\big)$, $r \in \mathbb{Z}$ | The signal's frequency: how many whole periods fit inside the $N$ points, which is also the DFT bin it lands on | An integer; the meaningful range is $0$ to $N/2$ | Frequency |
| ② | The slider "$r$ (periods inside the $N$ points)" on the two-knobs figure of §8.7.2 | The same as ①, but $r$ may be fractional | The same as ①, except that it is allowed to fall between two bins, which is how leakage is watched | A real number | Frequency |
| ③ | The "periodic sinc" slide — the kernel in §8.2.4, its zeros tabulated in §8.2.5 under "key values of the real factor" | $\frac{\Delta\omega_k}{2} = \frac{r\pi}{N}$, $r = \pm1, \pm2, \dots$ | The zero index of the periodic sinc: how many bins away from the centre the zero sits ($\Delta\omega_k = 2\pi r/N$) | A non-zero integer | Frequency |
| ④ | The "DFT from an overlength DTFT" slide, §8.5 (the formula itself first appears in §8.1.3) | $\tilde{x}[n] = \sum_r x[n - rN]$ | How many whole periods $N$ a sample has been shifted by — the copy index of the time-domain aliasing | Every integer | Time |
| # | 出現位置 | 公式 | $r$ 的意義 | 取值 | 所在的域 |
|---|---|---|---|---|---|
| ① | §8.2.3「週期餘弦」投影片(範例 8-2) | $x[n] = \cos\!\big(\frac{2\pi rn}{N}\big)$,$r \in \mathbb{Z}$ | 訊號的頻率:$N$ 點內走幾個週期,也就是 DFT 的 bin 位置 | 整數;有意義的範圍 $0 \sim N/2$ | 頻率 |
| ② | §8.7.2 兩個旋鈕互動圖的滑桿「$r$($N$ 點內的週期數)」 | 同 ①,但 $r$ 可為小數 | 同 ①,允許落在兩個 bin 之間,用來觀察洩漏 | 實數 | 頻率 |
| ③ | 「Periodic sinc」投影片——核本身在 §8.2.4,零點列在 §8.2.5「實數部分的關鍵值」表中 | $\frac{\Delta\omega_k}{2} = \frac{r\pi}{N}$,$r = \pm1, \pm2, \dots$ | 週期性 sinc 的零點編號:距離中心幾個 bin($\Delta\omega_k = 2\pi r/N$) | 非零整數 | 頻率 |
| ④ | §8.5「DFT from overlength DTFT」投影片(式子本身首次出現於 §8.1.3) | $\tilde{x}[n] = \sum_r x[n - rN]$ | 樣本被平移了幾個週期 $N$(時域混疊的複本編號) | 所有整數 | 時間 |
| # | 現れる場所 | 式 | $r$ の意味 | 取る値 | 属する領域 |
|---|---|---|---|---|---|
| ① | §8.2.3 の「周期余弦」のスライド(例 8-2) | $x[n] = \cos\!\big(\frac{2\pi rn}{N}\big)$、$r \in \mathbb{Z}$ | 信号の周波数。$N$ 点のなかに周期がいくつ入るか、すなわち落ちる DFT のビンの位置 | 整数。意味のある範囲は $0 \sim N/2$ | 周波数 |
| ② | §8.7.2 の二つのつまみの図のスライダー「$r$($N$ 点のなかの周期数)」 | ① と同じ。ただし $r$ は小数でもよい | ① と同じ。ただし二つのビンのあいだに落ちることを許す。漏れを観察するためである | 実数 | 周波数 |
| ③ | 「periodic sinc」のスライド —— 核そのものは §8.2.4、零点は §8.2.5 の「実数因子の主要な値」の表にある | $\frac{\Delta\omega_k}{2} = \frac{r\pi}{N}$、$r = \pm1, \pm2, \dots$ | 周期 sinc の零点の番号。中心から何ビン離れた位置に零点があるか($\Delta\omega_k = 2\pi r/N$) | 非零の整数 | 周波数 |
| ④ | §8.5 の「DFT from overlength DTFT」のスライド(式そのものの初出は §8.1.3) | $\tilde{x}[n] = \sum_r x[n - rN]$ | 標本が周期 $N$ の何個ぶん平行移動されたか —— 時間領域エイリアシングにおける複製の番号 | すべての整数 | 時間 |
Conversions, for ① and ②. The first three rows are not new: the chapter has already stated each of them, and the right-hand column says where, so that this table is a place to look them up together rather than a second statement of them. Only the last row, samples per cycle, is said here for the first time.對照換算(① 與 ②):前三列都不是新的,本章先前已經分別說過,右欄註明了說在哪裡,所以這張表是把它們擺在一起查的地方,而不是把它們再講一次。只有最後一列「每週期樣本數」是這裡才第一次寫出來。対照の換算(① と ②)。最初の三行は新しいものではない。本章がすでにそれぞれ述べており、右の欄にどこで述べたかを記した。したがってこの表は、それらをまとめて引くための場所であって、二度目の説明ではない。最後の行「一周期あたりの標本数」だけが、ここで初めて書かれるものである。
| Written as | In terms of $r$ | Where the chapter already says it |
|---|---|---|
| DFT bin index | $k = r$ (the negative frequency at $k = N - r$) | §8.2.3, the two lines at $k_0$ and $N-k_0$; §8.3.3, "bins above $N/2$ represent negative frequencies" |
| Normalized angular frequency | $\omega_0 = 2\pi r / N$ rad/sample | §8.1.3 and the symbol table of §8.2.1, $\omega_k = 2\pi k/N$ |
| Normalized frequency | $f/f_s = r/N$ cycles/sample | §8.3.3, $f_k = k F_s/N$ Hz, divided through by $F_s$ |
| Samples per cycle | $N/r$ | — said here for the first time |
| 表示法 | 用 $r$ 表示 | 本章何處已經寫過 |
|---|---|---|
| DFT bin 位置 | $k = r$(負頻率在 $k = N - r$) | §8.2.3 在 $k_0$ 與 $N-k_0$ 的兩根譜線;§8.3.3「超過 $N/2$ 的頻格代表負頻率」 |
| 正規化角頻率 | $\omega_0 = 2\pi r / N$ rad/sample | §8.1.3 與 §8.2.1 的符號表,$\omega_k = 2\pi k/N$ |
| 正規化頻率 | $f/f_s = r/N$ cycles/sample | §8.3.3 的 $f_k = k F_s/N$ Hz,兩邊同除以 $F_s$ |
| 每週期樣本數 | $N/r$ | —— 這裡才第一次寫出來 |
| 表し方 | $r$ で書くと | 本章のどこで既に述べたか |
|---|---|---|
| DFT のビンの位置 | $k = r$(負の周波数は $k = N - r$) | §8.2.3 の $k_0$ と $N-k_0$ に立つ二本の線。§8.3.3 の「$N/2$ を超えるビンは負の周波数を表す」 |
| 正規化角周波数 | $\omega_0 = 2\pi r / N$ rad/sample | §8.1.3 および §8.2.1 の記号表の $\omega_k = 2\pi k/N$ |
| 正規化周波数 | $f/f_s = r/N$ cycles/sample | §8.3.3 の $f_k = k F_s/N$ Hz を $F_s$ で割ったもの |
| 一周期あたりの標本数 | $N/r$ | —— ここで初めて書くもの |
All four are counting "how many elementary units". For ①②③ the unit is the frequency spacing $2\pi/N$ — one bin; for ④ it is the time length $N$ — one DFT period. ① and ③ taken together are what explains why an integer $r$ does not leak: the signal sits on bin $r$, and every other bin falls on a zero of the sinc, an integer number ③ of bins away from the centre.共同點:四種 $r$ 都是在數「幾個基本單位」。①②③ 的單位是頻率間距 $2\pi/N$(一個 bin),④ 的單位是時間長度 $N$(一個 DFT 週期)。① 與 ③ 合起來就說明了為什麼整數 $r$ 不洩漏:訊號在 bin $r$ 上,其他 bin 都落在 sinc 的零點上(與中心相距 ③ 的整數 $r$ 個 bin)。四つの $r$ はいずれも「基本単位がいくつぶんか」を数えている。①②③ の単位は周波数の間隔 $2\pi/N$、すなわち一つのビンであり、④ の単位は時間長 $N$、すなわち DFT の一周期である。① と ③ を合わせたものこそ、整数の $r$ が漏れない理由の説明になっている。信号はビン $r$ の上にあり、ほかのビンはすべて sinc の零点に落ちる —— 中心から ③ の整数 $r$ 個ぶんのビンだけ離れた位置に。
That is exactly the measurement §8.7.2 reports when "snap to bin" is pressed with no window: at $N = 16$ the largest non-peak bin is $1.4 \times 10^{-14}$, which is zero to machine precision. Checked here over every $N$ from $6$ to $32$ and every integer $r$ from $1$ to $N/2$, the largest non-peak bin of $\cos(2\pi rn/N)$ is $7.7 \times 10^{-14}$ — the same statement, with the arithmetic done rather than quoted. Let the frequency off the grid and the same two sections, §8.7.2 and §8.7.3, are about nothing else but the leakage that follows.這正是 §8.7.2 按下「對齊格點」且不加窗時量到的結果:$N = 16$ 時最大的非峰值 bin 是 $1.4 \times 10^{-14}$,也就是機器精度下的零。這裡再把 $N$ 從 $6$ 掃到 $32$、$r$ 從 $1$ 掃到 $N/2$ 的每一個整數,$\cos(2\pi rn/N)$ 的最大非峰值 bin 是 $7.7 \times 10^{-14}$——同一句話,只是把算術真的算過一遍。讓頻率離開格點,§8.7.2 與 §8.7.3 這兩節講的就只剩下隨之而來的洩漏。これはまさに、§8.7.2 で窓を掛けずに「格子点に合わせる」を押したときの測定値である。$N = 16$ では頂点以外で最大のビンが $1.4 \times 10^{-14}$、すなわち機械精度の零である。ここでは $N$ を $6$ から $32$ まで、$r$ を $1$ から $N/2$ までの整数すべてにわたって掃いて確かめた。$\cos(2\pi rn/N)$ の頂点以外で最大のビンは $7.7 \times 10^{-14}$ である —— 同じ主張を、引用ではなく実際に計算したものである。周波数を格子から外せば、§8.7.2 と §8.7.3 の二つの項が扱っているのは、そこから生じる漏れにほかならない。
The three panels demonstrate ①②, ③ and ④ respectively. $N$ is shared by all three, so moving it moves the bin spacing, the zero spacing and the period of the folding at once.三個面板分別示範 ①②、③、④。$N$ 為三者共用,所以拖動 $N$ 會同時改變 bin 間距、零點間距與摺疊的週期。三つの面はそれぞれ ①②、③、④ を示す。$N$ は三者で共用なので、$N$ を動かせばビンの間隔、零点の間隔、折り返しの周期が同時に変わる。
①② frequency $r$. In the time domain on the left, the green hairlines mark where each period is completed, $r$ of them in all. In the frequency domain on the right the peaks appear at $k = r$ and $k = N - r$. Drag the slider: on an integer every other bin is $0$ (①); off an integer the peak falls between two bins and every bin has a value (②, leakage).①② 頻率 $r$:左邊時域中綠色細線標出每完成一個週期的位置,共 $r$ 個。右邊頻域中,峰出現在 $k = r$ 和 $k = N - r$。拖動滑桿,整數時其他 bin 全為 0(①);非整數時峰落在 bin 之間,所有 bin 都有值(②,洩漏)。①② 周波数 $r$。左の時間領域では、緑の細線が周期を一つ終える位置を示す。全部で $r$ 本ある。右の周波数領域では、頂点が $k = r$ と $k = N - r$ に現れる。スライダーを動かすと、整数のときはほかのビンがすべて 0 になり(①)、非整数のときは頂点がビンのあいだに落ちて、すべてのビンに値が立つ(②、すなわち漏れ)。
One boundary case the slider can reach, since its top is $N/2$: at $r = N/2$ exactly, $k = r$ and $k = N - r$ are the same bin, so the two lines of height $N/2$ land on top of each other and the single surviving line has height $N$. That is the only integer $r$ for which the figure shows one peak rather than two, and the readout says so.滑桿上限是 $N/2$,所以有一個邊界情況會碰到:$r$ 恰好等於 $N/2$ 時,$k = r$ 與 $k = N - r$ 是同一個 bin,兩根高度 $N/2$ 的譜線疊在一起,剩下的那一根高度為 $N$。這是唯一一個圖上只會出現一個峰而不是兩個峰的整數 $r$,讀數也會這樣寫。スライダーの上限が $N/2$ なので、一つだけ境界の場合に届く。$r$ がちょうど $N/2$ のとき、$k = r$ と $k = N - r$ は同じビンであり、高さ $N/2$ の線が二本重なって、残る一本の高さは $N$ になる。図に頂点が二つではなく一つだけ現れる整数の $r$ はこれだけであり、読み出しにもそう書かれる。
③ zero index $r$. The purple curve is the periodic sinc. The open circles are its zeros, numbered $r = \pm1, \pm2, \dots$, and neighbouring zeros are exactly one bin ($2\pi/N$) apart. $r = 0$ is the main-lobe peak $N$; at $r = \pm N$, where $\Delta\omega = \pm 2\pi$, the curve periodically returns to $\pm N$, which is the slide's "$= (-)N$ when $\Delta\omega_k/2 = \pi$".③ 零點編號 $r$:紫色曲線是週期性 sinc。空心圈是零點,編號 $r = \pm1, \pm2, \dots$,相鄰零點間距正好一個 bin($2\pi/N$)。$r = 0$ 是主瓣峰值 $N$;$r = \pm N$ 時 $\Delta\omega = \pm 2\pi$,曲線週期性地回到 $\pm N$,對應投影片中「$= (-)N$ when $\Delta\omega_k/2 = \pi$」。③ 零点の番号 $r$。紫の曲線が周期 sinc である。白丸がその零点で、$r = \pm1, \pm2, \dots$ と番号づけられ、隣り合う零点の間隔はちょうど一ビン($2\pi/N$)である。$r = 0$ は主ローブの頂点 $N$ である。$r = \pm N$ すなわち $\Delta\omega = \pm 2\pi$ では、曲線が周期的に $\pm N$ へ戻る。これがスライドの「$= (-)N$ when $\Delta\omega_k/2 = \pi$」にあたる。
The slide's parenthesised minus is not optional decoration and it is not always a minus. The quantity being signed is the real factor $\sin(N\Delta\omega_k/2)/\sin(\Delta\omega_k/2)$ exactly as §8.2.5 writes it — the signed kernel, not its magnitude. At $\Delta\omega_k/2 = \pi$ both sine factors vanish, and the limit comes out $(-1)^{N-1}N$: that is $-N$ when $N$ is even and $+N$ when $N$ is odd, which is the sign rule already given in the "key values of the real factor" table and in the caption of Fig. 8-1c. Evaluated here for $N = 5,6,7,8,15,16,17$, both by the limiting form and by approaching $\Delta\omega = 2\pi$ numerically, the two agree with $(-1)^{N-1}N$ every time. Panel ③ labels the repeated peak accordingly, and its footline names the sign for the $N$ currently set. Plot $\left|\cdot\right|$ instead, as the magnitude figures of §8.2.4 do, and the sign is simply not visible.投影片上那個括號裡的負號不是可有可無的裝飾,也不是永遠都是負的。被標正負號的是實數部分 $\sin(N\Delta\omega_k/2)/\sin(\Delta\omega_k/2)$,就是 §8.2.5 寫下的那個帶正負號的核,而不是它的絕對值。在 $\Delta\omega_k/2 = \pi$ 處分子分母同時為零,取極限得到 $(-1)^{N-1}N$:$N$ 為偶數時是 $-N$,$N$ 為奇數時是 $+N$,這正是「實數部分的關鍵值」表與圖 8-1c 圖說已經給過的符號規則。這裡對 $N = 5,6,7,8,15,16,17$ 各算了一次,用極限形式算一次、再讓 $\Delta\omega$ 數值逼近 $2\pi$ 算一次,兩者每一次都與 $(-1)^{N-1}N$ 相符。面板 ③ 的重複峰就是照這樣標的,底下那行會寫出目前這個 $N$ 的符號。如果改畫 $\left|\cdot\right|$,像 §8.2.4 的振幅圖那樣,符號根本就看不到。スライドの括弧つきの負号は、あってもなくてもよい飾りではないし、つねに負とも限らない。符号がつくのは実数因子 $\sin(N\Delta\omega_k/2)/\sin(\Delta\omega_k/2)$、すなわち §8.2.5 が書いたとおりの符号つきの核であって、その絶対値ではない。$\Delta\omega_k/2 = \pi$ では分子も分母も零になり、極限は $(-1)^{N-1}N$ となる。$N$ が偶数なら $-N$、奇数なら $+N$ である。これは「実数因子の主要な値」の表と図 8-1c の説明がすでに与えている符号の規則そのものである。ここでは $N = 5,6,7,8,15,16,17$ について、極限の形から求める方法と、$\Delta\omega$ を数値的に $2\pi$ へ近づける方法の二通りで計算し、いずれも毎回 $(-1)^{N-1}N$ と一致した。面 ③ の繰り返しの頂点はそのように標示してあり、下の行には現在の $N$ に対する符号が書かれる。§8.2.4 の振幅の図のように $\left|\cdot\right|$ を描けば、符号はそもそも見えない。
④ shift count $r$. On the upper row the original sequence is divided into coloured pieces, each labelled with the shift $rN$ it needs in order to enter the window (the gold band). $r > 0$ means it comes from the left and moves right; $r < 0$ means it comes from the right and moves left. The lower row is the superposed result, each bar stacked out of the different colours, that is out of the different $r$.④ 平移週期數 $r$:上排原始序列依顏色分段,每段標示需要平移 $rN$ 才進入視窗(橘底)。$r > 0$ 表示來自左邊、往右移;$r < 0$ 表示來自右邊、往左移。下排是疊加結果,每根長條由不同顏色(不同 $r$)堆成。④ 平行移動の周期数 $r$。上段ではもとの系列が色で区画に分けられ、各区画には窓(金色の帯)に入るのに必要な平行移動 $rN$ が示してある。$r > 0$ は左から来て右へ動くこと、$r < 0$ は右から来て左へ動くことを意味する。下段は重ね合わせた結果であり、各棒は異なる色、すなわち異なる $r$ から積み上がっている。
Set ①'s $r$ to an integer. In the spectrum on the right, every bin other than $k = r$ is an integer number of bins away from it, and that integer is precisely the number of one of ③'s zeros. So ①'s frequency $r$ and ③'s zero index $r$, different in meaning as they are, are exactly the two keys to "an integer $r$ does not leak".調整 ① 的 $r$ 為整數時,右邊頻譜中除了 $k = r$,其他 bin 與它的距離都是整數個 bin,正好對應 ③ 中某個零點的編號。所以 ① 的頻率 $r$ 與 ③ 的零點 $r$ 雖然意義不同,卻正是「整數 $r$ 不洩漏」的兩個關鍵。① の $r$ を整数に合わせる。右のスペクトルでは、$k = r$ 以外のどのビンも、そこから整数ビンぶん離れており、その整数はまさに ③ のどれかの零点の番号である。したがって ① の周波数 $r$ と ③ の零点の番号 $r$ は、意味こそ違うが、「整数の $r$ は漏れない」ことの二つの鍵そのものである。
Verified rather than asserted: at $N = 16$, $r = 3$, the fourteen bins other than $k = 3$ and $k = 13$ sit at $\Delta\omega = 2\pi m/N$ for integer $m \ne 0$, and the largest value the kernel takes at any of them is $5.9 \times 10^{-15}$; the largest non-peak DFT bin is $1.5 \times 10^{-14}$ against peaks of exactly $8 = N/2$. Over $N = 4$ to $40$ and every $r$ with $|r| \le 3N$ that is not a multiple of $N$, the largest value at a predicted zero is $9.8 \times 10^{-13}$, while at the half-bin midpoints between those zeros the kernel never drops below $1.00$ — so the zeros are these positions and no others. This is the same mechanism §8.2.5 uses for a different purpose, where "kernel $k$ equals $N$ on its own bin and $0$ on every other bin" is what makes the interpolated DTFT pass through every $X[k]$; here it is read the other way round, as the reason the bins beside an on-grid tone are empty. Off the grid, as §8.7.2 and §8.7.3 show, the bins no longer land on the zeros at all and that emptiness is what is lost.這是算過的,不是斷言的:$N = 16$、$r = 3$ 時,除了 $k = 3$ 與 $k = 13$ 以外的那十四個 bin 都落在 $\Delta\omega = 2\pi m/N$($m$ 為非零整數)上,核在其中任何一點取到的最大值是 $5.9 \times 10^{-15}$;最大的非峰值 DFT bin 是 $1.5 \times 10^{-14}$,而峰值正好是 $8 = N/2$。再把 $N$ 從 $4$ 掃到 $40$、$r$ 掃過所有 $|r| \le 3N$ 且不是 $N$ 的倍數者,核在預測零點處的最大值是 $9.8 \times 10^{-13}$;而在這些零點之間的半格中點上,核從來沒有低於 $1.00$——所以零點就是這些位置,沒有別的。這和 §8.2.5 用的是同一個機制,只是那裡的用途不同:那裡說「第 $k$ 個核在自己的格點上等於 $N$、在其他每個格點上等於 $0$」,是為了讓內插出來的 DTFT 恰好通過每一個 $X[k]$;這裡則是反過來讀,當成「落在格點上的音,旁邊的 bin 是空的」的理由。一旦離開格點,像 §8.7.2 與 §8.7.3 所示,bin 就再也不落在零點上了,失去的正是那份空。主張ではなく計算して確かめた。$N = 16$、$r = 3$ のとき、$k = 3$ と $k = 13$ 以外の十四個のビンは $\Delta\omega = 2\pi m/N$($m$ は非零の整数)の上にあり、そのいずれにおいても核がとる最大値は $5.9 \times 10^{-15}$ である。頂点以外で最大の DFT ビンは $1.5 \times 10^{-14}$、一方で頂点はちょうど $8 = N/2$ である。さらに $N$ を $4$ から $40$ まで、$r$ を $|r| \le 3N$ かつ $N$ の倍数でないものすべてにわたって掃くと、予測した零点での最大値は $9.8 \times 10^{-13}$ であり、それらの零点のあいだの半ビンの中点では核は $1.00$ を下回ることがない —— つまり零点はこれらの位置であって、ほかにはない。これは §8.2.5 が用いるのと同じ仕組みであり、ただし目的が違う。あちらでは「第 $k$ の核は自分のビンで $N$、ほかのどのビンでも $0$」であることが、内挿された DTFT がすべての $X[k]$ を通る理由であった。ここではそれを逆向きに読み、格子上の音の隣のビンが空である理由としている。格子から外れれば、§8.7.2 と §8.7.3 が示すとおり、ビンはもはや零点にまったく落ちず、失われるのはまさにその空白である。
$X[k] = \sum_{n=0}^{N-1} x[n] W_N^{kn}$, $\;x[n] = \frac{1}{N}\sum_{k=0}^{N-1} X[k] W_N^{-kn}$, with $W_N = e^{-j2\pi/N}$. The DFT equals the DTFT sampled at $\omega_k = 2\pi k/N$ (exact iff signal length $\le N$), and equals one period of the DFS.$X[k] = \sum_{n=0}^{N-1} x[n] W_N^{kn}$、$\;x[n] = \frac{1}{N}\sum_{k=0}^{N-1} X[k] W_N^{-kn}$,其中 $W_N = e^{-j2\pi/N}$。DFT 等於在 $\omega_k = 2\pi k/N$ 上取樣的 DTFT(當且僅當訊號長度 $\le N$ 時精確成立),也等於 DFS 的一個週期。$X[k] = \sum_{n=0}^{N-1} x[n] W_N^{kn}$、$\;x[n] = \frac{1}{N}\sum_{k=0}^{N-1} X[k] W_N^{-kn}$、ただし $W_N = e^{-j2\pi/N}$。DFT は DTFT を $\omega_k = 2\pi k/N$ で標本化したものに等しく(厳密に成り立つのは信号長 $\le N$ のときに限る)、また DFS の一周期に等しい。
$\mathbf{X} = \mathbf{W}_N \mathbf{x}$ with $[\mathbf{W}_N]_{kn} = W_N^{kn}$; symmetric, and $\mathbf{W}_N^{-1} = \mathbf{W}_N^{*}/N$, so $\mathbf{W}_N/\sqrt{N}$ is unitary. Direct cost $\mathcal{O}(N^2)$; the FFT brings it to $\mathcal{O}(N\log_2 N)$.$\mathbf{X} = \mathbf{W}_N \mathbf{x}$,其中 $[\mathbf{W}_N]_{kn} = W_N^{kn}$;此矩陣對稱,且 $\mathbf{W}_N^{-1} = \mathbf{W}_N^{*}/N$,所以 $\mathbf{W}_N/\sqrt{N}$ 是么正的。直接計算的代價是 $\mathcal{O}(N^2)$;FFT 把它降到 $\mathcal{O}(N\log_2 N)$。$\mathbf{X} = \mathbf{W}_N \mathbf{x}$、ただし $[\mathbf{W}_N]_{kn} = W_N^{kn}$。この行列は対称であり、$\mathbf{W}_N^{-1} = \mathbf{W}_N^{*}/N$ なので $\mathbf{W}_N/\sqrt{N}$ はユニタリである。直接計算の計算量は $\mathcal{O}(N^2)$、FFT はこれを $\mathcal{O}(N\log_2 N)$ にする。
Shift → phase ramp $W_N^{km}X[k]$; reversal/conjugation flip $k$; real signals give $X[k]=X^*[N-k]$; duality $X[n] \leftrightarrow N x[((-k))_N]$; Parseval $\sum|x|^2 = \frac{1}{N}\sum|X|^2$.位移 → 相位斜坡 $W_N^{km}X[k]$;反轉/共軛會翻轉 $k$;實數訊號滿足 $X[k]=X^*[N-k]$;對偶性 $X[n] \leftrightarrow N x[((-k))_N]$;Parseval $\sum|x|^2 = \frac{1}{N}\sum|X|^2$。シフト → 位相の傾斜 $W_N^{km}X[k]$。反転/共役は $k$ を裏返す。実数信号は $X[k]=X^*[N-k]$ を満たす。双対性は $X[n] \leftrightarrow N x[((-k))_N]$。Parseval は $\sum|x|^2 = \frac{1}{N}\sum|X|^2$。
$X_1[k]X_2[k] \leftrightarrow$ circular convolution = linear convolution aliased mod $N$. For linear convolution zero-pad to $N \ge L+P-1$. Long signals: overlap-add with length-$L$ blocks, $N$-point FFTs, add the $P-1$ overlapping tail samples.$X_1[k]X_2[k] \leftrightarrow$ 循環摺積 = 對 $N$ 取模混疊後的線性摺積。要得到線性摺積就補零到 $N \ge L+P-1$。長訊號則用重疊相加法:長度 $L$ 的區塊、$N$ 點 FFT,再把重疊的 $P-1$ 個尾端樣本相加。$X_1[k]X_2[k] \leftrightarrow$ 円状畳み込み = $N$ を法としてエイリアシングを受けた線形畳み込み。線形畳み込みを得るには $N \ge L+P-1$ までゼロ詰めする。長い信号には重畳加算法を使う。長さ $L$ のブロック、$N$ 点 FFT、重なった $P-1$ 個の末尾標本を加算する。
Refines the frequency grid to $F_s/N$ (interpolates the same DTFT) but resolution stays $\approx F_s/L$, set by the actual data length $L$. More data, not more zeros, separates close tones.把頻率格點細化到 $F_s/N$(在同一條 DTFT 上做內插),但解析度仍然是 $\approx F_s/L$,由實際的資料長度 $L$ 決定。要分開靠得近的兩個音,靠的是更多資料,不是更多零。周波数格子を $F_s/N$ まで細かくする(同一の DTFT を内挿する)が、分解能は実際のデータ長 $L$ が決める $\approx F_s/L$ のままである。近接する音を分離するのは、零を増やすことではなくデータを増やすことである。
Truncation multiplies by $w[n]$ → spectrum convolved with $W(e^{j\omega})$. Rectangular: narrowest main lobe ($4\pi/N$), $-13$ dB sidelobes. Hann/Hamming: $8\pi/N$ main lobe, $-31$/$-41$ dB sidelobes. Trade resolution for leakage suppression.截斷等於乘上 $w[n]$ → 頻譜與 $W(e^{j\omega})$ 摺積。矩形窗:主瓣最窄($4\pi/N$),旁瓣 $-13$ dB。Hann/Hamming:主瓣 $8\pi/N$,旁瓣 $-31$/$-41$ dB。用解析度去換洩漏的抑制。打ち切りは $w[n]$ を掛けることであり → スペクトルは $W(e^{j\omega})$ と畳み込まれる。矩形窓:主ローブが最も狭く($4\pi/N$)、サイドローブは $-13$ dB。Hann/Hamming:主ローブ $8\pi/N$、サイドローブ $-31$/$-41$ dB。分解能を漏れの抑制と引き換えにする。
Problem: Compute the 4-point DFT of $x[n] = \{1, 2, 3, 4\}$ using the DFT matrix $\mathbf{W}_4$. Verify your answer with Parseval's relation, and state which symmetry property your result must satisfy and check it.題目:用 DFT 矩陣 $\mathbf{W}_4$ 計算 $x[n] = \{1, 2, 3, 4\}$ 的 4 點 DFT。以 Parseval 關係驗證你的答案,並說明你的結果必須滿足哪一項對稱性質,然後檢查它。問題:DFT 行列 $\mathbf{W}_4$ を用いて $x[n] = \{1, 2, 3, 4\}$ の 4 点 DFT を計算せよ。Parseval の関係で答えを検算し、その結果が満たすべき対称性の性質を述べて確かめよ。
With $W_4 = e^{-j\pi/2} = -j$:取 $W_4 = e^{-j\pi/2} = -j$:$W_4 = e^{-j\pi/2} = -j$ とすると:
$$\mathbf{X} = \begin{bmatrix} 1 & 1 & 1 & 1\\ 1 & -j & -1 & j\\ 1 & -1 & 1 & -1\\ 1 & j & -1 & -j \end{bmatrix} \begin{bmatrix}1\\2\\3\\4\end{bmatrix} = \begin{bmatrix} 10\\ (1-3) + (-2+4)j\\ 1-2+3-4\\ (1-3) + (2-4)j \end{bmatrix} = \begin{bmatrix}10\\ -2+2j\\ -2\\ -2-2j\end{bmatrix}$$$$\mathbf{X} = \begin{bmatrix} 1 & 1 & 1 & 1\\ 1 & -j & -1 & j\\ 1 & -1 & 1 & -1\\ 1 & j & -1 & -j \end{bmatrix} \begin{bmatrix}1\\2\\3\\4\end{bmatrix} = \begin{bmatrix} 10\\ (1-3) + (-2+4)j\\ 1-2+3-4\\ (1-3) + (2-4)j \end{bmatrix} = \begin{bmatrix}10\\ -2+2j\\ -2\\ -2-2j\end{bmatrix}$$$$\mathbf{X} = \begin{bmatrix} 1 & 1 & 1 & 1\\ 1 & -j & -1 & j\\ 1 & -1 & 1 & -1\\ 1 & j & -1 & -j \end{bmatrix} \begin{bmatrix}1\\2\\3\\4\end{bmatrix} = \begin{bmatrix} 10\\ (1-3) + (-2+4)j\\ 1-2+3-4\\ (1-3) + (2-4)j \end{bmatrix} = \begin{bmatrix}10\\ -2+2j\\ -2\\ -2-2j\end{bmatrix}$$
Parseval check: $\sum_n |x[n]|^2 = 1+4+9+16 = 30$, and $\frac{1}{4}\sum_k |X[k]|^2 = \frac{1}{4}(100 + 8 + 4 + 8) = \frac{120}{4} = 30$. ✓Parseval 驗算:$\sum_n |x[n]|^2 = 1+4+9+16 = 30$,而 $\frac{1}{4}\sum_k |X[k]|^2 = \frac{1}{4}(100 + 8 + 4 + 8) = \frac{120}{4} = 30$。✓Parseval による検算:$\sum_n |x[n]|^2 = 1+4+9+16 = 30$ であり、$\frac{1}{4}\sum_k |X[k]|^2 = \frac{1}{4}(100 + 8 + 4 + 8) = \frac{120}{4} = 30$。✓
Symmetry check: $x[n]$ is real, so we need $X[k] = X^{*}[4-k]$: indeed $X[1] = -2+2j = (X[3])^{*} = (-2-2j)^{*}$ ✓, and $X[0]=10$, $X[2]=-2$ are both real as required. Also $X[0] = \sum_n x[n] = 10$ ✓.對稱性驗算:$x[n]$ 是實數,所以必須滿足 $X[k] = X^{*}[4-k]$:確實 $X[1] = -2+2j = (X[3])^{*} = (-2-2j)^{*}$ ✓,而 $X[0]=10$、$X[2]=-2$ 也如預期都是實數。另外 $X[0] = \sum_n x[n] = 10$ ✓。対称性の検算:$x[n]$ は実数なので $X[k] = X^{*}[4-k]$ が必要である。実際 $X[1] = -2+2j = (X[3])^{*} = (-2-2j)^{*}$ ✓ であり、$X[0]=10$ と $X[2]=-2$ はどちらも要請どおり実数である。さらに $X[0] = \sum_n x[n] = 10$ ✓。
Problem: Let $X[k]$ be the $N$-point DFT of a real sequence $x[n]$. Express in terms of $X[k]$: (a) the DFT of $y_1[n] = x[((n-2))_N]$; (b) the DFT of $y_2[n] = x[((-n))_N]$; (c) the DFT of $y_3[n] = (-1)^n x[n]$ for even $N$; (d) the value of $\sum_{k=0}^{N-1} X[k]$.題目:設 $X[k]$ 為實數序列 $x[n]$ 的 $N$ 點 DFT。請用 $X[k]$ 表示:(a) $y_1[n] = x[((n-2))_N]$ 的 DFT;(b) $y_2[n] = x[((-n))_N]$ 的 DFT;(c) $N$ 為偶數時 $y_3[n] = (-1)^n x[n]$ 的 DFT;(d) $\sum_{k=0}^{N-1} X[k]$ 的值。問題:$X[k]$ を実数系列 $x[n]$ の $N$ 点 DFT とする。次を $X[k]$ で表せ。(a) $y_1[n] = x[((n-2))_N]$ の DFT。(b) $y_2[n] = x[((-n))_N]$ の DFT。(c) $N$ が偶数のときの $y_3[n] = (-1)^n x[n]$ の DFT。(d) $\sum_{k=0}^{N-1} X[k]$ の値。
(a) Circular shift property with $m=2$: $Y_1[k] = W_N^{2k} X[k] = e^{-j4\pi k/N}\,X[k]$. Same magnitude, linear phase added.(a) 取 $m=2$ 的循環位移性質:$Y_1[k] = W_N^{2k} X[k] = e^{-j4\pi k/N}\,X[k]$。振幅不變,只加上線性相位。(a) $m=2$ の円状シフトの性質より:$Y_1[k] = W_N^{2k} X[k] = e^{-j4\pi k/N}\,X[k]$。振幅は同じで、線形位相が加わる。
(b) Circular reversal: $Y_2[k] = X[((-k))_N] = X[N-k]$. Since $x[n]$ is real, $X[N-k] = X^{*}[k]$, so $Y_2[k] = X^{*}[k]$.(b) 循環反轉:$Y_2[k] = X[((-k))_N] = X[N-k]$。由於 $x[n]$ 是實數,$X[N-k] = X^{*}[k]$,所以 $Y_2[k] = X^{*}[k]$。(b) 円状反転より:$Y_2[k] = X[((-k))_N] = X[N-k]$。$x[n]$ が実数なので $X[N-k] = X^{*}[k]$ であり、したがって $Y_2[k] = X^{*}[k]$ である。
(c) $(-1)^n = e^{j\pi n} = e^{j\frac{2\pi}{N}\cdot\frac{N}{2}n} = W_N^{-\frac{N}{2}n}$, so by the circular frequency-shift property $Y_3[k] = X[((k - N/2))_N]$ — the spectrum rotated by half: low and high frequency bins swap.(c) $(-1)^n = e^{j\pi n} = e^{j\frac{2\pi}{N}\cdot\frac{N}{2}n} = W_N^{-\frac{N}{2}n}$,所以由循環頻率位移性質得 $Y_3[k] = X[((k - N/2))_N]$——頻譜整體旋轉了一半:高低頻的頻格互換。(c) $(-1)^n = e^{j\pi n} = e^{j\frac{2\pi}{N}\cdot\frac{N}{2}n} = W_N^{-\frac{N}{2}n}$ なので、円状周波数シフトの性質より $Y_3[k] = X[((k - N/2))_N]$ となる。スペクトルが半分だけ回転し、低周波のビンと高周波のビンが入れ替わる。
(d) From the IDFT at $n=0$: $x[0] = \frac{1}{N}\sum_k X[k]$, hence $\sum_{k=0}^{N-1} X[k] = N\,x[0]$. (Dual of $X[0] = \sum_n x[n]$.)(d) 由 IDFT 在 $n=0$ 處的值:$x[0] = \frac{1}{N}\sum_k X[k]$,因此 $\sum_{k=0}^{N-1} X[k] = N\,x[0]$。(這是 $X[0] = \sum_n x[n]$ 的對偶。)(d) IDFT を $n=0$ で評価すると $x[0] = \frac{1}{N}\sum_k X[k]$ であり、したがって $\sum_{k=0}^{N-1} X[k] = N\,x[0]$ となる。($X[0] = \sum_n x[n]$ の双対である。)
Problem: Let $x_1[n] = \{1, 1, 1, 1\}$ and $x_2[n] = \{1, 2, 3, 4\}$. (a) Compute the linear convolution $y_{\text{lin}}[n] = x_1[n] * x_2[n]$. (b) Compute the 4-point circular convolution and explain its values using the time-aliasing relation $y_c[n] = \sum_r y_{\text{lin}}[n+rN]$. (c) What is the minimum DFT length $N$ for which the circular convolution equals the linear one? Verify for that $N$.題目:設 $x_1[n] = \{1, 1, 1, 1\}$、$x_2[n] = \{1, 2, 3, 4\}$。(a) 計算線性摺積 $y_{\text{lin}}[n] = x_1[n] * x_2[n]$。(b) 計算 4 點循環摺積,並用時域混疊關係 $y_c[n] = \sum_r y_{\text{lin}}[n+rN]$ 解釋它的數值。(c) 要讓循環摺積等於線性摺積,DFT 長度 $N$ 最小要多少?並就該 $N$ 驗證之。問題:$x_1[n] = \{1, 1, 1, 1\}$、$x_2[n] = \{1, 2, 3, 4\}$ とする。(a) 線形畳み込み $y_{\text{lin}}[n] = x_1[n] * x_2[n]$ を計算せよ。(b) 4 点円状畳み込みを計算し、その値を時間領域エイリアシングの関係 $y_c[n] = \sum_r y_{\text{lin}}[n+rN]$ を用いて説明せよ。(c) 円状畳み込みが線形畳み込みと一致するための最小の DFT 長 $N$ はいくつか。その $N$ について検証せよ。
(a) $x_1$ is a length-4 moving-sum window over $x_2$: $$y_{\text{lin}}[n] = \{1,\; 1{+}2,\; 1{+}2{+}3,\; 1{+}2{+}3{+}4,\; 2{+}3{+}4,\; 3{+}4,\; 4\} = \{1, 3, 6, 10, 9, 7, 4\}$$ of length $L+P-1 = 7$.(a) $x_1$ 相當於對 $x_2$ 做長度 4 的滑動求和: $$y_{\text{lin}}[n] = \{1,\; 1{+}2,\; 1{+}2{+}3,\; 1{+}2{+}3{+}4,\; 2{+}3{+}4,\; 3{+}4,\; 4\} = \{1, 3, 6, 10, 9, 7, 4\}$$ 長度為 $L+P-1 = 7$。(a) $x_1$ は $x_2$ に対する長さ 4 の移動和の窓である: $$y_{\text{lin}}[n] = \{1,\; 1{+}2,\; 1{+}2{+}3,\; 1{+}2{+}3{+}4,\; 2{+}3{+}4,\; 3{+}4,\; 4\} = \{1, 3, 6, 10, 9, 7, 4\}$$ 長さは $L+P-1 = 7$ である。
(b) With $N=4$, fold the linear result modulo 4 ($y_c[n] = y_{\text{lin}}[n] + y_{\text{lin}}[n+4]$):(b) 當 $N=4$,把線性結果對 4 取模折疊($y_c[n] = y_{\text{lin}}[n] + y_{\text{lin}}[n+4]$):(b) $N=4$ では、線形の結果を 4 を法として折り返す($y_c[n] = y_{\text{lin}}[n] + y_{\text{lin}}[n+4]$):
| $n$ | $y_{\text{lin}}[n]$ | $y_{\text{lin}}[n+4]$ | $y_c[n]$ |
|---|---|---|---|
| 0 | 1 | 9 | 10 |
| 1 | 3 | 7 | 10 |
| 2 | 6 | 4 | 10 |
| 3 | 10 | — | 10 |
| $n$ | $y_{\text{lin}}[n]$ | $y_{\text{lin}}[n+4]$ | $y_c[n]$ |
|---|---|---|---|
| 0 | 1 | 9 | 10 |
| 1 | 3 | 7 | 10 |
| 2 | 6 | 4 | 10 |
| 3 | 10 | — | 10 |
| $n$ | $y_{\text{lin}}[n]$ | $y_{\text{lin}}[n+4]$ | $y_c[n]$ |
|---|---|---|---|
| 0 | 1 | 9 | 10 |
| 1 | 3 | 7 | 10 |
| 2 | 6 | 4 | 10 |
| 3 | 10 | — | 10 |
So $y_c[n] = \{10,10,10,10\}$ — matching Example 8-3 and the middle panel of Fig. 8-3. The tail $\{9,7,4\}$ wrapped onto the head $\{1,3,6\}$.所以 $y_c[n] = \{10,10,10,10\}$——與範例 8-3 以及圖 8-3 的中間那張吻合。尾巴 $\{9,7,4\}$ 繞回來疊到了頭部的 $\{1,3,6\}$ 上。ゆえに $y_c[n] = \{10,10,10,10\}$ であり、例 8-3 および図 8-3 の中央の図と一致する。尾の $\{9,7,4\}$ が頭の $\{1,3,6\}$ の上へ巻き戻ったのである。
(c) Need $N \ge L+P-1 = 7$. With $N=7$, zero-pad both to length 7; no term wraps ($y_{\text{lin}}[n+7] = 0$ for $0 \le n \le 6$), so the 7-point circular convolution is exactly $\{1,3,6,10,9,7,4\}$ — the right panel of Fig. 8-3.(c) 需要 $N \ge L+P-1 = 7$。取 $N=7$,把兩者都補零到長度 7;此時沒有任何一項會繞出去($0 \le n \le 6$ 時 $y_{\text{lin}}[n+7] = 0$),所以 7 點循環摺積恰好是 $\{1,3,6,10,9,7,4\}$——也就是圖 8-3 的右圖。(c) $N \ge L+P-1 = 7$ が必要である。$N=7$ とし、両方を長さ 7 までゼロ詰めすれば、巻き込まれる項はない($0 \le n \le 6$ で $y_{\text{lin}}[n+7] = 0$)。したがって 7 点円状畳み込みはちょうど $\{1,3,6,10,9,7,4\}$ となる —— 図 8-3 の右の図である。
Problem: Let $x[n] = a^n u[n]$ with $|a| < 1$ — an infinite-length sequence with DTFT $X(e^{j\omega}) = \dfrac{1}{1 - a e^{-j\omega}}$. Sample the DTFT at $\omega_k = 2\pi k/N$ to obtain $N$ numbers $X[k] = X(e^{j2\pi k/N})$, then take the $N$-point IDFT. Find a closed form for the resulting sequence $\hat{x}[n]$, $0 \le n \le N-1$, and compare it with $x[n]$.題目:設 $x[n] = a^n u[n]$,$|a| < 1$——這是一個無限長的序列,其 DTFT 為 $X(e^{j\omega}) = \dfrac{1}{1 - a e^{-j\omega}}$。在 $\omega_k = 2\pi k/N$ 上對這個 DTFT 取樣得到 $N$ 個數值 $X[k] = X(e^{j2\pi k/N})$,再做 $N$ 點 IDFT。請求出所得序列 $\hat{x}[n]$($0 \le n \le N-1$)的封閉形式,並與 $x[n]$ 比較。問題:$|a| < 1$ として $x[n] = a^n u[n]$ とする —— これは無限長の系列で、その DTFT は $X(e^{j\omega}) = \dfrac{1}{1 - a e^{-j\omega}}$ である。この DTFT を $\omega_k = 2\pi k/N$ で標本化して $N$ 個の数 $X[k] = X(e^{j2\pi k/N})$ を得、$N$ 点 IDFT をとる。得られる系列 $\hat{x}[n]$($0 \le n \le N-1$)の閉じた形を求め、$x[n]$ と比較せよ。
Frequency sampling periodizes time: the IDFT of the samples is $$\hat{x}[n] = \sum_{r=-\infty}^{\infty} x[n - rN] = \sum_{r \le 0} a^{\,n-rN}\,u[n-rN].$$ For $0 \le n \le N-1$ the step is satisfied for all $r \le 0$ (i.e. shifts by $0, N, 2N, \dots$ to the left bring copies of the tail into the window), so with $m = -r \ge 0$: $$\hat{x}[n] = \sum_{m=0}^{\infty} a^{\,n+mN} = a^n \sum_{m=0}^{\infty} (a^N)^m = \boxed{\;\frac{a^n}{1 - a^N}, \qquad 0 \le n \le N-1.\;}$$頻域取樣會使時域週期化:這些樣本的 IDFT 為 $$\hat{x}[n] = \sum_{r=-\infty}^{\infty} x[n - rN] = \sum_{r \le 0} a^{\,n-rN}\,u[n-rN].$$ 當 $0 \le n \le N-1$ 時,對所有 $r \le 0$ 單位步階函數都成立(也就是往左平移 $0, N, 2N, \dots$ 會把尾巴的複本帶進這個視窗),所以令 $m = -r \ge 0$: $$\hat{x}[n] = \sum_{m=0}^{\infty} a^{\,n+mN} = a^n \sum_{m=0}^{\infty} (a^N)^m = \boxed{\;\frac{a^n}{1 - a^N}, \qquad 0 \le n \le N-1.\;}$$周波数での標本化は時間を周期化する。これらの標本の IDFT は $$\hat{x}[n] = \sum_{r=-\infty}^{\infty} x[n - rN] = \sum_{r \le 0} a^{\,n-rN}\,u[n-rN].$$ $0 \le n \le N-1$ では、すべての $r \le 0$ について単位ステップが満たされる(すなわち $0, N, 2N, \dots$ だけ左へシフトすることで尾の複製が窓の中へ入ってくる)。そこで $m = -r \ge 0$ とおくと: $$\hat{x}[n] = \sum_{m=0}^{\infty} a^{\,n+mN} = a^n \sum_{m=0}^{\infty} (a^N)^m = \boxed{\;\frac{a^n}{1 - a^N}, \qquad 0 \le n \le N-1.\;}$$
Comparison: $\hat{x}[n] = x[n]/(1-a^N) > x[n]$ — every sample is inflated by the folded-in tail of the infinite sequence. This is pure time aliasing: $x[n]$ has length $> N$ (infinite), so $N$ frequency samples cannot represent it. The error factor $\frac{1}{1-a^N} \to 1$ as $N \to \infty$ (or as $|a|^N \to 0$), so taking enough frequency samples makes the aliasing negligible. E.g. $a = 0.9$, $N = 10$: $a^N \approx 0.349$, a 54% inflation at every sample; $N = 100$: $a^N \approx 2.7\times 10^{-5}$, negligible.比較:$\hat{x}[n] = x[n]/(1-a^N) > x[n]$——每一個樣本都被折疊進來的無限長尾巴給灌大了。這是純粹的時域混疊:$x[n]$ 的長度大於 $N$(其實是無限),所以 $N$ 個頻率樣本不可能表示它。當 $N \to \infty$(或 $|a|^N \to 0$)時,誤差因子 $\frac{1}{1-a^N} \to 1$,所以只要取夠多的頻率樣本,混疊就可以忽略。例如 $a = 0.9$、$N = 10$:$a^N \approx 0.349$,每個樣本被灌大 54%;$N = 100$ 時 $a^N \approx 2.7\times 10^{-5}$,可以忽略。比較:$\hat{x}[n] = x[n]/(1-a^N) > x[n]$ —— どの標本も、折り込まれた無限系列の尾によって水増しされている。これは純粋な時間領域エイリアシングである。$x[n]$ の長さは $> N$ であり(実際には無限)、$N$ 個の周波数標本ではそれを表現できない。誤差因子は $N \to \infty$ のとき(あるいは $|a|^N \to 0$ のとき)$\frac{1}{1-a^N} \to 1$ となるので、周波数標本を十分に取ればエイリアシングは無視できる。たとえば $a = 0.9$、$N = 10$ では $a^N \approx 0.349$ となり、どの標本も 54% 水増しされる。$N = 100$ では $a^N \approx 2.7\times 10^{-5}$ で無視できる。
Problem: A signal sampled at $F_s = 8$ kHz contains two sinusoids at $1000$ Hz and $1025$ Hz. (a) Using a rectangular window, estimate the minimum number of data samples $L$ needed to resolve the two tones. (b) If you capture only $L = 256$ samples but compute a $4096$-point DFT (zero padding), will the tones be resolved? Explain. (c) Repeat (a) for a Hamming window (main-lobe width $8\pi/L$). (d) What bin spacing (in Hz) does the 4096-point DFT give, and what is it good for here?題目:某訊號以 $F_s = 8$ kHz 取樣,含有 $1000$ Hz 與 $1025$ Hz 兩個正弦波。(a) 使用矩形窗時,估計要分辨這兩個音所需的最少資料樣本數 $L$。(b) 若只擷取 $L = 256$ 個樣本,卻計算 $4096$ 點的 DFT(補零),這兩個音分得開嗎?說明理由。(c) 改用 Hamming 窗(主瓣寬度 $8\pi/L$)重做 (a)。(d) 4096 點 DFT 的頻格間距是多少 Hz,在這裡有什麼用?問題:$F_s = 8$ kHz で標本化された信号に、$1000$ Hz と $1025$ Hz の二つの正弦波が含まれている。(a) 矩形窓を使う場合、二つの音を分離するのに必要な最小のデータ標本数 $L$ を見積もれ。(b) $L = 256$ 標本しか取得しないまま $4096$ 点 DFT を計算する(ゼロ詰めする)とき、二つの音は分離できるか。理由も述べよ。(c) Hamming 窓(主ローブ幅 $8\pi/L$)について (a) を繰り返せ。(d) 4096 点 DFT のビン間隔は何 Hz か。またそれはここで何の役に立つか。
(a) Two tones separated by $\Delta f = 25$ Hz need the main lobes to be distinguishable, requiring approximately $$\Delta f \ge \frac{F_s}{L} \;\Longrightarrow\; L \ge \frac{F_s}{\Delta f} = \frac{8000}{25} = 320 \text{ samples}.$$(a) 兩個相距 $\Delta f = 25$ Hz 的音,需要主瓣能被分辨,大致要求 $$\Delta f \ge \frac{F_s}{L} \;\Longrightarrow\; L \ge \frac{F_s}{\Delta f} = \frac{8000}{25} = 320 \text{ 個樣本}.$$(a) $\Delta f = 25$ Hz 離れた二つの音を区別するには主ローブが見分けられる必要があり、おおよそ次が要求される: $$\Delta f \ge \frac{F_s}{L} \;\Longrightarrow\; L \ge \frac{F_s}{\Delta f} = \frac{8000}{25} = 320 \text{ samples}.$$
(b) No. With $L = 256 < 320$, the underlying windowed DTFT already has the two main lobes merged ($F_s/L = 31.25$ Hz $> 25$ Hz). Zero padding to 4096 samples that same merged DTFT on a finer grid — it draws the single bump more smoothly but cannot split it. Resolution depends on $L$, not $N$.(b) 分不開。因為 $L = 256 < 320$,底層加窗後的 DTFT 其兩個主瓣早就糊在一起了($F_s/L = 31.25$ Hz $> 25$ Hz)。補零到 4096 只是在更細的格點上描繪同一條已經糊掉的 DTFT——它會把那個單一隆起畫得更平滑,卻無法把它劈成兩半。解析度取決於 $L$,不是 $N$。(b) できない。$L = 256 < 320$ なので、背後にある窓掛け後の DTFT の段階ですでに二つの主ローブは融合している($F_s/L = 31.25$ Hz $> 25$ Hz)。4096 までのゼロ詰めは、その同じ融合済みの DTFT をより細かい格子の上で標本化するだけである。一つの膨らみをよりなめらかに描けるが、それを割ることはできない。分解能は $N$ ではなく $L$ で決まる。
(c) The Hamming main lobe is twice as wide ($8\pi/L$ instead of $4\pi/L$), so roughly $$L \ge \frac{2F_s}{\Delta f} = \frac{2 \times 8000}{25} = 640 \text{ samples}.$$ The reward for the doubled length requirement is $-41$ dB sidelobes instead of $-13$ dB — essential if the two tones have very different amplitudes (cf. Fig. 8-6).(c) Hamming 窗的主瓣寬了一倍($8\pi/L$ 而非 $4\pi/L$),所以大致要求 $$L \ge \frac{2F_s}{\Delta f} = \frac{2 \times 8000}{25} = 640 \text{ 個樣本}.$$ 長度需求加倍換來的報酬,是旁瓣從 $-13$ dB 降到 $-41$ dB——當兩個音的振幅相差懸殊時,這是必要的(參見圖 8-6)。(c) Hamming 窓の主ローブは倍の幅をもつ($4\pi/L$ ではなく $8\pi/L$)ので、おおよそ次が要求される: $$L \ge \frac{2F_s}{\Delta f} = \frac{2 \times 8000}{25} = 640 \text{ samples}.$$ 長さの要求が倍になる見返りは、サイドローブが $-13$ dB ではなく $-41$ dB になることである。二つの音の振幅が大きく異なるときには不可欠である(図 8-6 参照)。
(d) Bin spacing $= F_s/N = 8000/4096 \approx 1.95$ Hz. Once the tones are resolved (with $L$ large enough), this fine grid lets you locate each peak to within $\pm 1$ Hz without interpolation — that is the legitimate use of zero padding.(d) 頻格間距 $= F_s/N = 8000/4096 \approx 1.95$ Hz。一旦兩個音真的被分開了($L$ 夠大時),這麼細的格點可以讓你把每個峰值定位到 $\pm 1$ Hz 以內而不需要內插——這才是補零正當的用途。(d) ビン間隔は $= F_s/N = 8000/4096 \approx 1.95$ Hz である。いったん二つの音が分離できていれば($L$ が十分に大きければ)、この細かい格子のおかげで内挿なしに各頂点を $\pm 1$ Hz 以内に位置づけることができる。これがゼロ詰めの正当な用途である。
Problem: A 5 Hz cosine is sampled at $F_s = 100$ Hz for exactly 1 second ($N = 100$ samples): $x[n] = \cos(2\pi \cdot 5 \cdot nT)$, $T = 1/F_s$.
(a) Build the $N \times N$ DFT matrix from the twiddle factor and use it to compute $X[k]$.
(b) Build the IDFT matrix from it and reconstruct $x[n]$.
(c)–(d) Repeat with MATLAB's fft / ifft and confirm the results agree.
(e) Plot $|X[k]|$ and the reconstructed $x[n]$ with stem. Predict analytically where the spectral peaks occur and their heights, and explain why the spectrum is so clean.題目:一個 5 Hz 的餘弦波以 $F_s = 100$ Hz 取樣,剛好取 1 秒($N = 100$ 個樣本):$x[n] = \cos(2\pi \cdot 5 \cdot nT)$,$T = 1/F_s$。(a) 由旋轉因子建立 $N \times N$ 的 DFT 矩陣,並用它計算 $X[k]$。(b) 由它建立 IDFT 矩陣並重建 $x[n]$。(c)–(d) 改用 MATLAB 的 fft/ifft 重做,確認結果一致。(e) 用 stem 畫出 $|X[k]|$ 與重建的 $x[n]$。請先用解析的方法預測譜峰的位置與高度,並解釋為什麼這個頻譜這麼乾淨。問題:5 Hz の余弦波を $F_s = 100$ Hz でちょうど 1 秒間標本化する($N = 100$ 標本):$x[n] = \cos(2\pi \cdot 5 \cdot nT)$、$T = 1/F_s$。(a) 回転因子から $N \times N$ の DFT 行列を構成し、それを用いて $X[k]$ を計算せよ。(b) そこから IDFT 行列を構成し、$x[n]$ を再構成せよ。(c)–(d) MATLAB の fft/ifft で同じことを行い、結果が一致することを確かめよ。(e) stem で $|X[k]|$ と再構成した $x[n]$ を描け。スペクトルの頂点がどこに、どの高さで現れるかを解析的に予測し、なぜこのスペクトルがこれほどきれいなのかを説明せよ。
Analytical prediction. The digital frequency is $\omega_0 = 2\pi f/F_s = 2\pi\cdot 5/100 = 2\pi\cdot\frac{5}{100}$, i.e. exactly $k_0 = 5$ periods fit in the $N=100$ window — the tone is on-grid. From Example 8-2: $$X[k] = \frac{N}{2}\delta[((k-5))_{100}] + \frac{N}{2}\delta[((k+5))_{100}] \;\Longrightarrow\; |X[5]| = |X[95]| = 50, \text{ all other bins } 0.$$ The spectrum is clean (no leakage) precisely because the observation window holds an integer number of periods; if $f$ were, say, 5.3 Hz, the line would leak into all bins. The IDFT matrix $\mathbf{W}^{*}/N$ must reconstruct $x[n]$ to machine precision since $\mathbf{W}^{-1} = \mathbf{W}^{*}/N$ exactly.解析預測。數位頻率為 $\omega_0 = 2\pi f/F_s = 2\pi\cdot 5/100 = 2\pi\cdot\frac{5}{100}$,也就是在 $N=100$ 的視窗中剛好容納 $k_0 = 5$ 個完整週期——這個音落在格點上。由範例 8-2: $$X[k] = \frac{N}{2}\delta[((k-5))_{100}] + \frac{N}{2}\delta[((k+5))_{100}] \;\Longrightarrow\; |X[5]| = |X[95]| = 50, \text{ 其餘頻格皆為 } 0.$$ 頻譜之所以乾淨(沒有洩漏),正是因為觀測視窗裡裝著整數個週期;若 $f$ 換成例如 5.3 Hz,那根譜線就會洩漏到所有頻格。而 IDFT 矩陣 $\mathbf{W}^{*}/N$ 必然能把 $x[n]$ 重建到機器精度,因為 $\mathbf{W}^{-1} = \mathbf{W}^{*}/N$ 是精確成立的。解析による予測。ディジタル周波数は $\omega_0 = 2\pi f/F_s = 2\pi\cdot 5/100 = 2\pi\cdot\frac{5}{100}$ であり、すなわち $N=100$ の窓にちょうど $k_0 = 5$ 周期が収まる —— この音は格子上にある。例 8-2 より: $$X[k] = \frac{N}{2}\delta[((k-5))_{100}] + \frac{N}{2}\delta[((k+5))_{100}] \;\Longrightarrow\; |X[5]| = |X[95]| = 50, \text{ all other bins } 0.$$ スペクトルがきれい(漏れがない)なのは、観測窓が整数個の周期を収めているからにほかならない。もし $f$ がたとえば 5.3 Hz だったら、その線はすべてのビンへ漏れ出していただろう。また $\mathbf{W}^{-1} = \mathbf{W}^{*}/N$ が厳密に成り立つので、IDFT 行列 $\mathbf{W}^{*}/N$ は $x[n]$ を機械精度で再構成するはずである。
Cleaned-up MATLAB code:整理過的 MATLAB 程式碼:整理した MATLAB コード:
clc; clear; close all;
% Signal: 5 Hz cosine, sampled at 100 Hz for 1 s
Fs = 100; T = 1/Fs;
t = 0:T:1-T;
f = 5;
x = cos(2*pi*f*t);
% (a) DFT via DFT matrix
N = length(x);
n = 0:N-1; k = 0:N-1;
W = exp(-1j*2*pi/N); % twiddle factor W_N
DFT_matrix = W .^ (n' * k); % [W_N]^(nk), N x N
X_a = DFT_matrix * x.'; % X[k]
% (b) IDFT via matrix: W^(-1) = conj(W)/N
IDFT_matrix = conj(DFT_matrix) / N;
x_a = IDFT_matrix * X_a; % reconstructed x[n]
% (c)-(d) Same with fft / ifft
X_c = fft(x);
x_c = ifft(X_c);
% (e) Stem plots
figure;
subplot(2,2,1); stem(k, abs(X_a), 'filled','b');
title('|X[k]| (DFT matrix)'); xlabel('k'); ylabel('|X[k]|');
subplot(2,2,2); stem(n, real(x_a),'filled','b');
title('reconstructed x[n] (IDFT matrix)'); xlabel('n'); ylabel('x[n]');
subplot(2,2,3); stem(k, abs(X_c), 'filled','b');
title('|X[k]| (fft)'); xlabel('k'); ylabel('|X[k]|');
subplot(2,2,4); stem(n, real(x_c),'filled','b');
title('reconstructed x[n] (ifft)'); xlabel('n'); ylabel('x[n]');
% Checks
max(abs(X_a.' - X_c)) % matrix DFT vs fft : ~1e-12
max(abs(x_a.' - x)) % reconstruction err : ~1e-14
Result (regenerated numerically): peaks of height $50.0000$ at $k = 5$ and $k = 95$, all other bins at round-off level; maximum reconstruction error $\approx 3.6\times 10^{-14}$.結果(以數值方式重現):在 $k = 5$ 與 $k = 95$ 處有高度 $50.0000$ 的峰值,其餘頻格都在捨入誤差的水準;最大重建誤差約 $3.6\times 10^{-14}$。結果(数値的に再現したもの):$k = 5$ と $k = 95$ に高さ $50.0000$ の頂点が立ち、他のビンはすべて丸め誤差の水準である。再構成誤差の最大値は $\approx 3.6\times 10^{-14}$ であった。
Bin-to-Hz mapping: $f_k = k F_s / N = k\cdot 100/100 = k$ Hz, so bin 5 is literally 5 Hz, and bin 95 represents $-5$ Hz (i.e. $95 - 100$). With fftshift the two lines would sit symmetrically at $\pm 5$ Hz.頻格與 Hz 的對應:$f_k = k F_s / N = k\cdot 100/100 = k$ Hz,所以第 5 格就真的是 5 Hz,而第 95 格代表 $-5$ Hz(也就是 $95 - 100$)。用 fftshift 的話,這兩根譜線會對稱地落在 $\pm 5$ Hz。ビンと Hz の対応:$f_k = k F_s / N = k\cdot 100/100 = k$ Hz なので、ビン 5 は文字どおり 5 Hz であり、ビン 95 は $-5$ Hz(すなわち $95 - 100$)を表す。fftshift を使えば、二本の線は $\pm 5$ Hz に対称に並ぶ。
Problem: Compute the $N$-point DFT ($N$ even) of:題目:計算下列各序列的 $N$ 點 DFT($N$ 為偶數):問題:次の各系列の $N$ 点 DFT を計算せよ($N$ は偶数):
(a) $x[n] = \begin{cases}1, & n \text{ even},\ 0 \le n \le N-1\\ 0, & n \text{ odd},\ 0 \le n \le N-1\end{cases}$ (b) $x[n] = \begin{cases}1, & 0 \le n \le N/2 - 1\\ 0, & N/2 \le n \le N-1\end{cases}$ (c) $x[n] = \begin{cases}\alpha^{n}, & 0 \le n \le N-1\\ 0, & \text{otherwise}\end{cases}$ (a) $x[n] = \begin{cases}1, & n \text{ 為偶數},\ 0 \le n \le N-1\\ 0, & n \text{ 為奇數},\ 0 \le n \le N-1\end{cases}$ (b) $x[n] = \begin{cases}1, & 0 \le n \le N/2 - 1\\ 0, & N/2 \le n \le N-1\end{cases}$ (c) $x[n] = \begin{cases}\alpha^{n}, & 0 \le n \le N-1\\ 0, & \text{其餘}\end{cases}$ (a) $x[n] = \begin{cases}1, & n \text{ even},\ 0 \le n \le N-1\\ 0, & n \text{ odd},\ 0 \le n \le N-1\end{cases}$ (b) $x[n] = \begin{cases}1, & 0 \le n \le N/2 - 1\\ 0, & N/2 \le n \le N-1\end{cases}$ (c) $x[n] = \begin{cases}\alpha^{n}, & 0 \le n \le N-1\\ 0, & \text{otherwise}\end{cases}$
Throughout, $W_N = e^{-j2\pi/N}$ and $X[k] = \sum_{n=0}^{N-1} x[n] W_N^{kn}$, $k = 0,\dots,N-1$.以下全部使用 $W_N = e^{-j2\pi/N}$ 與 $X[k] = \sum_{n=0}^{N-1} x[n] W_N^{kn}$,$k = 0,\dots,N-1$。以下を通じて $W_N = e^{-j2\pi/N}$、$X[k] = \sum_{n=0}^{N-1} x[n] W_N^{kn}$、$k = 0,\dots,N-1$ とする。