Digital signal processing of real-world signals begins by converting a continuous-time (CT) signal into a discrete-time (DT) sequence. Periodic sampling records the value of $x_c(t)$ at uniformly spaced sampling instants $t = nT$:
真實世界訊號的數位處理,第一步是把連續時間(CT)訊號轉換成離散時間(DT)序列。週期取樣就是在等間隔的取樣時刻 $t = nT$ 記錄 $x_c(t)$ 的值:
実世界の信号のディジタル信号処理は、連続時間(CT)信号を離散時間(DT)系列へ変換するところから始まる。周期標本化とは、等間隔に並んだ標本化時刻 $t = nT$ において $x_c(t)$ の値を記録することである:
Here $T$ is the sampling period (seconds/sample), its reciprocal $f_s = 1/T$ is the sampling frequency (samples/second or Hz), and in radian units
這裡 $T$ 是取樣週期(秒/樣本),它的倒數 $f_s = 1/T$ 是取樣頻率(樣本/秒,也就是 Hz);若換成弧度單位,則寫成
ここで $T$ は標本化周期(秒/標本)、その逆数 $f_s = 1/T$ は標本化周波数(標本/秒、すなわち Hz)であり、ラジアン単位では次のように書く
Writing $\Omega_s$ in rad/s invites a misreading: nothing here samples the frequency axis. What is being sampled is the time signal $x_c(t)$, once every $T$ seconds, to give $x[n] = x_c(nT)$. So $f_s = 1/T$ counts samples per second, and $\Omega_s = 2\pi f_s$ is the very same quantity rewritten in radian units — the frequency of the sampling operation.
把 $\Omega_s$ 寫成 rad/s 很容易引起誤解:這裡並沒有「對頻率軸取樣」。被取樣的是時間訊號 $x_c(t)$,每隔 $T$ 秒量一次,得到 $x[n] = x_c(nT)$。所以 $f_s = 1/T$ 數的是每秒幾個樣本,而 $\Omega_s = 2\pi f_s$ 只是把同一件事換成弧度單位——它是取樣這個動作的頻率。
$\Omega_s$ を rad/s で書くと誤読を招きやすい。ここでは周波数軸を標本化しているわけではない。標本化されているのは時間信号 $x_c(t)$ であり、$T$ 秒ごとに一度値を取って $x[n] = x_c(nT)$ を得る。したがって $f_s = 1/T$ は毎秒何標本かを数えた量であり、$\Omega_s = 2\pi f_s$ はまったく同じ量をラジアン単位で書き直したもの——すなわち標本化という操作の周波数である。
The reason to dress a sample rate in frequency units at all is comparison: deciding whether aliasing occurs means putting the sampling speed and the signal's own frequency content on one axis, and the test only makes sense if both sides carry rad/s:
之所以要把取樣速率寫成頻率的單位,是為了比較:要判斷會不會混疊,必須把取樣速度和訊號本身的頻率內容放到同一條軸上,而這個比較只有在兩邊單位都是 rad/s 時才成立:
標本化レートをわざわざ周波数の単位で表すのは、比較のためである。折り返しが起きるかどうかを判定するには、標本化の速さと信号自身の周波数成分を同じ一本の軸に載せる必要があり、この判定は両辺が rad/s を担ってはじめて意味をもつ:
$$\Omega_{\max} < \frac{\Omega_s}{2}$$On the left is the signal's highest radian frequency, on the right the highest frequency this sampling rate can represent.
左邊是訊號本身的最高角頻率,右邊是這個取樣率所能表示的上限;單位相同,才能比大小。
左辺は信号自身の最高角周波数、右辺はこの標本化レートで表現できる最高周波数である。
Infinitely many different CT signals pass through the same set of samples (see the aliasing demo of Fig. 6-3). The miracle of the sampling theorem (Section 6.3) is that if $x_c(t)$ is bandlimited and $T$ is small enough, the samples determine $x_c(t)$ uniquely — sampling then loses nothing.
有無限多個不同的連續訊號會通過同一組樣本(見圖 6-3 的混疊示範)。取樣定理(§6.3)的神奇之處在於:只要 $x_c(t)$ 是帶限的,而且 $T$ 夠小,這些樣本就能唯一決定 $x_c(t)$——這時候取樣一點資訊也沒有損失。
同じ標本の組を通る連続時間信号は無限に存在する(図 6-3 の折り返しのデモを参照)。標本化定理(§6.3)の驚くべき点は、もし $x_c(t)$ が帯域制限されていて $T$ が十分小さければ、標本が $x_c(t)$ を一意に決定するということである——このとき標本化は何も失わない。
To analyze sampling mathematically we use a two-stage model. First multiply $x_c(t)$ by a periodic impulse train $s(t)$, then convert the impulse areas to a sequence:
為了用數學分析取樣,我們採用兩段式的模型:先把 $x_c(t)$ 乘上週期性的脈衝串(impulse train)$s(t)$,再把每根脈衝的面積轉換成序列:
標本化を数学的に解析するために、二段階のモデルを用いる。まず $x_c(t)$ に周期的なインパルス列 $s(t)$ を掛け、次にインパルスの面積を系列へ変換する:
The signal $x_s(t)$ (also written $x_p(t)$ in the slides) is still a CT signal — a train of impulses whose areas equal the sample values $x_c(nT)$. The DT sequence $x[n]=x_c(nT)$ carries exactly the same information but lives on the integer axis, with the time scale $T$ removed.
訊號 $x_s(t)$(投影片中也寫成 $x_p(t)$)仍然是連續時間訊號——它是一串脈衝,每根脈衝的面積等於樣本值 $x_c(nT)$。離散序列 $x[n]=x_c(nT)$ 帶著完全相同的資訊,但它活在整數軸上,時間尺度 $T$ 已經被拿掉了。
信号 $x_s(t)$(スライドでは $x_p(t)$ とも書かれる)は依然として連続時間信号である——インパルスの列であり、各インパルスの面積が標本値 $x_c(nT)$ に等しい。離散時間系列 $x[n]=x_c(nT)$ はまったく同じ情報を担うが、整数軸の上に住んでおり、時間尺度 $T$ は取り除かれている。
The impulse train $s(t)$ is periodic with period $T$, so its CTFT is itself an impulse train in frequency, with spacing $\Omega_s = 2\pi/T$ and area $2\pi/T$:
脈衝串 $s(t)$ 以 $T$ 為週期,所以它的 CTFT 本身也是一串頻率上的脈衝,間距為 $\Omega_s = 2\pi/T$,每根的面積是 $2\pi/T$:
インパルス列 $s(t)$ は周期 $T$ の周期信号なので、その CTFT 自身も周波数軸上のインパルス列となり、間隔は $\Omega_s = 2\pi/T$、各インパルスの面積は $2\pi/T$ である:
Multiplication in time is convolution in frequency (divided by $2\pi$), so the spectrum of the sampled signal is a sum of shifted and scaled copies of $X_c(j\Omega)$:
時域相乘等於頻域摺積(再除以 $2\pi$),所以取樣後訊號的頻譜,就是 $X_c(j\Omega)$ 一堆平移且縮放的複本相加:
時間領域の乗算は周波数領域の畳み込み(さらに $2\pi$ で割る)に対応するので、標本化された信号のスペクトルは $X_c(j\Omega)$ の平行移動・定数倍されたコピーの和になる:
Sampling at rate $\Omega_s$ makes the analog spectrum periodic: copies of $X_c(j\Omega)$ appear centered at every multiple of $\Omega_s$, each scaled by $1/T$. If the copies do not overlap, the original spectrum survives intact in the baseband copy; if they overlap, the overlapped sum can never be untangled — that overlap is aliasing.
以 $\Omega_s$ 的速率取樣,會讓類比頻譜變成週期性的:$X_c(j\Omega)$ 的複本出現在 $\Omega_s$ 的每個整數倍處,而且每份都縮小 $1/T$ 倍。如果複本彼此不重疊,原始頻譜就完整保留在基頻那一份裡;一旦重疊,疊加後的結果再也分不開——這個重疊就是混疊。
レート $\Omega_s$ で標本化すると、アナログスペクトルは周期的になる。$X_c(j\Omega)$ のコピーが $\Omega_s$ の整数倍ごとを中心に現れ、それぞれ $1/T$ 倍される。コピーどうしが重ならなければ、元のスペクトルはベースバンドのコピーの中に無傷で残る。重なってしまえば、重ね合わされた和は二度とほどけない——この重なりが折り返しである。
上面用的是「時域相乘 $\to$ 頻域摺積」。同一個結果也可以完全不碰摺積,改用傅立葉級數 + 調變性質推出來,很多投影片走的是這條路。 (投影片把 $x_c(t)$ 寫成 $g_a(t)$、$s(t)$ 寫成 $p(t)$、$x_s(t)$ 寫成 $g_p(t)$、$\Omega_s$ 寫成 $\Omega_{\text{samp}}$,符號不同而已。)
第 0 步:取樣 = 乘上脈衝串。取樣後的訊號可以寫成原始訊號乘上一串等間隔的脈衝:
$$x_s(t) = x_c(t)\cdot s(t), \qquad s(t) = \sum_{n} \delta(t-nT)$$$s(t)$ 就像一把梳子,每隔 $T$ 秒有一根齒;$x_c(t)$ 乘上它之後,只留下 $t=nT$ 那些點的值。
第 1 步:$s(t)$ 是週期訊號,所以能寫成傅立葉級數。$s(t)$ 每隔 $T$ 重複一次,而任何週期訊號都能展開成基頻與其所有諧波的疊加:
$$s(t) = \sum_{k} c_k\,e^{jk\Omega_s t}, \qquad \Omega_s = \frac{2\pi}{T}$$第 2 步:求係數 $c_k$。
$$c_k = \frac{1}{T}\int_{-T/2}^{T/2} s(t)\,e^{-jk\Omega_s t}\,dt$$在 $-T/2$ 到 $T/2$ 這一個週期內,$s(t)$ 只有一根脈衝,就是 $t=0$ 的 $\delta(t)$。用 $\delta$ 函數的篩選性質 $\int \delta(t)f(t)\,dt = f(0)$:
$$c_k = \frac{1}{T}\,e^{0} = \frac{1}{T}$$每個 $c_k$ 都是 $1/T$,和 $k$ 無關。所以
$$s(t) = \frac{1}{T}\sum_{k=-\infty}^{\infty} e^{jk\Omega_s t}$$意思是:脈衝串裡含有 $0, \pm\Omega_s, \pm 2\Omega_s, \ldots$ 所有諧波,而且每個諧波的強度都一樣。
第 3 步:代回去。
$$x_s(t) = x_c(t)\cdot\frac{1}{T}\sum_{k} e^{jk\Omega_s t} = \frac{1}{T}\sum_{k} e^{jk\Omega_s t}\,x_c(t)$$變成很多項相加,每一項都是 $x_c(t)$ 乘上一個複指數。
第 4 步:乘上複指數 = 頻譜平移。這是傅立葉轉換的調變性質:
$$\mathcal{F}\big\{e^{j\Omega_0 t}x(t)\big\} = X\big(j(\Omega-\Omega_0)\big)$$時域乘上 $e^{j\Omega_0 t}$,頻域就整份往右平移 $\Omega_0$。這裡 $\Omega_0 = k\Omega_s$,所以第 $k$ 項的頻譜就是 $X_c$ 往右移 $k\Omega_s$:
$$\mathcal{F}\big\{e^{jk\Omega_s t}\,x_c(t)\big\} = X_c\big(j(\Omega - k\Omega_s)\big)$$第 5 步:全部加起來。
$$X_s(j\Omega) = \frac{1}{T}\sum_{k} X_c\big(j(\Omega - k\Omega_s)\big)$$和上面摺積法得到的完全相同。
用圖來想。假設原始頻譜是一座以 $0$ 為中心的小山丘(Fig. 6-2 上圖),取樣後就變成一整排間隔 $\Omega_s$ 的山丘,每份都乘上 $1/T$:$k=0$ 是原本那一份,$k=\pm1, \pm2, \ldots$ 是平移出來的複本。
一句話總結:梳子 $s(t)$ 裡含有 $\Omega_s$ 所有整數倍的諧波,每個諧波都把原始頻譜「搬」到一個新位置,所以取樣後得到一整排等間隔的複本。這也是「DTFT 以 $2\pi$ 為週期」的根本原因(§6.2.4):把 $\Omega = \omega/T$ 代進去,$\Omega_s$ 的間隔在 $\omega$ 軸上剛好就是 $2\pi$。
How does the CTFT of $x_s(t)$ relate to the DTFT of the sequence $x[n]$? Take the CTFT of the impulse-train expression term by term:
$x_s(t)$ 的 CTFT 和序列 $x[n]$ 的 DTFT 之間有什麼關係?把脈衝串的表示式逐項取 CTFT:
$x_s(t)$ の CTFT は系列 $x[n]$ の DTFT とどう関係するのか。インパルス列の表現を項ごとに CTFT してみよう:
The two sums are identical when $\omega = \Omega T$. Hence
當 $\omega = \Omega T$ 時,這兩個和式完全相同。因此
$\omega = \Omega T$ のとき、この二つの和は完全に一致する。したがって
The analog frequency $\Omega = \Omega_s$ (one full sampling rate) maps to $\omega = 2\pi$; the half sampling rate $\Omega_s/2$ maps to $\omega = \pi$, the edge of the DT baseband. This is why the DTFT is always $2\pi$-periodic — all replicas land on a $2\pi$ grid.
類比頻率 $\Omega = \Omega_s$(整個取樣率)對應到 $\omega = 2\pi$;取樣率的一半 $\Omega_s/2$ 對應到 $\omega = \pi$,也就是數位基頻帶的邊緣。這正是 DTFT 永遠以 $2\pi$ 為週期的原因——所有複本都落在 $2\pi$ 的格點上。
アナログ周波数 $\Omega = \Omega_s$(標本化レートまるごと)は $\omega = 2\pi$ に対応し、標本化レートの半分 $\Omega_s/2$ は離散時間ベースバンドの端である $\omega = \pi$ に対応する。DTFT が常に $2\pi$ 周期であるのはこのためである——すべての複製が $2\pi$ の格子の上に載るからだ。
| Quantity | Continuous time | Discrete time |
|---|---|---|
| Frequency variable | $\Omega$ (rad/s) | $\omega = \Omega T$ (rad/sample) |
| Transform | CTFT $X_c(j\Omega)$, aperiodic | DTFT $X(e^{j\omega})$, $2\pi$-periodic |
| Sampling rate | $\Omega_s = 2\pi/T$ | $2\pi$ |
| Nyquist frequency (half rate) | $\Omega_s/2 = \pi/T$ | $\pi$ |
| Amplitude scale | $X_c$ | $\tfrac{1}{T}X_c$ in baseband copy |
| 量 | 連續時間 | 離散時間 |
|---|---|---|
| 頻率變數 | $\Omega$(rad/s) | $\omega = \Omega T$(rad/sample) |
| 轉換 | CTFT $X_c(j\Omega)$,非週期 | DTFT $X(e^{j\omega})$,以 $2\pi$ 為週期 |
| 取樣率 | $\Omega_s = 2\pi/T$ | $2\pi$ |
| Nyquist 頻率(取樣率的一半) | $\Omega_s/2 = \pi/T$ | $\pi$ |
| 振幅縮放 | $X_c$ | 基頻複本為 $\tfrac{1}{T}X_c$ |
| 量 | 連続時間 | 離散時間 |
|---|---|---|
| 周波数変数 | $\Omega$(rad/s) | $\omega = \Omega T$(rad/sample) |
| 変換 | CTFT $X_c(j\Omega)$、非周期 | DTFT $X(e^{j\omega})$、$2\pi$ 周期 |
| 標本化レート | $\Omega_s = 2\pi/T$ | $2\pi$ |
| ナイキスト周波数(レートの半分) | $\Omega_s/2 = \pi/T$ | $\pi$ |
| 振幅のスケール | $X_c$ | ベースバンドの複製では $\tfrac{1}{T}X_c$ |
Putting the last row together: the analog radian frequency that equals half the sampling frequency is one single point, and each domain spells it its own way.
把表格最後幾列合起來看:等於取樣頻率一半的那個類比角頻率,其實是同一個點,只是每個領域各有各的寫法。
最後の行をまとめると、標本化周波数の半分に等しいアナログ角周波数はただ一つの点であり、各領域がそれを自分の流儀で書き表しているにすぎない。
It is the right-hand edge of the useful band in either picture: the green dashed lines at $\pm\Omega_s/2$ in Fig. 6-2 mark it on the analog axis, and the same point sits at the end of the $\omega$ axis at $\pi$. Three things make it worth naming:
不論從哪張圖看,它都是可用頻帶的右端點:圖 6-2 中 $\pm\Omega_s/2$ 的綠色虛線在類比軸上標出它,而同一個點在 $\omega$ 軸上就是 $\pi$。它值得單獨命名,有三個理由:
どちらの図で見ても、それは有効帯域の右端である。図 6-2 の $\pm\Omega_s/2$ にある緑の破線がアナログ軸上でそれを示し、同じ点が $\omega$ 軸では端の $\pi$ に位置する。この点に名前を与える価値がある理由は三つある:
In one line: $\Omega = \Omega_s/2$ is the ceiling on the analog frequency axis that this sampling rate can represent faithfully; past it, aliasing.
一句話:$\Omega = \Omega_s/2$ 就是類比頻率軸上,這個取樣率所能忠實表示的上限;超過它,就是混疊。
一言で言えば、$\Omega = \Omega_s/2$ はこの標本化レートが忠実に表現できる、アナログ周波数軸上の上限である。それを超えれば折り返しが起きる。
A natural misreading of the slide that stacks $g_p(t) \leftrightarrow G_p(j\Omega)$ above $g[n] \leftrightarrow G(e^{j\omega})$ is that the second row somehow "puts the amplitude back". It does not. Suppose the original analog spectrum $G_a(j\Omega)$ has peak height $M$. Then:
投影片把 $g_p(t) \leftrightarrow G_p(j\Omega)$ 疊在 $g[n] \leftrightarrow G(e^{j\omega})$ 上面,很容易讓人誤以為第二列「把振幅補回來了」。並沒有。設原本的類比頻譜 $G_a(j\Omega)$ 峰值高度為 $M$,那麼:
$g_p(t) \leftrightarrow G_p(j\Omega)$ を $g[n] \leftrightarrow G(e^{j\omega})$ の上に並べたスライドを見ると、二段目で「振幅が元に戻された」かのように読みたくなるが、そうではない。元のアナログスペクトル $G_a(j\Omega)$ のピーク高さを $M$ としよう。すると:
Both curves peak at $\boxed{M/T}$. The red $G_p(j\Omega)$ and the blue $G(e^{j\omega})$ are the same numbers plotted against a relabelled horizontal axis. The slide marks $M/T$ only on the top row, which is why the bottom row looks as though it were something else — it is not.
兩條曲線的峰值都是 $\boxed{M/T}$。紅色的 $G_p(j\Omega)$ 與藍色的 $G(e^{j\omega})$ 是同一組數值,只是畫在重新標過刻度的橫軸上。投影片只在上面那一列標了 $M/T$,所以下面那一列看起來好像是別的東西——其實不是。
どちらの曲線もピークは $\boxed{M/T}$ である。赤い $G_p(j\Omega)$ と青い $G(e^{j\omega})$ は同じ数値を、ラベルを付け替えた横軸に対して描いたものにすぎない。スライドは $M/T$ を上段にしか書いていないので、下段が別物であるかのように見える——別物ではない。
The reason is that the relation between them is a pure change of variable, with nothing multiplying the function value:
理由是:兩者之間的關係是一個純粹的變數代換,函數值本身並沒有被乘上任何東西:
その理由は、両者の関係が純粋な変数変換であり、関数の値に何かが掛かっているわけではないからである:
From the Fourier series of the impulse train in §6.2.1. Expanding the $T$-periodic $s(t)$ into harmonics,
來自 §6.2.1 中脈衝串的傅立葉級數。把週期為 $T$ 的 $s(t)$ 展開成諧波,
§6.2.1 のインパルス列のフーリエ級数からである。周期 $T$ の $s(t)$ を高調波に展開すると、
every harmonic carries the coefficient $1/T$, so when multiplication by $s(t)$ replicates $G_a$, each copy is scaled by $1/T$. The intuition: the smaller $T$ is, the more impulses per second the train contains, the more total strength it has, and the taller the resulting spectrum. $1/T$ is a measure of sampling density, not a property of the signal.
每一個諧波的係數都是 $1/T$,所以當乘上 $s(t)$ 把 $G_a$ 複製出去時,每一份複本都被乘上了 $1/T$。直觀上可以這樣想:$T$ 越小,脈衝串每秒包含的脈衝就越多、總強度越大,做出來的頻譜也就越高。$1/T$ 量的是取樣密度,而不是訊號本身的性質。
どの高調波も係数 $1/T$ をもつので、$s(t)$ を掛けて $G_a$ が複製されるとき、各複製は $1/T$ 倍される。直観的には、$T$ が小さいほどインパルス列は毎秒より多くのインパルスを含み、全体の強さが大きくなり、結果として得られるスペクトルも高くなる。$1/T$ は標本化密度の尺度であって、信号の性質ではない。
A units check confirms it. $G_a(j\Omega)$ is an integral over time, so it carries units of (signal)$\times$s; $G(e^{j\omega})$ is a plain sum of samples, so it carries units of (signal) alone. Dividing by $T$ is exactly what removes the second.
用單位檢查也能確認。$G_a(j\Omega)$ 是對時間的積分,單位是(訊號單位)$\times$ 秒;$G(e^{j\omega})$ 只是樣本的加總,單位就只有(訊號單位)。除以 $T$ 做的正是把「秒」消掉這件事。
単位を確かめれば裏づけが取れる。$G_a(j\Omega)$ は時間についての積分なので(信号の単位)$\times$秒 の次元をもつ。$G(e^{j\omega})$ は標本の単なる和なので(信号の単位)だけをもつ。$T$ で割るという操作は、まさにその「秒」を消す操作である。
Not in this step, but at reconstruction. The ideal D/C filter of §6.4.1 is specified with passband gain $T$ precisely to cancel the $1/T$:
不在這一步,而是在重建的時候。§6.4.1 的理想 D/C 濾波器之所以把通帶增益訂為 $T$,正是為了抵消這個 $1/T$:
この段階ではなく、再構成においてである。§6.4.1 の理想 D/C フィルタの通過域利得が $T$ と定められているのは、ちょうどこの $1/T$ を打ち消すためである:
The filter keeps only the centre replica and discards the rest, and its gain $T$ lifts that replica from $M/T$ back to $M$ — which is $G_a(j\Omega)$ again.
濾波器只留下中央那一份複本、丟掉其餘的,而它的增益 $T$ 把那份複本從 $M/T$ 抬回 $M$——也就是又回到 $G_a(j\Omega)$。
フィルタは中央の複製だけを残して他を捨て、その利得 $T$ がその複製を $M/T$ から $M$ へ持ち上げる——これは再び $G_a(j\Omega)$ である。
| Stage | Spectrum | Peak height | What changed |
|---|---|---|---|
| Original analog signal | $G_a(j\Omega)$ | $M$ | — |
| Multiplied by the impulse train | $G_p(j\Omega)$ | $M/T$ | replicated and scaled by $1/T$ |
| Read as a discrete sequence | $G(e^{j\omega})$ | $M/T$ | horizontal axis only ($\omega = \Omega T$) |
| Through the reconstruction LPF (gain $T$) | $G_a(j\Omega)$ | $M$ | one replica kept, height restored |
| 階段 | 頻譜 | 峰值高度 | 改變了什麼 |
|---|---|---|---|
| 原始類比訊號 | $G_a(j\Omega)$ | $M$ | — |
| 乘上脈衝串 | $G_p(j\Omega)$ | $M/T$ | 被複製,並乘上 $1/T$ |
| 當成離散序列來讀 | $G(e^{j\omega})$ | $M/T$ | 只有橫軸($\omega = \Omega T$) |
| 通過重建低通(增益 $T$) | $G_a(j\Omega)$ | $M$ | 只留一份複本,高度復原 |
| 段階 | スペクトル | ピーク高さ | 何が変わったか |
|---|---|---|---|
| 元のアナログ信号 | $G_a(j\Omega)$ | $M$ | — |
| インパルス列を掛けた後 | $G_p(j\Omega)$ | $M/T$ | 複製され、$1/T$ 倍された |
| 離散系列として読んだもの | $G(e^{j\omega})$ | $M/T$ | 横軸だけ($\omega = \Omega T$) |
| 再構成 LPF(利得 $T$)を通した後 | $G_a(j\Omega)$ | $M$ | 複製を一つ残し、高さが復元された |
This is the same factor that appears in the high-rate limit $T\,G(e^{j\Omega T}) \to G_a(j\Omega)$: sampling faster does not make the DTFT converge to the analog spectrum on its own — you must multiply by $T$. So whenever you use a DTFT or an FFT to estimate the spectrum of a physical signal, scale by $T$ (equivalently, divide by $f_s$) before reading magnitudes off the plot. Omit it and every value is wrong by a factor of $f_s$ — at $f_s = 48$ kHz that is a silent error of about 94 dB, and it changes with the sampling rate, so the same signal measured at two rates appears to have two different spectra.
這和高取樣率極限 $T\,G(e^{j\Omega T}) \to G_a(j\Omega)$ 裡出現的是同一個因子:取樣取得更快,並不會讓 DTFT 自己收斂到類比頻譜——你必須乘上 $T$。所以只要你用 DTFT 或 FFT 去估計一個實體訊號的頻譜,在從圖上讀數值之前就要乘上 $T$(等價於除以 $f_s$)。忘了這件事,每一個數值都會差 $f_s$ 倍——在 $f_s = 48$ kHz 時就是約 94 dB 的無聲錯誤,而且它會隨取樣率改變,於是同一個訊號用兩種取樣率量出來會像是兩個不同的頻譜。
これは高レート極限 $T\,G(e^{j\Omega T}) \to G_a(j\Omega)$ に現れるのと同じ因子である。標本化を速くするだけでは DTFT がひとりでにアナログスペクトルへ収束するわけではなく、$T$ を掛けなければならない。したがって DTFT や FFT を使って物理信号のスペクトルを推定するときは、図から振幅を読み取る前に $T$ を掛ける(同じことだが $f_s$ で割る)こと。これを怠ると、すべての値が $f_s$ 倍だけ誤る——$f_s = 48$ kHz なら約 94 dB もの静かな誤りであり、しかも標本化レートによって変わるので、同じ信号を二つのレートで測ると二つの異なるスペクトルに見えてしまう。
The unit rad/sample is the whole point: $\omega$ measures the signal's frequency relative to the sampling rate, not in absolute terms. So $\omega = \pi$ says exactly one thing — the signal frequency is half the sampling frequency.
rad/sample 這個單位正是重點:$\omega$ 量的是訊號頻率相對於取樣率的比例,而不是絕對的頻率。所以 $\omega = \pi$ 只說了一件事——訊號頻率剛好是取樣頻率的一半。
rad/sample という単位こそが要点である:$\omega$ は信号の周波数を標本化レートに対する比として測るのであって、絶対的な値として測るのではない。したがって $\omega = \pi$ が言っていることはただ一つ——信号周波数は標本化周波数の半分であるということだ。
Read it as cycles per sample. One full cycle is $2\pi$ radians, so
把它讀成「每個樣本走幾個週期」。一個完整週期是 $2\pi$ 弧度,所以
1 標本あたり何周期進むか、と読むこと。1 周期は $2\pi$ ラジアンなので、
Putting $\omega = \pi$ gives $\tfrac{\pi}{2\pi} = 0.5$ cycle/sample: each sample advances the waveform by half a cycle, so a full cycle takes two samples. Turned around — the signal is sampled only twice per period, which is the bare minimum the sampling theorem allows.
代入 $\omega = \pi$ 得到 $\tfrac{\pi}{2\pi} = 0.5$ cycle/sample:每個樣本讓波形前進半個週期,所以走完一個週期需要兩個樣本。反過來說,訊號每個週期只被取樣兩次,正是取樣定理允許的最低下限。
$\omega = \pi$ を代入すると $\tfrac{\pi}{2\pi} = 0.5$ cycle/sample となる。1 標本ごとに波形は半周期進むので、1 周期を終えるのに 2 標本かかる。裏返せば、信号は1 周期あたり 2 回しか標本化されておらず、これは標本化定理が許す最低限である。
On its own it names no physical frequency. $\omega$ is a ratio; to recover hertz you must know $f_s$:
它本身並不代表任何實際的物理頻率。$\omega$ 是一個比值;要換回 Hz,必須知道 $f_s$:
それ自体は物理的な周波数を何も指定しない。$\omega$ は比であり、ヘルツに戻すには $f_s$ を知らなければならない:
| Application | Sampling rate $f_s$ | Frequency at $\omega = \pi$ |
|---|---|---|
| Telephone speech | 8 kHz | 4 kHz |
| CD audio | 44.1 kHz | 22.05 kHz |
| Temperature sensor, one reading per second | 1 Hz | 0.5 Hz |
| High-speed ADC | 1 GHz | 500 MHz |
| 應用 | 取樣率 $f_s$ | $\omega = \pi$ 對應的頻率 |
|---|---|---|
| 電話語音 | 8 kHz | 4 kHz |
| CD 音訊 | 44.1 kHz | 22.05 kHz |
| 溫度感測器,每秒量一次 | 1 Hz | 0.5 Hz |
| 高速 ADC | 1 GHz | 500 MHz |
| 応用 | 標本化レート $f_s$ | $\omega = \pi$ に対応する周波数 |
|---|---|---|
| 電話音声 | 8 kHz | 4 kHz |
| CD オーディオ | 44.1 kHz | 22.05 kHz |
| 温度センサ、毎秒 1 回の読み取り | 1 Hz | 0.5 Hz |
| 高速 ADC | 1 GHz | 500 MHz |
The same $\omega = \pi$ means 4 kHz in one row and 500 MHz in another. This is the point of Fig. 6-1: once you hold only $x[n]$, the samples carry no time units at all, so $\omega$ cannot carry hertz either.
同樣是 $\omega = \pi$,在某一列代表 4 kHz,在另一列卻是 500 MHz。這正是圖 6-1 的重點:一旦手上只剩 $x[n]$,樣本就完全不帶時間單位,$\omega$ 自然也不可能帶著 Hz。
同じ $\omega = \pi$ が、ある行では 4 kHz を、別の行では 500 MHz を意味する。これが図 6-1 の要点である。いったん $x[n]$ だけを手にしてしまえば、標本は時間の単位をまったく担わないので、$\omega$ もヘルツを担いようがない。
$\omega = \pi$ means half a turn per sample: the sequence is $1, -1, 1, -1,\ldots$, one full cycle every two samples. That is the fastest a sequence can alternate, so it is the highest frequency a discrete-time signal can represent — and therefore the Nyquist frequency always sits at $\omega = \pi$ in normalized frequency, whatever $T$ happens to be.
$\omega = \pi$ 表示每個樣本轉半圈,序列是 $1, -1, 1, -1,\ldots$,每 2 個樣本一個週期。這是離散序列能表示的最高頻率,所以不論 $T$ 是多少,Nyquist 頻率在數位頻率上永遠是 $\pi$。
$\omega = \pi$ は 1 標本あたり半回転を意味する。系列は $1, -1, 1, -1,\ldots$ であり、2 標本ごとに 1 周期となる。これは系列が交番しうる最速であり、したがって離散時間信号が表現できる最高の周波数である——ゆえに $T$ がいくつであろうと、ナイキスト周波数は正規化周波数では常に $\omega = \pi$ に位置する。
The analog Nyquist frequency $\pi/T$ moves whenever $T$ moves; its normalized image does not, because $\omega = \Omega T$ absorbs exactly that factor.
類比的 Nyquist 頻率 $\pi/T$ 會隨著 $T$ 而變;它在正規化頻率上的影像卻不會,因為 $\omega = \Omega T$ 剛好把那個因子吸收掉了。
アナログのナイキスト周波数 $\pi/T$ は $T$ が動けば動くが、その正規化された像は動かない。$\omega = \Omega T$ がちょうどその因子を吸収するからである。
想像用攝影機拍一個旋轉的風扇,每拍一張照片就是一個樣本,而 $\omega$ 就是「兩張照片之間風扇轉了多少角度」。
所以 $\pi$ rad/sample 的物理意義,就是取樣所能忠實表示的最快變化。超過它,資訊不會消失,而是被誤解成另一個較低的頻率。
The replication formula makes the DTFT $2\pi$-periodic, but the root cause is simpler and sits entirely in the exponent: $n$ must be an integer, while $t$ may be any real number.
複製公式讓 DTFT 以 $2\pi$ 為週期,但根本原因更簡單,而且完全藏在指數裡:離散時間的 $n$ 只能是整數,連續時間的 $t$ 卻可以是任意實數。
複製の公式は DTFT を $2\pi$ 周期にするが、根本の原因はもっと単純で、すべて指数の中にある:$n$ は整数でなければならないが、$t$ は任意の実数でよい。
Discrete time — $\omega$ and $\omega+2\pi$ cannot be told apart. Because $n$ is an integer, $e^{j2\pi n}$ is always exactly 1:
離散時間——$\omega$ 和 $\omega+2\pi$ 無法區分。因為 $n$ 是整數,$e^{j2\pi n}$ 永遠恰好等於 1:
離散時間——$\omega$ と $\omega+2\pi$ は区別できない。$n$ が整数なので、$e^{j2\pi n}$ は常にちょうど 1 である:
$$e^{j(\omega+2\pi)n} = e^{j\omega n}\cdot e^{j2\pi n} = e^{j\omega n}$$The two frequencies generate the identical sequence, so the transform repeats, $G(e^{j(\omega+2\pi)}) = G(e^{j\omega})$, and a single period — conventionally $-\pi$ to $\pi$ — already contains everything there is to know.
兩個頻率產生的是完全相同的序列,所以轉換會重複:$G(e^{j(\omega+2\pi)}) = G(e^{j\omega})$。既然如此,只要看一個週期——習慣上取 $-\pi$ 到 $\pi$——就已經包含了全部的資訊。
二つの周波数はまったく同じ系列を生むので、変換は繰り返し $G(e^{j(\omega+2\pi)}) = G(e^{j\omega})$ となり、1 周期——慣例として $-\pi$ から $\pi$ まで——だけで知るべきことはすべて含まれている。
Continuous time — every $\Omega$ is distinct. Here $t$ ranges over the reals, so $e^{j2\pi t}$ is not identically 1 (at $t=0.25$ it equals $j$):
連續時間——每個 $\Omega$ 都不一樣。這裡 $t$ 取遍所有實數,所以 $e^{j2\pi t}$ 不會恆等於 1(例如 $t=0.25$ 時它等於 $j$):
連続時間——どの $\Omega$ も互いに異なる。ここでは $t$ が実数全体を動くので、$e^{j2\pi t}$ は恒等的に 1 ではない($t=0.25$ では $j$ になる):
$$e^{j(\Omega+2\pi)t} = e^{j\Omega t}\cdot e^{j2\pi t} \neq e^{j\Omega t}$$Different $\Omega$ always means a different signal, and the frequency axis runs from $-\infty$ to $\infty$ without ever repeating.
不同的 $\Omega$ 永遠對應不同的訊號,頻率軸從 $-\infty$ 一路延伸到 $\infty$,從不重複。
$\Omega$ が異なれば常に信号も異なり、周波数軸は $-\infty$ から $\infty$ まで一度も繰り返すことなく伸びていく。
The intuition. A continuous signal has a value at every instant, so however fast it oscillates, the oscillation is fully described. A sequence only has values at integer points — whatever happens between samples is invisible. In the rotating picture of §6.2.3, $e^{j\omega n}$ turns $\omega$ radians per sample: turning $\pi/4$ and turning $\pi/4 + 2\pi$ (one extra full revolution) land on exactly the same positions at every sampling instant. Discrete time can therefore only distinguish rotation speeds within a $2\pi$ range — which is aliasing, seen from the unit circle.
直觀的理解。連續訊號在任何時刻都有值,所以不論振盪多快,都被完整描述了。序列卻只在整數點上有值——樣本之間發生什麼事完全看不到。用 §6.2.3 的旋轉畫面來說:$e^{j\omega n}$ 每個樣本在單位圓上轉 $\omega$ 弧度,轉 $\pi/4$ 和轉 $\pi/4 + 2\pi$(多繞整整一圈),在每個取樣時刻看到的位置一模一樣。所以離散時間只能分辨 $2\pi$ 範圍內的轉速——從單位圓看過去,這就是混疊。
直観。連続信号はあらゆる瞬間に値をもつので、どれほど速く振動しても、その振動は完全に記述される。系列は整数点にしか値をもたない——標本と標本の間で何が起きても見えない。§6.2.3 の回転の絵で言えば、$e^{j\omega n}$ は 1 標本あたり $\omega$ ラジアン回る。$\pi/4$ 回るのと $\pi/4 + 2\pi$ 回る(まるまる 1 回転多い)のとでは、どの標本化時刻でもまったく同じ位置に来る。したがって離散時間は $2\pi$ の範囲内の回転速度しか区別できない——単位円から見た折り返しとは、このことである。
Seen from the sampling side. The result of §6.2.2 says the same thing in the frequency domain: sampling copies the analog spectrum at every multiple of $2\pi$ on the $\omega$ axis. The continuous signal's own spectrum $X_c(j\Omega)$ carries no such restriction — it is the act of sampling that makes the spectrum periodic.
從取樣的角度看。§6.2.2 的結果在頻域說的是同一件事:取樣會把類比頻譜沿著 $\omega$ 軸每隔 $2\pi$ 複製一份。連續訊號本身的頻譜 $X_c(j\Omega)$ 並沒有這種限制——是取樣這個動作讓頻譜變成週期性的。
標本化の側から見る。§6.2.2 の結果は周波数領域で同じことを述べている。標本化はアナログスペクトルを $\omega$ 軸上の $2\pi$ の整数倍ごとに複製する。連続信号自身のスペクトル $X_c(j\Omega)$ にはそのような制約はない——スペクトルを周期的にするのは標本化という行為なのである。
This is one instance of a pattern that runs through every Fourier representation: discreteness in one domain forces periodicity in the other. The DTFT is discrete in time, hence periodic in frequency with period $2\pi$, so $-\pi$ to $\pi$ suffices. The converse is just as useful and is where Ch. 8 begins: sampling the frequency axis makes the time sequence periodic, which is precisely the DFT. Ch. 8 tabulates all four members of the family (FS, FT, DTFT, DFT).
這只是貫穿所有傅立葉表示法的一個規律的特例:一個領域離散,另一個領域就週期。DTFT 在時間上離散,所以在頻率上以 $2\pi$ 為週期,看 $-\pi$ 到 $\pi$ 就夠了。反過來的敘述同樣有用,也正是第 8 章的起點:對頻率軸取樣,時間序列就變成週期性的——那就是 DFT。第 8 章列出了這個家族的全部四個成員(FS、FT、DTFT、DFT)。
これはあらゆるフーリエ表現を貫く法則の一例である:一方の領域の離散性が、他方の周期性を強いる。DTFT は時間について離散なので、周波数については周期 $2\pi$ の周期関数となり、$-\pi$ から $\pi$ までで足りる。その逆もまた有用であり、第 8 章はそこから始まる。周波数軸を標本化すると時間系列が周期的になる——それがまさに DFT である。第 8 章ではこの一族の 4 つのメンバー(FS、FT、DTFT、DFT)をすべて表にまとめている。
From Fig. 6-2: if $x_c(t)$ is bandlimited, i.e. $X_c(j\Omega) = 0$ for $|\Omega| \ge \Omega_N$, the replicas remain disjoint provided $\Omega_s - \Omega_N \ge \Omega_N$. This is the Nyquist–Shannon sampling theorem:
回到圖 6-2:如果 $x_c(t)$ 是帶限(bandlimited)的,也就是 $|\Omega| \ge \Omega_N$ 時 $X_c(j\Omega) = 0$,那麼只要 $\Omega_s - \Omega_N \ge \Omega_N$,複本就不會重疊。這就是 Nyquist–Shannon 取樣定理:
図 6-2 から:$x_c(t)$ が帯域制限されている、すなわち $|\Omega| \ge \Omega_N$ で $X_c(j\Omega) = 0$ であるなら、$\Omega_s - \Omega_N \ge \Omega_N$ が成り立つかぎり複製は互いに重ならない。これがナイキスト–シャノンの標本化定理である:
Where the condition comes from — count the edges. $\Omega_N$ is the signal's highest frequency (lecture slides often write $\Omega_M$, M for maximum), so "bandlimited at $\Omega_N$" means the spectrum has no energy at all outside that band:
這個條件是怎麼來的——數一數邊界。$\Omega_N$ 是訊號的最高頻率(下標 N 代表最高頻率;投影片常寫成 $\Omega_M$,M 取自 maximum)。所以「帶限於 $\Omega_N$」的意思是:超出這個頻帶,頻譜完全沒有能量:
この条件の出どころ——端を数える。$\Omega_N$ は信号の最高周波数である(講義スライドではしばしば $\Omega_M$ と書かれる。M は maximum の M)。したがって「$\Omega_N$ で帯域制限されている」とは、その帯域の外ではスペクトルがまったくエネルギーをもたないという意味である:
$$X_c(j\Omega) = 0, \qquad |\Omega| > \Omega_N$$Each replica is therefore $2\Omega_N$ wide, and they sit $\Omega_s$ apart (the slides write $\Omega_T$ for this chapter's $\Omega_s$). Reading the two edges that face each other:
因此每個複本的寬度是 $2\Omega_N$,彼此相隔 $\Omega_s$(投影片寫成 $\Omega_T$,就是本章的 $\Omega_s$)。把面對面的那兩個邊界讀出來:
ゆえに各複製の幅は $2\Omega_N$ であり、互いに $\Omega_s$ だけ離れている(スライドでは本章の $\Omega_s$ を $\Omega_T$ と書く)。向かい合う二つの端を読み取ると:
That gap between the hills in Fig. 6-2 (middle panel) is the sampling theorem holding. On the $\omega$ axis the same statement reads $\omega_N = \Omega_N T < \pi$: the signal's highest digital frequency must stay below $\pi$, which is §6.2.2's Nyquist point seen from the signal's side.
圖 6-2 中間那張圖裡,山丘之間的那道空隙就是取樣定理成立的樣子。換到 $\omega$ 軸上,同一句話寫成 $\omega_N = \Omega_N T < \pi$:訊號的最高數位頻率必須低於 $\pi$——這正是 §6.2.2 的 Nyquist 點,只是改從訊號這一側來看(與前面 $\omega=\pi$ 的結論一致)。
図 6-2(中段)の山と山の間にあるあの隙間がまさに標本化定理の成立している姿である。$\omega$ 軸では同じ主張が $\omega_N = \Omega_N T < \pi$ と書ける。信号の最高ディジタル周波数は $\pi$ より下になければならない——これは §6.2.2 のナイキスト点を信号の側から見たものである。
Lecture slides typically label the spectrum's height $M$ as well as writing the band edge $\Omega_M$. They are unrelated: the subscript marks the maximum frequency, while the height is an amplitude, which sampling scales to $M/T$ — the $1/T$ factor of the replication formula.
投影片常常同時把頻譜的高度標成 $M$,又把頻帶邊界寫成 $\Omega_M$。這兩個 M 毫無關係:下標標的是最高頻率,而高度是振幅——取樣會把它縮成 $M/T$,也就是複製公式裡的那個 $1/T$ 因子。
講義スライドはたいてい、帯域端を $\Omega_M$ と書くのと同時に、スペクトルの高さにも $M$ というラベルを付ける。この二つは無関係である。添字が示すのは最高周波数であり、高さのほうは振幅であって、標本化はそれを $M/T$ に縮める——複製の公式に現れる $1/T$ の因子である。
A sinusoid exactly at the Nyquist frequency ($\Omega_0 = \Omega_s/2$) is a boundary case: $\sin(\Omega_s t/2)$ sampled at $t=nT$ gives $\sin(\pi n) = 0$ for all $n$ — the samples vanish entirely. For sinusoidal content you need $\Omega_s > 2\Omega_0$ strictly.
剛好落在 Nyquist 頻率上的正弦訊號($\Omega_0 = \Omega_s/2$)是個邊界情況:$\sin(\Omega_s t/2)$ 在 $t=nT$ 取樣後得到 $\sin(\pi n) = 0$,對所有 $n$ 都成立——樣本全部消失。所以對正弦成分而言,必須嚴格滿足 $\Omega_s > 2\Omega_0$。
ちょうどナイキスト周波数上にある正弦波($\Omega_0 = \Omega_s/2$)は境界のケースである。$\sin(\Omega_s t/2)$ を $t=nT$ で標本化すると、すべての $n$ について $\sin(\pi n) = 0$ となり、標本はすっかり消えてしまう。正弦波成分については $\Omega_s > 2\Omega_0$ が狭義に成り立つ必要がある。
If $\Omega_s < 2\Omega_N$, the shifted copies in the replication formula overlap. High frequencies fold down and masquerade as low frequencies — they take on an alias. Once the copies are summed, the overlap cannot be filtered out and $x_c(t)$ can no longer be recovered.
如果 $\Omega_s < 2\Omega_N$,複製公式裡平移出來的複本就會重疊。高頻成分會折返下來,偽裝成低頻——也就是取了一個化名(alias)。一旦複本相加,重疊的部分再也濾不掉,$x_c(t)$ 也就無法還原了。
$\Omega_s < 2\Omega_N$ であれば、複製の公式に現れる平行移動されたコピーどうしが重なる。高い周波数は折り返して下りてきて、低い周波数になりすます——別名(alias)をまとうのである。いったんコピーが足し合わされてしまえば、重なりを濾波で取り除くことはできず、$x_c(t)$ はもはや復元できない。
For a sinusoid the alias is easy to compute: frequencies $\Omega_0$ and $\Omega_0 + k\Omega_s$ produce exactly the same samples:
對正弦訊號來說,別名很容易算:頻率 $\Omega_0$ 和 $\Omega_0 + k\Omega_s$ 產生的樣本完全相同:
正弦波については別名の計算は簡単である。周波数 $\Omega_0$ と $\Omega_0 + k\Omega_s$ はまったく同じ標本を生む:
Real signals (audio, sensor noise, RF interference) are never perfectly bandlimited. Before the C/D converter we therefore insert a CT lowpass filter — the anti-aliasing filter $H_{aa}(j\Omega)$ — that forcibly bandlimits the input to below the Nyquist frequency:
真實的訊號(語音、感測器雜訊、射頻干擾)從來不會是完美帶限的。所以在 C/D 轉換器之前,我們會插入一個類比低通濾波器——抗混疊濾波器 $H_{aa}(j\Omega)$——強制把輸入的頻寬壓到 Nyquist 頻率以下:
実際の信号(音声、センサ雑音、RF 干渉)は決して完全に帯域制限されてはいない。そこで C/D 変換器の手前に、入力を強制的にナイキスト周波数より下へ帯域制限する連続時間低域通過フィルタ——アンチエイリアシングフィルタ $H_{aa}(j\Omega)$——を挿入する:
The anti-aliasing filter deliberately destroys the out-of-band content. That is the right trade: mild, known lowpass distortion of frequencies you do not care about is far better than aliasing distortion, which corrupts the in-band signal irreversibly. Practical filters are not brick-wall, so designers either leave a guard band or oversample then decimate digitally.
抗混疊濾波器是刻意毀掉帶外的成分。這個取捨是划算的:對你根本不在乎的頻率造成一點已知的低通失真,遠比混疊失真好——後者會不可逆地污染帶內訊號。實際的濾波器不可能是直角截止,所以設計上不是留一段保護頻帶,就是先過取樣、再用數位方式降取樣。
アンチエイリアシングフィルタは帯域外の成分を意図的に破壊する。これは正しい取引である。気にも留めない周波数に軽度で既知の低域通過歪みが乗るほうが、帯域内の信号を不可逆に汚す折り返し歪みよりはるかにましだからだ。現実のフィルタは矩形特性ではないので、設計者はガードバンドを設けるか、オーバーサンプリングしてからディジタルで間引く。
A signal need not sit around $\Omega = 0$. If its spectrum occupies a band $\Omega_L \le |\Omega| \le \Omega_H$ with bandwidth $\Delta\Omega = \Omega_H - \Omega_L$, sampling replicates the band at multiples of $\Omega_s$; as long as no replicas overlap, the signal can still be recovered, even with $\Omega_s$ far below $2\Omega_H$.
訊號不一定要落在 $\Omega = 0$ 附近。若它的頻譜占據 $\Omega_L \le |\Omega| \le \Omega_H$ 這一段、頻寬為 $\Delta\Omega = \Omega_H - \Omega_L$,取樣同樣會把這段頻帶複製到 $\Omega_s$ 的整數倍處;只要複本不重疊,訊號依然可以還原,即使 $\Omega_s$ 遠低於 $2\Omega_H$。
信号は $\Omega = 0$ の周りになければならないわけではない。そのスペクトルが帯域 $\Omega_L \le |\Omega| \le \Omega_H$(帯域幅 $\Delta\Omega = \Omega_H - \Omega_L$)を占めるとき、標本化はこの帯域を $\Omega_s$ の整数倍ごとに複製する。複製が重ならないかぎり、$\Omega_s$ が $2\Omega_H$ をはるかに下回っていても信号は復元できる。
The sampling rate is set by the bandwidth, not the highest frequency — the principle behind undersampling receivers in communications. Achieving the limit requires the band edges to align favorably with $\Omega_s$, so practical designs use somewhat higher rates.
取樣率是由頻寬決定的,不是由最高頻率決定——這正是通訊中欠取樣接收機(軟體無線電下變頻取樣)的原理。不過要真的逼近這個極限,頻帶邊界必須和 $\Omega_s$ 對得恰到好處,所以實務上會用稍高一點的取樣率。
標本化レートを決めるのは最高周波数ではなく帯域幅である——通信におけるアンダーサンプリング受信機の原理がこれである。ただしこの限界を実際に達成するには帯域端が $\Omega_s$ とうまく整合している必要があるので、実務上の設計ではやや高めのレートを使う。
Read in the light of §6.2.3, the Nyquist frequency is the border between the analog and the digital world — one boundary with three spellings, one per domain:
對照 §6.2.3 來看,Nyquist 頻率就是類比世界與數位世界之間的邊界——同一個邊界,在三個領域各有一種寫法:
§6.2.3 に照らして読めば、ナイキスト周波数はアナログの世界とディジタルの世界の境界である——一つの境界に、領域ごとに一つずつ、三通りの書き方がある:
Two names are easy to confuse, and they are bounds in opposite directions — both were defined in §6.3.1:
有兩個名詞很容易混淆,而且它們是方向相反的兩種界線(一個是上限,一個是下限);兩者都在 §6.3.1 定義過:
紛らわしい名前が二つあり、しかもそれらは互いに逆向きの限界である。どちらも §6.3.1 で定義した:
| Term | Definition | Set by | It bounds |
|---|---|---|---|
| Nyquist frequency | $f_s/2$ | the sampling rate | the highest frequency the system can represent |
| Nyquist rate | $2f_{\max}$ | the signal bandwidth | the lowest sampling rate you may use |
| 名詞 | 定義 | 由誰決定 | 它是什麼界線 |
|---|---|---|---|
| 奈奎斯特頻率(Nyquist frequency) | $f_s/2$ | 由取樣率決定 | 系統能表示的最高頻率(上限) |
| 奈奎斯特速率(Nyquist rate) | $2f_{\max}$ | 由訊號頻寬決定 | 取樣率至少要多高(下限) |
| 用語 | 定義 | 何で決まるか | 何の限界か |
|---|---|---|---|
| ナイキスト周波数 | $f_s/2$ | 標本化レート | システムが表現できる最高周波数 |
| ナイキストレート | $2f_{\max}$ | 信号の帯域幅 | 使ってよい標本化レートの下限 |
The no-aliasing condition is one statement seen from either side: sampling rate > Nyquist rate, equivalently highest signal frequency < Nyquist frequency.
不混疊的條件其實是同一句話的兩種看法:取樣率 > 奈奎斯特速率,等價於訊號最高頻率 < 奈奎斯特頻率。
折り返しが起きない条件は、どちらの側から見ても同じ一つの主張である。標本化レート > ナイキストレート、同じことだが、信号の最高周波数 < ナイキスト周波数。
1. Choosing $f_s$. Find the signal's highest frequency first, then pick $f_s$. In theory $f_s > 2f_{\max}$ suffices; in practice you leave margin, because no anti-aliasing filter has a brick-wall edge — it needs a transition band. CD audio is the standard illustration: hearing stops near 20 kHz, so 40 kHz would do in theory, yet the rate is 44.1 kHz — the extra 2.05 kHz is the filter's transition band. For a vibration sensor with content to 1 kHz, 2.5–5 kHz is typical.
1. 選擇 $f_s$。先知道訊號的最高頻率,再決定 $f_s$。理論上 $f_s > 2f_{\max}$ 就夠了;實務上會留餘裕,因為抗混疊濾波器不可能是直角截止,它需要一段過渡帶。CD 音訊是最典型的例子:人耳上限約 20 kHz,理論上 40 kHz 就夠,實際卻選 44.1 kHz——多出來的 2.05 kHz 就是留給濾波器的過渡帶。若是內容到 1 kHz 的振動感測器,通常會取 2.5–5 kHz。
1. $f_s$ を選ぶ。まず信号の最高周波数を把握し、それから $f_s$ を決める。理論上は $f_s > 2f_{\max}$ で足りるが、実務では余裕をとる。矩形の遮断特性をもつアンチエイリアシングフィルタなど存在せず、遷移帯域が必要だからである。CD オーディオが定番の例である。聴覚は 20 kHz 付近で止まるので理論上は 40 kHz で足りるはずだが、実際のレートは 44.1 kHz である——余分な 2.05 kHz がまさにフィルタの遷移帯域なのだ。1 kHz まで成分をもつ振動センサなら 2.5–5 kHz が典型である。
2. Designing the anti-aliasing filter. Its cutoff goes below the Nyquist frequency, and at $f_s/2$ its attenuation must already be negligible — commonly below the ADC's quantization noise floor (§6.6.2). Raising $f_s$ pushes the Nyquist frequency away from the signal band and makes the analog filter dramatically easier to build. That is the main argument for oversampling, and sigma-delta converters take the idea to its limit.
2. 設計抗混疊濾波器。它的截止頻率要設在 Nyquist 頻率以下,而且到了 $f_s/2$ 處衰減必須已經夠低——通常要求低於 ADC 的量化雜訊底(§6.6.2)。把 $f_s$ 拉高,Nyquist 頻率就離訊號頻帶更遠,類比濾波器也就好做得多。這正是過取樣(oversampling)最主要的理由,而 $\Sigma\Delta$ ADC 把這個想法推到了極致。
2. アンチエイリアシングフィルタを設計する。その遮断周波数はナイキスト周波数より下に置き、$f_s/2$ においては減衰が既に十分であること——ふつうは ADC の量子化雑音フロア(§6.6.2)より下に落ちていることが求められる。$f_s$ を上げればナイキスト周波数は信号帯域から遠ざかり、アナログフィルタは劇的に作りやすくなる。これがオーバーサンプリングを支持する主な論拠であり、シグマデルタ変換器はこの発想を極限まで推し進めたものである。
3. Writing digital filter specifications. A digital filter is designed on the $\omega$ axis, so every specification must first be expressed relative to the Nyquist frequency. With $f_s = 8$ kHz and a 1 kHz lowpass corner:
3. 寫數位濾波器的規格。數位濾波器是在 $\omega$ 軸上設計的,所以每一項規格都要先換算成相對於 Nyquist 頻率的比例。以 $f_s = 8$ kHz、低通轉角 1 kHz 為例:
3. ディジタルフィルタの仕様を書く。ディジタルフィルタは $\omega$ 軸の上で設計されるので、どの仕様もまずナイキスト周波数に対する比で表さなければならない。$f_s = 8$ kHz、低域通過の折れ点 1 kHz の場合:
$$\omega_c = 2\pi\cdot\frac{1000}{8000} = \frac{\pi}{4}$$Design functions such as butter take a normalized frequency in which 1 means the Nyquist frequency, not the sampling frequency. The example above is entered as $1000/4000 = 0.25$, not $1000/8000$. Dividing by $f_s$ instead of $f_s/2$ is a classic way to end up with a filter one octave off. SciPy's butter accepts an explicit fs= argument — pass it and give the corner in Hz to sidestep the question entirely.
像 butter 這類設計函數吃的是正規化頻率,其中 1 代表 Nyquist 頻率,而不是取樣頻率。上面的例子要輸入 $1000/4000 = 0.25$,不是 $1000/8000$。誤把 $f_s$ 當分母(而不是 $f_s/2$),是讓截止頻率差上一倍的經典錯誤。SciPy 的 butter 可以直接給 fs= 參數——傳入它、轉角直接用 Hz 寫,就完全不必煩惱這件事。
butter のような設計関数が受け取る正規化周波数では、1 がナイキスト周波数を表すのであって、標本化周波数ではない。上の例は $1000/4000 = 0.25$ と入力する。$1000/8000$ ではない。$f_s/2$ ではなく $f_s$ で割ってしまうのは、フィルタが 1 オクターブずれる典型的な原因である。SciPy の butter は明示的な fs= 引数を受け付ける——これを渡して折れ点を Hz で与えれば、この問題そのものを回避できる。
4. Reading a spectrum. In a DTFT or FFT plot only $0$ to $\pi$ (that is, $0$ to $f_s/2$) carries information; for a real signal the half from $\pi$ to $2\pi$ is just the mirror image of the first. This is why FFT plots normally stop at the Nyquist frequency. A component that should not be there is a standard symptom of something above $f_s/2$ folding back, and you can predict where it lands:
4. 解讀頻譜圖。在 DTFT 或 FFT 圖上,只有 $0$ 到 $\pi$(也就是 $0$ 到 $f_s/2$)帶有資訊;對實數訊號而言,$\pi$ 到 $2\pi$ 那一半只是前半段的鏡像。這就是為什麼 FFT 圖通常畫到 Nyquist 頻率就停。如果看到一個不該存在的成分,那是高於 $f_s/2$ 的東西折回來的典型症狀,而且你可以算出它會落在哪裡:
4. スペクトルを読む。DTFT や FFT の図では $0$ から $\pi$ まで(すなわち $0$ から $f_s/2$ まで)だけが情報を担う。実信号では $\pi$ から $2\pi$ までの半分は前半の鏡像にすぎない。FFT の図がふつうナイキスト周波数で止まっているのはこのためである。あるはずのない成分が見えたら、$f_s/2$ より上の何かが折り返してきた典型的な兆候であり、それがどこに現れるかは予測できる:
With $f_s = 10$ kHz, a 13 kHz interferer shows up at $|13-10| = 3$ kHz — indistinguishable, in the plot alone, from a genuine 3 kHz tone.
當 $f_s = 10$ kHz 時,一個 13 kHz 的干擾會出現在 $|13-10| = 3$ kHz——單看圖,它和真正的 3 kHz 訊號完全分不出來。
$f_s = 10$ kHz のとき、13 kHz の妨害波は $|13-10| = 3$ kHz に現れる——図だけを見ていては、本物の 3 kHz の正弦波と区別がつかない。
5. Decimation. Dropping the sampling rate by a factor $M$ divides the Nyquist frequency by $M$ as well. So before discarding samples you must first remove everything above $\omega = \pi/M$ with a digital lowpass — the same anti-aliasing argument, now inside the discrete-time domain, where skipping the filter aliases just as irreversibly. Ch. 7 develops rate conversion in full.
5. 降取樣(decimation)。把取樣率降低 $M$ 倍,Nyquist 頻率也跟著除以 $M$。所以在丟掉樣本之前,必須先用數位低通濾波器把 $\omega = \pi/M$ 以上的成分濾掉——這是同一套抗混疊的道理,只是搬進了離散時間領域;少了這道濾波,混疊一樣是不可逆的。取樣率轉換的完整內容在第 7 章。
5. 間引き(デシメーション)。標本化レートを $M$ 分の 1 に落とせば、ナイキスト周波数も $M$ で割られる。したがって標本を捨てる前に、まず $\omega = \pi/M$ より上をすべてディジタル低域通過フィルタで取り除かなければならない——同じアンチエイリアシングの論法が、今度は離散時間領域の内側で効いており、このフィルタを省けば同じく不可逆に折り返す。レート変換は第 7 章で本格的に扱う。
| Stage | Role of the Nyquist frequency |
|---|---|
| Before sampling | sets the anti-aliasing filter's cutoff |
| Choosing an ADC | sets how high $f_s$ has to be |
| Digital processing | corresponds to $\omega=\pi$ — the reference point for every frequency spec |
| Reading a spectrum | upper limit of the useful display, and the basis for spotting aliases |
| Changing the rate | decimation must filter below the new Nyquist frequency first |
| 階段 | Nyquist 頻率扮演的角色 |
|---|---|
| 取樣之前 | 決定抗混疊濾波器的截止頻率 |
| 選 ADC | 決定取樣率要多高 |
| 數位處理 | 對應 $\omega=\pi$ —— 所有頻率規格的參考點 |
| 看頻譜 | 有效顯示範圍的上限,也是判斷混疊的依據 |
| 改變取樣率 | 降取樣前必須先濾到新的 Nyquist 頻率以下 |
| 段階 | ナイキスト周波数の役割 |
|---|---|
| 標本化の前 | アンチエイリアシングフィルタの遮断周波数を決める |
| ADC を選ぶとき | $f_s$ をどれだけ高くすべきかを決める |
| ディジタル処理 | $\omega=\pi$ に対応する——あらゆる周波数仕様の基準点 |
| スペクトルを読むとき | 有効な表示範囲の上限であり、折り返しを見抜く手がかり |
| レートを変えるとき | 間引きの前に新しいナイキスト周波数より下へ濾波しなければならない |
If sampling obeyed the Nyquist condition, the baseband replica ($k=0$ term) of $X_s(j\Omega)$ is an undistorted copy of $X_c(j\Omega)/T$. To rebuild $x_c(t)$ we pass the impulse train $x_s(t)$ through an ideal lowpass reconstruction filter with gain $T$ and cutoff at the Nyquist frequency $\pi/T$:
如果取樣時滿足 Nyquist 條件,$X_s(j\Omega)$ 的基頻複本($k=0$ 那一項)就是 $X_c(j\Omega)/T$ 未失真的副本。要重建 $x_c(t)$,我們把脈衝串 $x_s(t)$ 送進一個理想低通重建濾波器,增益為 $T$、截止頻率設在 Nyquist 頻率 $\pi/T$:
標本化がナイキスト条件を満たしていれば、$X_s(j\Omega)$ のベースバンド複製($k=0$ の項)は $X_c(j\Omega)/T$ の歪みのないコピーである。$x_c(t)$ を復元するには、インパルス列 $x_s(t)$ を利得 $T$、遮断周波数をナイキスト周波数 $\pi/T$ にとった理想低域通過再構成フィルタに通す:
The gain $T$ cancels the $1/T$ amplitude scaling introduced by sampling; the cutoff $\pi/T = \Omega_s/2$ keeps only the $k=0$ replica and erases all the images at $\pm\Omega_s, \pm 2\Omega_s,\dots$
增益 $T$ 正好抵消取樣帶來的 $1/T$ 振幅縮放;截止頻率 $\pi/T = \Omega_s/2$ 只留下 $k=0$ 那一份複本,把位於 $\pm\Omega_s, \pm 2\Omega_s,\dots$ 的鏡像全部刪掉。
利得 $T$ は標本化がもたらした $1/T$ の振幅スケーリングを打ち消し、遮断周波数 $\pi/T = \Omega_s/2$ は $k=0$ の複製だけを残して $\pm\Omega_s, \pm 2\Omega_s,\dots$ にあるイメージをすべて消し去る。
The usual summary — "it is non-causal, so it only works offline" — is too coarse, and it hides why the ideal reconstruction filter is in a harder class than, say, a centred moving average. Separate two cases:
常見的說法「它是非因果的,所以只能離線處理」講得太粗,而且掩蓋了一件事:理想重建濾波器所屬的難度等級,其實比「置中移動平均」那類還要高一層。要分成兩種情況來看:
よくあるまとめ——「非因果だからオフラインでしか使えない」——は粗すぎるし、理想再構成フィルタが例えば中心対称の移動平均より難しい部類に属する理由を覆い隠してしまう。二つの場合を分けて考えよう:
Non-causal but finite-length filters are perfectly usable in real time: delay the output by the look-ahead and they become causal. Non-causal and infinite-length filters — the ideal lowpass among them — cannot be implemented exactly at all, not even offline. They can only ever be approximated.
非因果但有限長的濾波器,在即時系統中完全可用:只要把輸出延遲「往前看的長度」,它就變成因果的。非因果而且無限長的濾波器——理想低通就是其中之一——則根本無法被精確實現,連離線也不行,永遠只能近似。
非因果だが有限長のフィルタは実時間でも問題なく使える。出力を先読み分だけ遅らせれば因果になるからだ。非因果かつ無限長のフィルタ——理想低域通過フィルタはその一つ——は厳密に実装することがオフラインでさえまったくできない。いつまでも近似しかできないのである。
The ideal reconstruction filter's impulse response $h_r(t) = \mathrm{sinc}(t/T)$ fails on both counts:
理想重建濾波器的脈衝響應 $h_r(t) = \mathrm{sinc}(t/T)$ 兩項都不合格:
理想再構成フィルタのインパルス応答 $h_r(t) = \mathrm{sinc}(t/T)$ は、二つとも失格である:
Even offline, with the entire record already stored, the record is finite — an infinitely long convolution is not something a longer wait can buy you. So the ideal lowpass is an approximation in every setting.
就算是離線處理、整段資料都已經存好,資料長度終究是有限的——無限長的摺積,並不是「多等一下」就能算得出來的東西。所以理想低通在任何情境下都只是近似。
オフラインで、記録全体が既に保存されていても、その記録は有限である——無限長の畳み込みは、長く待ったからといって手に入るものではない。したがって理想低域通過フィルタは、どのような状況でも近似にとどまる。
Take the centred three-point average of Chapter 2, $y[n] = \tfrac13\big(x[n-1] + x[n] + x[n+1]\big)$. It needs exactly one future sample. Delay everything by one sample and the same filter is causal:
以第 2 章的置中三點平均為例,$y[n] = \tfrac13\big(x[n-1] + x[n] + x[n+1]\big)$。它只需要一個未來樣本。把整體延遲一個樣本,同一個濾波器就變成因果的:
第 2 章の中心対称な 3 点平均 $y[n] = \tfrac13\big(x[n-1] + x[n] + x[n+1]\big)$ を取り上げよう。これはちょうど一つの未来標本を必要とする。全体を 1 標本遅らせれば、同じフィルタが因果になる:
Nothing about the filtering changed — only the label on the output. A finite non-causal filter needing $D$ future samples runs in real time with a fixed latency of $D$ samples, and that is the whole cost. (Chapter 2 calls this filter "offline only"; the sharper statement is "real time with one sample of delay".)
濾波這件事本身完全沒變——變的只是輸出的標籤。一個需要 $D$ 個未來樣本的有限長非因果濾波器,可以用固定 $D$ 個樣本的延遲在即時系統中運作,代價就只有這樣。(第 2 章把這個濾波器說成「只能離線」;更精確的說法是「延遲一個樣本即可即時」。)
濾波そのものは何も変わっていない——変わったのは出力に付けたラベルだけである。$D$ 個の未来標本を必要とする有限長の非因果フィルタは、$D$ 標本の固定遅延で実時間動作する。コストはそれだけである。(第 2 章ではこのフィルタを「オフライン専用」と呼んだが、より鋭い言い方は「1 標本の遅延で実時間動作」である。)
Digitally (FIR). Truncate the sinc to a finite span — say $\pm 50$ samples about the centre — and multiply by a window so the ends taper smoothly instead of being chopped. The result is exactly the "non-causal but finite" class above, so it runs in real time behind 50 samples of delay. Longer truncation gets closer to the brick wall and costs proportionally more delay; that is the entire trade.
數位(FIR)。把 sinc 截斷成有限長度——例如以中心為準前後各取 50 個樣本——再乘上一個窗函數,讓兩端平滑收斂而不是被硬切。做出來的東西正好屬於上面說的「非因果但有限長」那一類,所以延遲 50 個樣本之後就能即時運作。截得越長越接近直角截止,延遲也按比例增加;整個取捨就只是這樣。
ディジタルで(FIR)。sinc を有限の範囲——たとえば中心の前後 $\pm 50$ 標本——に打ち切り、両端がぶつ切りにならず滑らかに減衰するよう窓関数を掛ける。できあがるものはまさに上で言う「非因果だが有限長」の部類なので、50 標本の遅延の後ろで実時間動作する。打ち切り長を伸ばせば矩形特性に近づき、遅延も比例して増える。取引はそれがすべてである。
In analog (the actual reconstruction filter). Note that $H_r(j\Omega)$ above is an analog filter — its axis is $\Omega$, and it physically sits after the DAC. An analog circuit is causal by construction: it cannot wait for input that has not arrived. So the rectangle is approximated with causal Butterworth, Chebyshev or elliptic designs, and two costs follow:
類比(真正的重建濾波器)。注意上面的 $H_r(j\Omega)$ 是一個類比濾波器——它的橫軸是 $\Omega$,而且實體上是接在 DAC 之後。類比電路天生就是因果的:它沒有辦法等待還沒到達的輸入。所以那個矩形只能用因果的 Butterworth、Chebyshev 或橢圓濾波器去逼近,並因此付出兩項代價:
アナログで(実際の再構成フィルタ)。上の $H_r(j\Omega)$ はアナログフィルタであることに注意してほしい——軸は $\Omega$ であり、物理的には DAC の後ろに置かれる。アナログ回路は構造上つねに因果である。まだ到着していない入力を待つことはできない。そこであの矩形は因果なバターワース、チェビシェフ、楕円フィルタで近似され、二つのコストが生じる:
This is the reconstruction-side twin of the argument in §6.6.4: raise the sampling rate and the images move further away, so the analog filter never has to be steep in the first place. Oversampling buys an easy analog filter at both ends of the chain.
這正是 §6.6.4 那個論證在重建端的雙胞胎:把取樣率拉高,鏡像就離得更遠,類比濾波器一開始就不需要那麼陡。過取樣在整條鏈的兩端都買到了好做的類比濾波器。
これは §6.6.4 の議論の再構成側の双子である。標本化レートを上げればイメージは遠ざかり、アナログフィルタはそもそも急峻である必要がなくなる。オーバーサンプリングは鎖の両端で作りやすいアナログフィルタを買ってくれる。
filtfilt): the phase responses cancel exactly, leaving no phase distortion at all. The price is that the magnitude response is applied twice, so the effective response is $|H(e^{j\omega})|^2$ — design for that, or the stopband ends up twice as deep in dB as intended.filtfilt):兩次的相位響應剛好抵消,完全沒有相位失真。代價是振幅響應被施加了兩次,等效響應變成 $|H(e^{j\omega})|^2$——設計時要把這件事算進去,否則阻帶的 dB 深度會變成預期的兩倍。filtfilt)。位相応答がちょうど打ち消し合い、位相歪みはまったく残らない。代価は振幅応答が二度掛かることであり、実効的な応答は $|H(e^{j\omega})|^2$ になる——設計時にそれを見込まないと、阻止域の深さが dB で意図の 2 倍になってしまう。| Filter type | Real time | Offline |
|---|---|---|
| Causal | Yes | Yes |
| Non-causal, finite length | Yes, with a fixed delay | Yes |
| Non-causal and infinite (ideal lowpass) | Approximation only | Approximation only |
| 濾波器類型 | 即時 | 離線 |
|---|---|---|
| 因果 | 可以 | 可以 |
| 非因果、有限長 | 可以,需要固定延遲 | 可以 |
| 非因果且無限長(理想低通) | 只能近似 | 也只能近似 |
| フィルタの種類 | 実時間 | オフライン |
|---|---|---|
| 因果 | 可 | 可 |
| 非因果・有限長 | 可(固定遅延が必要) | 可 |
| 非因果かつ無限長(理想低域通過) | 近似のみ | やはり近似のみ |
Convolving the impulse train with $h_r(t)$ hangs one scaled sinc on every sample:
把脈衝串和 $h_r(t)$ 做摺積,等於在每個樣本上掛一個縮放過的 sinc:
インパルス列を $h_r(t)$ と畳み込むことは、各標本の上に定数倍された sinc を一つずつ吊るすことに等しい:
Two properties make this work:
有兩個性質讓它成立:
これが成り立つ理由は二つの性質にある:
The figure draws the interpolation formula literally, so it is worth reading term by term.
這張圖就是把 sinc 內插公式照字面畫出來:每個樣本各自產生一個 sinc,全部疊加之後就得到還原的連續訊號。所以值得逐項讀一遍。
この図は内挿の公式を文字どおりに描いたものなので、項ごとに読む価値がある。
The dashed curves — one sinc per sample. Each term of the sum
虛線:每個樣本各自的 sinc。公式中的每一項
破線の曲線——標本 1 個につき sinc が 1 本。和の各項は
$$x[n]\,\frac{\sin\big(\pi(t-nT)/T\big)}{\pi(t-nT)/T}$$The solid curve — the sum of all the dashed ones. Adding every sinc pointwise at each instant gives $\hat{x}_a(t)$, the reconstructed signal.
實線:所有虛線的總和。把所有 sinc 在每個時刻逐點相加,得到的就是 $\hat{x}_a(t)$,也就是還原出來的訊號。
実線の曲線——すべての破線の和。各時刻ですべての sinc を点ごとに足し合わせると、再構成された信号 $\hat{x}_a(t)$ が得られる。
Why the solid curve passes exactly through every sample. The sinc has one decisive property:
為什麼實線會剛好通過每一個樣本。sinc 函數有一個關鍵性質:
実線がすべての標本をぴったり通る理由。sinc には決定的な性質が一つある:
$$\frac{\sin\big(\pi(t-nT)/T\big)}{\pi(t-nT)/T} = \begin{cases} 1, & t = nT \\[2pt] 0, & t = mT,\; m \neq n \end{cases}$$Every sinc equals 1 at its own centre and is exactly 0 at every other sampling instant. Look along the axis of the figure: all the dashed curves cross zero together at the integer multiples of $T$. So at $t = nT$ only the $n$-th sinc is non-zero and the sum is $x[n]$ — the reconstruction cannot miss a sample. Between two sampling instants many sincs are non-zero at once, some positive and some negative, and their sum is what fills in the smooth curve.
也就是說,每個 sinc 在自己的中心等於 1,在其他所有取樣點都剛好是 0。仔細看圖的橫軸:所有虛線都在 $T$ 的整數倍處一起穿過 0,形成一排交叉點。因此在取樣時刻 $t = nT$,只有第 $n$ 個 sinc 不是 0,總和就等於 $x[n]$ —— 重建曲線不可能錯過任何一個樣本。而在兩個取樣點之間,許多 sinc 同時有值,有正有負,疊加起來剛好填出那條平滑的曲線。
どの sinc も自分の中心では 1 に等しく、それ以外のすべての標本化時刻では厳密に 0 になる。図の横軸に沿って見てほしい。破線の曲線はどれも $T$ の整数倍のところで揃ってゼロを横切っている。したがって $t = nT$ では第 $n$ の sinc だけが非零で、和は $x[n]$ になる——再構成が標本を外すことはありえない。二つの標本化時刻のあいだでは多くの sinc が同時に非零となり、正のものも負のものもあって、その和がなめらかな曲線を埋めていく。
| $x_s(t)$ — before the filter | $\hat{x}_a(t)$ — after it | |
|---|---|---|
| Shape | a row of impulses | one smooth curve |
| Between samples | identically zero | filled in by the overlapping sincs |
| In frequency | a row of replicas | only the baseband copy is left |
| $x_s(t)$ — 濾波前 | $\hat{x}_a(t)$ — 濾波後 | |
|---|---|---|
| 形式 | 一排脈衝 | 一條平滑曲線 |
| 樣本之間 | 都是 0 | 由重疊的 sinc 疊加填滿 |
| 頻域 | 一排複本 | 只剩基頻那一份 |
| $x_s(t)$ — フィルタの前 | $\hat{x}_a(t)$ — その後 | |
|---|---|---|
| かたち | インパルスの列 | 一本のなめらかな曲線 |
| 標本と標本のあいだ | 恒等的にゼロ | 重なり合う sinc が埋める |
| 周波数領域 | 複製の列 | ベースバンドのコピーだけが残る |
The step between the two columns is exactly the ideal lowpass filtering of §6.4.1: each impulse enters the filter and comes out as one sinc.
這兩欄之間的那個動作,正是 §6.4.1 的理想低通濾波:每根脈衝經過濾波器,就變成一個 sinc。
この二つの列のあいだの一歩が、まさに §6.4.1 の理想低域通過濾波である。各インパルスがフィルタに入り、一つの sinc となって出てくる。
The hat marks a reconstructed estimate, not the original. If the sampling obeyed the theorem ($\Omega_s > 2\Omega_N$), then $\hat{x}_a(t) = x_c(t)$ and the recovery is exact. If aliasing occurred, $\hat{x}_a(t)$ is a different signal — it still passes through every sample, but it is the wrong curve between them.
帽子代表這是還原出來的估計值,不是原訊號本身。若取樣時滿足取樣定理($\Omega_s > 2\Omega_N$),則 $\hat{x}_a(t) = x_c(t)$,還原完全精確。若發生了混疊,$\hat{x}_a(t)$ 就是另一個訊號 —— 它依然通過每一個樣本,但樣本之間的那條曲線是錯的。
この帽子は再構成された推定値であって原信号ではないことを示す。標本化が定理を満たしていれば($\Omega_s > 2\Omega_N$)、$\hat{x}_a(t) = x_c(t)$ となり復元は厳密である。折り返しが起きていれば、$\hat{x}_a(t)$ は別の信号である——やはりすべての標本を通るが、標本と標本のあいだでは誤った曲線を描いている。
$h_r(t)$ extends over all time and decays only like $1/t$, so the ideal D/C is unrealizable. Real DACs use a zero-order hold followed by a smoothing (anti-imaging) lowpass filter; the staircase hold introduces a mild $\mathrm{sinc}$-shaped droop that good designs compensate digitally. In simulations (Exercise 2) the sinc sum is also truncated to finitely many samples, which causes small edge errors.
$h_r(t)$ 在整個時間軸上都不為零,而且只以 $1/t$ 的速度衰減,所以理想的 D/C 是做不出來的。真實的 DAC 採用零階保持(zero-order hold),後面再接一個平滑(抗鏡像)低通濾波器;階梯狀的保持會帶來輕微的 $\mathrm{sinc}$ 型下垂,好的設計會用數位方式補償回來。在模擬中(習題 2),sinc 級數還會被截斷成有限項,因而在邊界附近產生一點誤差。
$h_r(t)$ は全時間にわたって広がり、しかも $1/t$ 程度にしか減衰しないので、理想的な D/C は実現不可能である。実際の DAC はゼロ次ホールドの後ろに平滑(アンチイメージ)低域通過フィルタを置く。階段状のホールドは緩やかな $\mathrm{sinc}$ 形のだれを生じ、よい設計はこれをディジタルで補償する。シミュレーション(演習 2)では sinc の和も有限項に打ち切られるため、端の近くで小さな誤差が生じる。
The central architecture of applied DSP: filter an analog signal by sampling it, processing the samples with a DT LTI system, and converting back:
這是應用 DSP 最核心的架構:想濾一個類比訊號,就先把它取樣,用離散時間的 LTI 系統處理這些樣本,再轉換回類比:
応用 DSP の中心となる構成:アナログ信号を標本化し、その標本を離散時間 LTI システムで処理し、再び戻すことで濾波する:
Tracking the spectra through the chain (assuming no aliasing at the C/D):
把頻譜沿著這條鏈一路追下去(假設 C/D 處沒有混疊):
この縦続接続に沿ってスペクトルを追う(C/D で折り返しが起きないと仮定する):
Composing the three relations, the whole chain behaves like a single CT LTI system:
把這三個關係合起來,整條鏈的行為就像一個單一的連續時間 LTI 系統:
三つの関係を合成すると、鎖全体が単一の連続時間 LTI システムのようにふるまう:
The same DT filter $H(e^{j\omega})$ implements a different analog response for every sampling rate: an ideal DT lowpass with cutoff $\omega_c$ acts as an analog lowpass with cutoff $\Omega_c = \omega_c/T$. Changing $T$ rescales the entire effective analog frequency axis. This is the rule you need for Homework Exercise 1: design $H(e^{j\omega})$ so that $H_{\text{eff}}(j\Omega)$ does the desired analog job, substituting $\omega = \Omega T$.
同一顆數位濾波器 $H(e^{j\omega})$,在不同的取樣率下會實現不同的類比響應:截止頻率為 $\omega_c$ 的理想數位低通,等效成截止頻率 $\Omega_c = \omega_c/T$ 的類比低通。改變 $T$,整條等效類比頻率軸就跟著縮放。習題 1 用的正是這條規則:代入 $\omega = \Omega T$,設計出能讓 $H_{\text{eff}}(j\Omega)$ 完成指定類比任務的 $H(e^{j\omega})$。
同じ離散時間フィルタ $H(e^{j\omega})$ は、標本化レートごとに異なるアナログ応答を実現する。遮断周波数 $\omega_c$ の理想離散時間低域通過フィルタは、遮断周波数 $\Omega_c = \omega_c/T$ のアナログ低域通過フィルタとしてふるまう。$T$ を変えれば等価アナログ周波数軸全体が伸縮する。演習 1 で必要になるのがこの規則である。$\omega = \Omega T$ を代入して、$H_{\text{eff}}(j\Omega)$ が望みのアナログ処理を行うように $H(e^{j\omega})$ を設計すればよい。
A DT ideal lowpass filter has cutoff $\omega_c = \pi/4$. The C/D and D/C run at $f_s = 8$ kHz. What analog filter does the chain implement?
一個理想的數位低通濾波器截止頻率為 $\omega_c = \pi/4$,C/D 與 D/C 都以 $f_s = 8$ kHz 運作。整條鏈等效成什麼樣的類比濾波器?
離散時間の理想低域通過フィルタの遮断周波数が $\omega_c = \pi/4$ であるとする。C/D と D/C は $f_s = 8$ kHz で動作する。この鎖はどんなアナログフィルタを実現するか。
Sampling discretizes time; a real A/D converter must also discretize amplitude. A uniform quantizer with $B$ bits maps each sample to the nearest of $2^B$ levels spaced $\Delta$ apart. For full-scale amplitude $m_{\max}$:
取樣把時間離散化;真實的 A/D 轉換器還必須把振幅也離散化。一個 $B$ 位元的均勻量化器,會把每個樣本對應到 $2^B$ 個間隔為 $\Delta$ 的階層中最接近的一個。若滿刻度振幅為 $m_{\max}$:
標本化は時間を離散化する。実際の A/D 変換器はさらに振幅も離散化しなければならない。$B$ ビットの均一量子化器は、各標本を間隔 $\Delta$ で並んだ $2^B$ 個のレベルのうち最も近いものへ写す。フルスケール振幅を $m_{\max}$ とすると:
Two standard conventions differ in where the levels sit:
兩種標準慣例的差別,在於階層擺放的位置:
標準的な二つの流儀は、レベルをどこに置くかで異なる:
Both are uniform quantizers and both have step size $\Delta = 1$ in Fig. 6-6. The only difference is where the origin $x=0$ falls on the staircase. The names say it: on a real staircase the tread is the flat part you stand on (the output holds a constant value) and the rise is the vertical face between treads (the output jumps to the next level).
兩者都是均勻量化器,在圖 6-6 中步階大小 $\Delta$ 也都等於 1。差別只在於原點 $x = 0$ 落在階梯的哪個位置。名稱本身就說明了一切:把量化曲線想成樓梯,tread(踏面)是階梯平的部分,也就是輸出維持定值的區段;rise(豎板)是階梯垂直跳起的部分,也就是輸出跳到下一個值的位置。
どちらも均一量子化器であり、図 6-6 ではステップサイズもどちらも $\Delta = 1$ である。違いは原点 $x=0$ が階段のどこに落ちるかだけである。名前がそれを語っている。実際の階段では踏み面(tread)が足を乗せる平らな部分(出力が一定値を保つ区間)であり、蹴上げ(rise)が踏み面と踏み面のあいだの垂直な面(出力が次のレベルへ跳ぶところ)である。
| midtread | midrise | |
|---|---|---|
| The origin sits on | the middle of a tread | the middle of a rise |
| For inputs near 0 | the output rests quietly at 0 | the output toggles between two levels |
| midtread(中平型) | midrise(中升型) | |
|---|---|---|
| 原點落在 | 踏面的中間 | 豎板的中間 |
| 輸入在 0 附近時 | 輸出平穩地停在 0 | 輸出在兩個值之間跳動 |
| ミッドトレッド型 | ミッドライズ型 | |
|---|---|---|
| 原点が乗るのは | 踏み面の中央 | 蹴上げの中央 |
| 0 付近の入力に対して | 出力は静かに 0 にとどまる | 出力は二つのレベルのあいだで振動する |
That is exactly what Fig. 6-6 shows: on the left there is a flat run through $x=0$ (output 0); on the right $x=0$ is a vertical jump, from $-1/2$ straight to $+1/2$.
看圖 6-6 就是這樣:左圖在 $x = 0$ 附近是一段水平線(輸出 0);右圖在 $x = 0$ 處剛好是一個垂直跳躍,從 $-1/2$ 跳到 $+1/2$。
図 6-6 が示しているのはまさにそれである。左では $x=0$ を貫く平らな区間があり(出力は 0)、右では $x=0$ が $-1/2$ から $+1/2$ へまっすぐ跳ぶ垂直な段差になっている。
| Midtread (round to integer) | Midrise (round with offset) | |
|---|---|---|
| Rule | $Q[x] = \mathrm{round}(x)$ | $Q[x] = \mathrm{round}(x-\tfrac12)+\tfrac12$ |
| Output levels | $\{-2,\,-1,\,0,\,1\}$ | $\{-\tfrac32,\,-\tfrac12,\,\tfrac12,\,\tfrac32\}$ |
| Is 0 a level? | yes | no |
| Symmetric? | no — one extra level on the negative side | yes |
| Bit pattern | two's complement: 10, 11, 00, 01 | sign–magnitude: 11, 10, 00, 01 |
| Step size | $\Delta = \frac{1-(-2)}{3} = 1$ | $\Delta = \frac{3/2-(-3/2)}{3} = 1$ |
| Midtread(四捨五入到整數) | Midrise(帶偏移的四捨五入) | |
|---|---|---|
| 量化規則 | $Q[x] = \mathrm{round}(x)$ | $Q[x] = \mathrm{round}(x-\tfrac12)+\tfrac12$ |
| 輸出位階 | $\{-2,\,-1,\,0,\,1\}$ | $\{-\tfrac32,\,-\tfrac12,\,\tfrac12,\,\tfrac32\}$ |
| 是否有 0 這個位階 | 有 | 沒有 |
| 是否對稱 | 不對稱 —— 負方向多一個位階 | 對稱 |
| 位元表示 | 二補數:10, 11, 00, 01 | 符號與大小:11, 10, 00, 01 |
| 步階大小 | $\Delta = \frac{1-(-2)}{3} = 1$ | $\Delta = \frac{3/2-(-3/2)}{3} = 1$ |
| ミッドトレッド型(整数へ丸める) | ミッドライズ型(オフセット付きで丸める) | |
|---|---|---|
| 規則 | $Q[x] = \mathrm{round}(x)$ | $Q[x] = \mathrm{round}(x-\tfrac12)+\tfrac12$ |
| 出力レベル | $\{-2,\,-1,\,0,\,1\}$ | $\{-\tfrac32,\,-\tfrac12,\,\tfrac12,\,\tfrac32\}$ |
| 0 はレベルか | はい | いいえ |
| 対称か | いいえ——負側にレベルが一つ多い | はい |
| ビットパターン | 2 の補数:10, 11, 00, 01 | 符号絶対値:11, 10, 00, 01 |
| ステップサイズ | $\Delta = \frac{1-(-2)}{3} = 1$ | $\Delta = \frac{3/2-(-3/2)}{3} = 1$ |
Why the bit patterns differ. Midtread codes map straight onto two's complement integers, which is also why its levels are lopsided — 2-bit two's complement runs from $-2$ to $1$ by construction:
位元表示為什麼不同。Midtread 用二補數,剛好對應整數 —— 這也正是它的位階不對稱的原因:2 位元的二補數範圍本來就是 $-2$ 到 $1$:
ビットパターンが異なる理由。ミッドトレッド型の符号は2 の補数整数にそのまま対応する。レベルが偏っているのもそのためで、2 ビットの 2 の補数は構造上 $-2$ から $1$ までを走る:
| bits | 10 | 11 | 00 | 01 |
|---|---|---|---|---|
| value | $-2$ | $-1$ | $0$ | $1$ |
| 位元 | 10 | 11 | 00 | 01 |
|---|---|---|---|---|
| 值 | $-2$ | $-1$ | $0$ | $1$ |
| ビット | 10 | 11 | 00 | 01 |
|---|---|---|---|---|
| 値 | $-2$ | $-1$ | $0$ | $1$ |
Midrise instead uses a sign–magnitude style code: the first bit is the sign, the second the magnitude.
Midrise 則用類似符號與大小的表示:第一個位元是正負號,第二個位元是大小。
一方ミッドライズ型は符号絶対値方式の符号を用いる。第 1 ビットが符号、第 2 ビットが大きさである。
| bits | 11 | 10 | 00 | 01 |
|---|---|---|---|---|
| sign | $-$ | $-$ | $+$ | $+$ |
| magnitude | $3/2$ | $1/2$ | $1/2$ | $3/2$ |
| value | $-3/2$ | $-1/2$ | $1/2$ | $3/2$ |
| 位元 | 11 | 10 | 00 | 01 |
|---|---|---|---|---|
| 符號 | $-$ | $-$ | $+$ | $+$ |
| 大小 | $3/2$ | $1/2$ | $1/2$ | $3/2$ |
| 值 | $-3/2$ | $-1/2$ | $1/2$ | $3/2$ |
| ビット | 11 | 10 | 00 | 01 |
|---|---|---|---|---|
| 符号 | $-$ | $-$ | $+$ | $+$ |
| 大きさ | $3/2$ | $1/2$ | $1/2$ | $3/2$ |
| 値 | $-3/2$ | $-1/2$ | $1/2$ | $3/2$ |
With $B=2$ there are $2^2 = 4$ levels and therefore $4-1 = 3$ gaps between them. Both conventions span a range of 3, so both give $\Delta = 1$, and inside the linear region the quantization error of either never exceeds $\pm\Delta/2$.
$B = 2$ 位元有 $2^2 = 4$ 個位階,位階之間就有 $4 - 1 = 3$ 個間隔。兩種方式的範圍都是 3,所以 $\Delta$ 都是 1;在線性區內,兩者的量化誤差也都不超過 $\pm\Delta/2$。
$B=2$ ならレベルは $2^2 = 4$ 個あり、したがってレベル間の隙間は $4-1 = 3$ 個である。どちらの流儀も範囲 3 をまたぐので $\Delta = 1$ となり、線形領域の内側ではどちらの量子化誤差も $\pm\Delta/2$ を超えることはない。
This is the consideration that usually decides between them.
這是選擇兩者時最重要的考量。
両者のどちらを選ぶかは、たいていこの点で決まる。
That is why audio, which is full of silent passages, usually takes midtread. Midrise's advantage is the other one in the table: it is perfectly symmetric, treating positive and negative inputs alike instead of carrying one extra level on the negative side.
所以音訊這類常有靜音段落的應用多採用 midtread。另一方面,midrise 的優點就是表中的另一項:它完全對稱,正負輸入受到同樣的處理,不會像 midtread 那樣負方向多出一個位階。
無音の箇所が多い音声・音響にミッドトレッド型が使われるのはそのためである。ミッドライズ型の利点は表のもう一方の項目である。すなわち完全に対称であり、負側にレベルを一つ余分にもつことなく、正負の入力を同じように扱う。
The quantization error $e[n] = Q[x[n]] - x[n]$ is deterministic, but for signals that are large and busy compared to one LSB it behaves like additive white noise, uncorrelated with itself and with the signal:
量化誤差 $e[n] = Q[x[n]] - x[n]$ 其實是確定性的,但只要訊號相對於一個 LSB 夠大、變化夠劇烈,它的行為就很像加性白雜訊——自身不相關,也和訊號不相關:
量子化誤差 $e[n] = Q[x[n]] - x[n]$ は決定論的な量であるが、1 LSB に比べて十分大きく、かつ目まぐるしく変化する信号に対しては、自分自身とも信号とも無相関な加法性白色雑音のようにふるまう:
The box above writes $\sigma_e^2 = E[e^2]$ and then calls the result the noise power, quietly treating two different quantities as one. They are worth separating for a moment. The average power of a signal is its mean-square value, $P_x = E[x^2]$; the variance $\sigma_x^2$ measures spread about the mean $\mu_x$. Rearranging the definition of the variance relates them in one line:
上面的方框寫 $\sigma_e^2 = E[e^2]$,然後直接把結果稱為雜訊功率,等於是悄悄把兩個不同的量當成同一個。值得花一點時間把它們分開看。訊號的平均功率是它的均方值 $P_x = E[x^2]$;變異數 $\sigma_x^2$ 量的則是相對於平均值 $\mu_x$ 的離散程度。把變異數的定義移項,一行就能把兩者連起來:
上の囲みは $\sigma_e^2 = E[e^2]$ と書いたうえで、その結果を雑音電力と呼んでおり、二つの異なる量をさりげなく一つのものとして扱っている。ここでいったん分けて考える価値がある。信号の平均電力はその二乗平均値 $P_x = E[x^2]$ であり、分散 $\sigma_x^2$ は平均 $\mu_x$ のまわりのばらつきを測る。分散の定義を移項すれば、両者は一行で結びつく:
What the two terms are. Split the signal into its constant part and its fluctuation, $x = \mu_x + (x - \mu_x)$, and square:
這兩項各是什麼。把訊號拆成固定的部分與擺動的部分,$x = \mu_x + (x - \mu_x)$,再平方:
二つの項が何であるか。信号を一定部分と変動部分に分け、$x = \mu_x + (x - \mu_x)$ として二乗する:
The cross term vanishes because the fluctuation has zero mean by construction. That is what makes the two powers simply add: $\mu_x^2$ is the power of the DC component (a fixed offset), and $\sigma_x^2$ is the power of whatever swings above and below it — the AC component.
交叉項之所以消失,是因為擺動的那一部分依定義平均值就是 0。正因如此,兩邊的功率可以直接相加:$\mu_x^2$ 是直流成分(固定偏移)的功率,$\sigma_x^2$ 則是在平均值上下擺動那一部分的功率,也就是交流成分的功率。
交差項が消えるのは、変動部分が定義により平均ゼロだからである。それゆえ二つの電力は単純に足し合わさる。$\mu_x^2$ は直流成分(固定オフセット)の電力であり、$\sigma_x^2$ はその上下に振れる分——交流成分——の電力である。
| Quantity | Value |
|---|---|
| Mean $\mu$ | $1$ |
| DC power $\mu^2$ | $1$ |
| Variance $\sigma^2$ (the power of $\sin t$) | $1/2$ |
| Total power $E[x^2]$ | $1 + 1/2 = 1.5$ |
| 項目 | 值 |
|---|---|
| 平均值 $\mu$ | $1$ |
| 直流功率 $\mu^2$ | $1$ |
| 變異數 $\sigma^2$($\sin t$ 的功率) | $1/2$ |
| 總功率 $E[x^2]$ | $1 + 1/2 = 1.5$ |
| 量 | 値 |
|---|---|
| 平均 $\mu$ | $1$ |
| 直流電力 $\mu^2$ | $1$ |
| 分散 $\sigma^2$($\sin t$ の電力) | $1/2$ |
| 全電力 $E[x^2]$ | $1 + 1/2 = 1.5$ |
Set $\mu_x = 0$ and the DC term vanishes, leaving $P_x = \sigma_x^2$ — a single number wearing two names. Every use of variance-as-power in this chapter rests on that one condition. It holds for the signal, because audio, speech and AC-coupled sensor signals carry no DC, so §6.6.3 may write $P_{\text{avg}} = \sigma_x^2$; and it holds for the error, because both quantizers of §6.6.1 round, which makes $\mu_e = 0$ — as the next paragraphs show, that is not automatic.
令 $\mu_x = 0$,直流項就消失了,只剩 $P_x = \sigma_x^2$——同一個數字,兩個名字。本章每一次「把變異數當功率用」都建立在這個條件上。對訊號成立,是因為音訊、語音與交流耦合的感測器訊號都不含直流,所以 §6.6.3 可以直接寫 $P_{\text{avg}} = \sigma_x^2$;對誤差成立,則是因為 §6.6.1 的兩種量化器都採用四捨五入,使得 $\mu_e = 0$——而接下來會看到,這件事並非理所當然。
$\mu_x = 0$ とおけば直流項は消え、$P_x = \sigma_x^2$ だけが残る——二つの名前をまとった一つの数である。本章で分散を電力として使うところはすべて、この一つの条件に立脚している。信号について成り立つのは、音響・音声・交流結合されたセンサ信号が直流を含まないからであり、だからこそ §6.6.3 は $P_{\text{avg}} = \sigma_x^2$ と書いてよい。誤差について成り立つのは、§6.6.1 の二つの量子化器がどちらも丸めを行い $\mu_e = 0$ となるからである——次の段落で見るように、これは自動的に成り立つことではない。
Whether the quantization error has zero mean is decided entirely by how the quantizer maps $x$ to a level. Two choices, same step size $\Delta$:
量化誤差的平均值是不是 0,完全取決於量化器用什麼方式把 $x$ 對應到階層。同樣的階距 $\Delta$,兩種做法:
量子化誤差の平均がゼロかどうかは、量子化器が $x$ をレベルへどのように写すかだけで決まる。同じステップサイズ $\Delta$ に対して二つの選択肢がある:
The variance is unchanged — the error distribution is still a uniform density of width $\Delta$, merely slid over — but the added DC offset quadruples the total error power, a penalty of $10\log_{10}4 \approx 6.02$ dB. Truncating throws away a whole bit's worth of SNR. That is one of the reasons both the midtread and midrise quantizers of §6.6.1 are defined with rounding (midrise being rounding with a half-step offset), and why a DSP that truncates internally is worth a second look.
變異數沒有變——誤差分布仍然是寬度為 $\Delta$ 的均勻密度,只是整個平移過去——但多出來的直流偏移讓總誤差功率變成 4 倍,代價是 $10\log_{10}4 \approx 6.02$ dB。捨去等於白白丟掉整整一個位元的 SNR。這正是 §6.6.1 的中平型與中升型都定義成四捨五入(中升型是帶半階偏移的四捨五入)的理由之一,也是為什麼看到一顆內部採用捨去的 DSP 時值得多留意一下。
分散は変わらない——誤差分布は依然として幅 $\Delta$ の一様密度であり、単に平行移動しただけである——が、加わった直流オフセットが全誤差電力を 4 倍にし、$10\log_{10}4 \approx 6.02$ dB の損失となる。切り捨ては丸ごと 1 ビット分の SNR を捨てている。§6.6.1 のミッドトレッド型もミッドライズ型も丸めで定義されている(ミッドライズ型は半ステップのオフセット付きの丸めである)のはこれが理由の一つであり、内部で切り捨てを行う DSP を見かけたら二度見する価値があるのもそのためである。
| Rounding | Truncation | |
|---|---|---|
| Error range | $[-\Delta/2,\ \Delta/2]$ | $[-\Delta,\ 0]$ |
| Mean $\mu_e$ | $0$ | $-\Delta/2$ |
| Variance $\sigma_e^2$ | $\Delta^2/12$ | $\Delta^2/12$ |
| Total power $E[e^2]$ | $\Delta^2/12$ | $\Delta^2/3$ |
| Penalty | — | $4\times$, i.e. $6.02$ dB |
| Spectral signature | flat noise floor | flat floor plus a DC spike |
| 四捨五入 | 無條件捨去 | |
|---|---|---|
| 誤差範圍 | $[-\Delta/2,\ \Delta/2]$ | $[-\Delta,\ 0]$ |
| 平均值 $\mu_e$ | $0$ | $-\Delta/2$ |
| 變異數 $\sigma_e^2$ | $\Delta^2/12$ | $\Delta^2/12$ |
| 總功率 $E[e^2]$ | $\Delta^2/12$ | $\Delta^2/3$ |
| 代價 | — | 4 倍,即 $6.02$ dB |
| 頻譜特徵 | 平坦的雜訊底 | 平坦雜訊底再加上直流處一根譜線 |
| 丸め | 切り捨て | |
|---|---|---|
| 誤差の範囲 | $[-\Delta/2,\ \Delta/2]$ | $[-\Delta,\ 0]$ |
| 平均 $\mu_e$ | $0$ | $-\Delta/2$ |
| 分散 $\sigma_e^2$ | $\Delta^2/12$ | $\Delta^2/12$ |
| 全電力 $E[e^2]$ | $\Delta^2/12$ | $\Delta^2/3$ |
| 損失 | — | $4\times$、すなわち $6.02$ dB |
| スペクトル上の特徴 | 平坦な雑音フロア | 平坦なフロアに加えて直流のスパイク |
The $\mu_e^2$ term is not spread across frequency; it is a single line at DC. So it behaves quite unlike $\sigma_e^2$: a known constant offset can be calibrated out by subtracting it, or blocked by a DC-blocking filter, whereas the variance can never be removed. The same reasoning applies to a converter's specified offset error, which is why datasheets list offset and noise as separate line items.
$\mu_e^2$ 這一項不是散布在各個頻率上的,它只是直流處的一根譜線,因此行為和 $\sigma_e^2$ 很不一樣:一個已知的固定偏移可以用相減校正掉,或用隔直流的濾波器擋掉,而變異數則永遠消不掉。轉換器規格書上標的 offset error 也是同一個道理——所以規格書會把偏移與雜訊分成兩個獨立的項目來列。
$\mu_e^2$ の項は周波数軸上に広がってはおらず、直流にある一本の線である。したがって $\sigma_e^2$ とはまったく異なるふるまいをする。既知の一定オフセットは引き算で校正して取り除くことも、直流阻止フィルタで遮ることもできるが、分散は決して取り除けない。同じ理屈は変換器の規定オフセット誤差にも当てはまり、データシートがオフセットと雑音を別々の項目として挙げているのはそのためである。
So when the slides write $\sigma^2$ throughout, the assumption riding along silently is that both the signal and the error are zero-mean. Check that assumption before reusing the formula — it is exactly what fails under truncation.
所以投影片一路寫 $\sigma^2$,背後悄悄帶著的假設就是訊號與誤差的平均值都是 0。要把公式搬去別的地方用之前,先確認這個假設成立——它正是在「無條件捨去」的情況下失效的那一個。
したがってスライドが一貫して $\sigma^2$ と書くとき、その背後に黙って乗っている仮定は信号も誤差も平均ゼロであるということだ。公式を使い回す前にこの仮定を確かめること——切り捨てのもとで崩れるのは、まさにこれである。
One last convention to keep straight: for a deterministic sequence the same quantity is written as a time average, $P_x = \lim_{N\to\infty} \frac{1}{2N+1}\sum_{n=-N}^{N} |x[n]|^2$, rather than an expectation. For the ergodic, stationary signals assumed throughout this chapter the two agree, which is why the quantization-noise model can be validated by simply measuring the mean square of a simulated error sequence — as Fig. 6-7 does.
最後還有一個符號慣例要分清楚:對確定性序列,同一個量是寫成時間平均 $P_x = \lim_{N\to\infty} \frac{1}{2N+1}\sum_{n=-N}^{N} |x[n]|^2$,而不是期望值。對本章自始假設的遍歷、平穩訊號來說兩者相等,這也正是為什麼量化雜訊模型可以直接用「量一段模擬誤差序列的均方值」來驗證——圖 6-7 做的就是這件事。
最後にもう一つ、取り違えないでおきたい約束がある。決定論的な系列に対しては、同じ量が期待値ではなく時間平均 $P_x = \lim_{N\to\infty} \frac{1}{2N+1}\sum_{n=-N}^{N} |x[n]|^2$ として書かれる。本章を通じて仮定しているエルゴード的・定常な信号では両者は一致し、だからこそ量子化雑音モデルはシミュレーションで得た誤差系列の二乗平均を測るだけで検証できる——図 6-7 がやっているのがそれである。
With the variance-vs-power distinction settled, the $\Delta^2/12$ in the box above takes three short steps. The model says the error is uniformly distributed over one step, so its density is a rectangle of width $\Delta$ and height $1/\Delta$ — the height is forced, since the area must be 1:
把變異數與功率的區別釐清之後,上面方框裡的 $\Delta^2/12$ 只要三個小步驟。模型說誤差在一個階距內均勻分布,所以它的機率密度是一個寬 $\Delta$、高 $1/\Delta$ 的長方形——高度是被逼出來的,因為面積必須等於 1:
分散と電力の区別が片づいたので、上の囲みの $\Delta^2/12$ は短い三段階で得られる。モデルは誤差が 1 ステップにわたって一様分布すると言うので、その密度は幅 $\Delta$、高さ $1/\Delta$ の長方形である——面積が 1 でなければならないので、高さは強制的に決まる:
Step 1 — the mean. The rectangle is symmetric about the origin, so $\mu_e = 0$. By the result just established, the variance therefore is the average power: $\sigma_e^2 = E[e^2]$, with no $\mu_e^2$ term to carry.
第 1 步 — 平均值。長方形對 0 對稱,所以 $\mu_e = 0$。依照剛剛得到的結論,變異數就是平均功率:$\sigma_e^2 = E[e^2]$,不必再帶一個 $\mu_e^2$ 項。
手順 1 — 平均。長方形は原点について対称なので $\mu_e = 0$ である。いま確かめた結果により、分散はそのまま平均電力となる:$\sigma_e^2 = E[e^2]$ であり、$\mu_e^2$ の項を背負う必要はない。
Step 2 — the integral. Take the second moment of the rectangle:
第 2 步 — 積分。對這個長方形取二階動差:
手順 2 — 積分。長方形の二次モーメントをとる:
The factor $\tfrac{2}{3}$ appears because $e^3$ is odd: evaluating it at both limits gives $(\Delta/2)^3 - (-\Delta/2)^3 = 2(\Delta/2)^3$, and the $\tfrac13$ comes from the integration. Note the answer depends on $\Delta$ alone — not on the signal, not on the number of bits except through $\Delta = 2m_{\max}/2^B$.
會出現 $\tfrac{2}{3}$ 這個係數,是因為 $e^3$ 是奇函數:代入上下限得到 $(\Delta/2)^3 - (-\Delta/2)^3 = 2(\Delta/2)^3$,而 $\tfrac13$ 來自積分本身。注意這個答案只和 $\Delta$ 有關——與訊號無關,也只透過 $\Delta = 2m_{\max}/2^B$ 才和位元數扯上關係。
係数 $\tfrac{2}{3}$ が現れるのは $e^3$ が奇関数だからである。両端で評価すると $(\Delta/2)^3 - (-\Delta/2)^3 = 2(\Delta/2)^3$ となり、$\tfrac13$ は積分から来る。答えが $\Delta$ だけに依存することに注意してほしい——信号にはよらず、ビット数にも $\Delta = 2m_{\max}/2^B$ を通してしか関係しない。
Step 3 — read it as an amplitude. Powers are hard to feel; take the square root:
第 3 步 — 換成振幅來看。功率不容易有感覺,開個根號:
手順 3 — 振幅として読む。電力は実感しにくいので、平方根をとる:
The standard deviation is the typical size of the quantization error, and it comes out at roughly three tenths of a step — not half a step. Half a step, $\Delta/2$, is the worst case, hit only at the very edge of a decision interval. The ratio $\sigma_e / e_{\max} = 0.289/0.5 = 1/\sqrt3 \approx 0.58$ is the crest factor of a uniform distribution, and it is why a converter's rms noise specification is always meaningfully smaller than its $\pm\tfrac12$ LSB error bound. Quoting $\Delta/2$ as if it were the noise level overstates the noise power by a factor of 3, about 4.8 dB.
標準差是量化誤差的典型大小,算出來大約是三成個階距,而不是半個階距。半個階距 $\Delta/2$ 是最壞情況,只有落在判別區間的最邊緣時才會碰到。比值 $\sigma_e / e_{\max} = 0.289/0.5 = 1/\sqrt3 \approx 0.58$ 是均勻分布的波峰因數,這也是為什麼轉換器規格上的均方根雜訊總是明顯小於它 $\pm\tfrac12$ LSB 的誤差上界。把 $\Delta/2$ 當成雜訊位準來報,會把雜訊功率高估 3 倍,約 4.8 dB。
標準偏差は量子化誤差の典型的な大きさであり、おおよそ1 ステップの 3 割になる——半ステップではない。半ステップ $\Delta/2$ は最悪値であり、判定区間のちょうど端でしか起こらない。比 $\sigma_e / e_{\max} = 0.289/0.5 = 1/\sqrt3 \approx 0.58$ は一様分布の波高率であり、変換器の実効値雑音仕様が $\pm\tfrac12$ LSB の誤差上界より常に意味のあるだけ小さい理由でもある。$\Delta/2$ をあたかも雑音レベルであるかのように述べると、雑音電力を 3 倍、約 4.8 dB 過大に見積もることになる。
A worked number for the CD: with $B = 16$ and full scale $\pm 1$, $\Delta = 2/2^{16} \approx 3.05 \times 10^{-5}$, so $\sigma_e \approx 8.8 \times 10^{-6}$ — about nine parts per million of full scale. Compare that against the full-scale sinusoid's rms of $1/\sqrt2 \approx 0.707$ and the ratio is $\approx 80\,300$, i.e. $20\log_{10}(80\,300) \approx 98.1$ dB. Same 98 dB as §6.6.3 and §6.6.4, arrived at from the amplitude side.
用 CD 的數字算一次:$B = 16$、滿刻度 $\pm 1$ 時,$\Delta = 2/2^{16} \approx 3.05 \times 10^{-5}$,所以 $\sigma_e \approx 8.8 \times 10^{-6}$——大約是滿刻度的百萬分之九。拿它和滿刻度正弦波的均方根值 $1/\sqrt2 \approx 0.707$ 相比,比值約為 $80\,300$,也就是 $20\log_{10}(80\,300) \approx 98.1$ dB。和 §6.6.3、§6.6.4 得到的同樣是 98 dB,只是這次從振幅這一側算過來。
CD について数字を入れてみよう。$B = 16$、フルスケール $\pm 1$ なら $\Delta = 2/2^{16} \approx 3.05 \times 10^{-5}$ なので $\sigma_e \approx 8.8 \times 10^{-6}$——フルスケールのおよそ 100 万分の 9 である。これをフルスケール正弦波の実効値 $1/\sqrt2 \approx 0.707$ と比べると比は $\approx 80\,300$、すなわち $20\log_{10}(80\,300) \approx 98.1$ dB となる。§6.6.3 や §6.6.4 と同じ 98 dB に、今度は振幅の側からたどり着いた。
Under the same conditions — a busy signal spanning many steps — two further assumptions are normally layered on top of the uniform density. Neither is exactly true; both are close enough to be extremely useful:
在同樣的條件下——訊號夠活潑、跨越許多階距——通常會在均勻密度之上再疊加兩個假設。兩者都不是嚴格成立,但都夠接近,而且極其好用:
同じ条件——多くのステップにまたがる活発な信号——のもとでは、一様密度の上にさらに二つの仮定を重ねるのが普通である。どちらも厳密には正しくないが、どちらも極めて有用なほど真実に近い:
With those in hand, the quantizer — a memoryless nonlinearity, and therefore something no linear tool can touch — is replaced by the original signal plus an independent additive noise source:
有了這兩點,量化器——一個無記憶的非線性元件,因此任何線性工具都碰不得——就可以被換成「原訊號加上一個獨立的雜訊源」:
これらが手に入れば、量子化器——無記憶の非線形要素であり、それゆえ線形的な道具では手が出せないもの——を、元の信号に独立な加法性雑音源を加えたものへ置き換えられる:
Everything downstream of the quantizer is now an LTI problem. Because signal and noise are uncorrelated, their powers simply add rather than interfering; because $e[n]$ is white, its power is spread evenly across $|\omega| < \pi$ and any later filter $H(e^{j\omega})$ scales it by a single number, $\sigma_e^2 \cdot \frac{1}{2\pi}\int_{-\pi}^{\pi}|H(e^{j\omega})|^2 d\omega$. That is the whole reason the SQNR could be written down in one line as a ratio of two powers — the $6.02B + 1.76$ dB of §6.6.3 and §6.6.4 is a result of this model, not of the quantizer itself.
量化器之後的一切,現在都變成 LTI 問題。因為訊號與雜訊不相關,兩者的功率可以直接相加而不會互相干涉;又因為 $e[n]$ 是白的,它的功率均勻散布在 $|\omega| < \pi$ 上,後面任何濾波器 $H(e^{j\omega})$ 對它的作用都只是乘上一個數字 $\sigma_e^2 \cdot \frac{1}{2\pi}\int_{-\pi}^{\pi}|H(e^{j\omega})|^2 d\omega$。這正是 SQNR 能夠被寫成「兩個功率的比值」這麼簡單一行的全部理由——§6.6.3 與 §6.6.4 的 $6.02B + 1.76$ dB 是這個模型的結果,而不是量化器本身的性質。
量子化器より後ろはすべて LTI の問題になる。信号と雑音が無相関なので、両者の電力は干渉せず単純に足し合わさる。また $e[n]$ が白色なので、その電力は $|\omega| < \pi$ にわたって一様に広がり、後段のどんなフィルタ $H(e^{j\omega})$ もそれを一つの数 $\sigma_e^2 \cdot \frac{1}{2\pi}\int_{-\pi}^{\pi}|H(e^{j\omega})|^2 d\omega$ 倍するだけになる。SQNR が二つの電力の比として一行で書けたのは、まるごとこれが理由である——§6.6.3 と §6.6.4 の $6.02B + 1.76$ dB はこのモデルの帰結であって、量子化器そのものの性質ではない。
Whiteness pays a second dividend, and it is the one §6.6.4 was quietly relying on. If the noise power $\sigma_e^2$ is spread uniformly over the full band $|\omega| < \pi$, then sampling $M$ times faster does not change the total but does spread it over $M$ times as much bandwidth. Lowpass-filtering to the signal band and decimating back down keeps only $1/M$ of it:
「白」這個性質還有第二項紅利,而 §6.6.4 其實一直默默依賴著它。如果雜訊功率 $\sigma_e^2$ 均勻散布在整個 $|\omega| < \pi$ 頻帶上,那麼把取樣率提高 $M$ 倍並不會改變總量,卻會把它攤到 $M$ 倍寬的頻寬上。接著低通濾到訊號頻帶再降取樣回來,就只留下其中的 $1/M$:
白色性はもう一つ配当を払う。§6.6.4 が静かに頼っていたのがそれである。雑音電力 $\sigma_e^2$ が全帯域 $|\omega| < \pi$ に一様に広がっているなら、$M$ 倍速く標本化しても総量は変わらないが、$M$ 倍の帯域幅にばらまかれることになる。信号帯域まで低域通過濾波してから間引いて戻せば、残るのはその $1/M$ だけである:
So oversampling does not only make the analog anti-aliasing filter easy (§6.6.4) — it also buys resolution outright: 64× gives $10\log_{10}64 \approx 18$ dB, three extra bits, for free. Sigma-delta converters go further still by shaping the noise so that even less of it lands in the signal band, which is how a 1-bit quantizer ends up delivering 16-bit audio.
所以過取樣不只是讓類比抗混疊濾波器好做(§6.6.4)而已——它還直接買到解析度:64 倍可得 $10\log_{10}64 \approx 18$ dB,等於白送三個位元。$\Sigma\Delta$ 轉換器更進一步,用雜訊整形讓落在訊號頻帶內的雜訊更少,這就是一個 1 位元量化器最後能交出 16 位元音質的原因。
つまりオーバーサンプリングはアナログのアンチエイリアシングフィルタを楽にする(§6.6.4)だけではない——分解能そのものを買ってもいる。64 倍なら $10\log_{10}64 \approx 18$ dB、すなわち 3 ビット分がただで手に入る。シグマデルタ変換器はさらに進んで、信号帯域に落ちる雑音がもっと少なくなるよう雑音を整形する。1 ビットの量子化器が最終的に 16 ビットの音質を出せるのはそのためである。
$\Delta^2/12$ follows from the uniform density, and the uniform density is an assumption. It is a good one when the signal is busy and spans many steps, so that successive errors are effectively scrambled. It fails for a signal that is small compared with $\Delta$, or slow and smooth, or exactly periodic in step with the quantizer: then the error is strongly correlated with the signal and appears as harmonic distortion — audible tones — rather than a flat noise floor. The classic cure is dither: add a small amount of noise before quantizing to decorrelate the error, trading a slightly higher noise floor for the removal of the tones.
$\Delta^2/12$ 是從均勻密度推出來的,而均勻密度是一個假設。當訊號夠活潑、跨越許多階距,使得前後的誤差實質上被打散時,這個假設很好用。但若訊號相對於 $\Delta$ 很小、或又慢又平滑、或剛好和量化器同步地週期變化,假設就會失效:此時誤差和訊號強烈相關,表現出來是諧波失真——聽得見的音調——而不是平坦的雜訊底。經典的解法是抖動(dither):在量化前刻意加入少量雜訊把誤差去相關,用稍微抬高的雜訊底換掉那些音調。
$\Delta^2/12$ は一様密度から導かれ、その一様密度は仮定である。信号が活発で多くのステップにまたがり、連続する誤差が事実上かき混ぜられるときには、よい仮定である。$\Delta$ に比べて小さい信号、ゆっくりしてなめらかな信号、あるいは量子化器とちょうど歩調の合った周期信号に対しては破綻する。そのとき誤差は信号と強く相関し、平坦な雑音フロアではなく高調波歪み——耳に聞こえる音——として現れる。古典的な対処法がディザである。量子化の前に少量の雑音を加えて誤差の相関を崩し、雑音フロアがわずかに上がるのと引き換えに、それらの音を消すのである。
The classic demonstration puts one signal through two very different quantizers and compares the errors. The input is a near-full-scale cosine, $x[n] = 0.99\cos(n/10)$ — amplitude 0.99 deliberately, period $20\pi \approx 63$ samples — quantized first with $B=3$ and then with $B=8$.
最經典的示範,是把同一個訊號送進兩個差很多的量化器,再比較它們的誤差。輸入是一個接近滿刻度的餘弦波 $x[n] = 0.99\cos(n/10)$——振幅刻意取 0.99,週期 $20\pi \approx 63$ 個樣本——先用 $B=3$ 量化,再用 $B=8$ 量化。
古典的な実演では、一つの信号をまったく性格の異なる二つの量子化器に通し、誤差を比べる。入力はフルスケールに近い余弦波 $x[n] = 0.99\cos(n/10)$——振幅はあえて 0.99、周期は $20\pi \approx 63$ 標本——であり、まず $B=3$ で、次に $B=8$ で量子化する。
(b) — the staircase. Three bits give $2^3 = 8$ levels. In two's complement the set is lopsided, running $-1$ to $0.75$ with the extra level on the negative side (§6.6.1), and $\Delta = 2/8 = 0.25$. Every sample is forced onto one of those eight dashed lines. Look at the positive peaks, $n \approx 0, 63, 126$: the input reaches $0.99$ but the highest level available is $0.75$, so the waveform is simply clipped flat.
(b) — 階梯。3 個位元給出 $2^3 = 8$ 個位階。用二補數表示時這組位階是不對稱的,從 $-1$ 到 $0.75$,多出來的那一階在負方向(§6.6.1),而 $\Delta = 2/8 = 0.25$。每個樣本都被強制落到這八條虛線之一。看正峰值處 $n \approx 0, 63, 126$:輸入到達 $0.99$,但最高的位階只有 $0.75$,所以波形直接被削平。
(b) — 階段。3 ビットは $2^3 = 8$ 個のレベルを与える。2 の補数ではこの集合は偏っていて、$-1$ から $0.75$ まで走り、余分な 1 レベルは負側にある(§6.6.1)。$\Delta = 2/8 = 0.25$ である。どの標本も八本の破線のいずれかに強制的に乗せられる。正のピーク $n \approx 0, 63, 126$ を見てほしい。入力は $0.99$ に達するが利用できる最高レベルは $0.75$ なので、波形はそのまま平らにクリップされる。
(c) — two things wrong at once. The error $e[n] = Q[x[n]] - x[n]$ is plotted against $\pm\Delta/2 = \pm 0.125$:
(c) — 同時出了兩個問題。誤差 $e[n] = Q[x[n]] - x[n]$ 與 $\pm\Delta/2 = \pm 0.125$ 一起畫出來:
(c) — 二つの不具合が同時に。誤差 $e[n] = Q[x[n]] - x[n]$ を $\pm\Delta/2 = \pm 0.125$ とともに描いてある:
(d) — the model working. Eight bits give $\Delta = 2/256 \approx 0.0078$, so $\Delta/2 \approx 0.0039$ — exactly the $\pm 3.9 \times 10^{-3}$ dashed lines. Every sample stays inside them, scattered across the range with no period and no pattern. The signal now crosses 256 levels rather than 8, which is the $|x| \gg 1$ LSB condition of §6.6.2 being comfortably met.
(d) — 模型成立的樣子。8 個位元給出 $\Delta = 2/256 \approx 0.0078$,所以 $\Delta/2 \approx 0.0039$——正好就是圖上 $\pm 3.9 \times 10^{-3}$ 的虛線。每個樣本都落在它們之內,散布在整個範圍裡,沒有週期也沒有規律。此時訊號跨過的是 256 個位階而不是 8 個,§6.6.2 要求的 $|x| \gg 1$ LSB 條件被輕鬆滿足。
(d) — モデルが働いている様子。8 ビットでは $\Delta = 2/256 \approx 0.0078$ なので $\Delta/2 \approx 0.0039$——これがちょうど $\pm 3.9 \times 10^{-3}$ の破線である。どの標本もその内側にとどまり、周期も模様もなくレンジ全体に散らばっている。信号はいまや 8 ではなく 256 のレベルを横切っており、§6.6.2 の $|x| \gg 1$ LSB という条件が余裕をもって満たされている。
| 3 bits — panel (c) | 8 bits — panel (d) | |
|---|---|---|
| $\Delta/2$ | $0.125$ | $\approx 0.0039$ |
| Error stays within $\pm\Delta/2$? | No — clips at the peaks | Yes |
| Correlation with the signal | strong, $\rho = -0.43$ | weak, $\rho = 0.15$ |
| Measured $\sigma_e^2$ vs $\Delta^2/12$ | $9.2\times10^{-3}$ vs $5.2\times10^{-3}$ — 76% high | $4.98\times10^{-6}$ vs $5.09\times10^{-6}$ — 2% low |
| Uniform white-noise model | does not apply | applies |
| 3 位元 — 圖 (c) | 8 位元 — 圖 (d) | |
|---|---|---|
| $\Delta/2$ | $0.125$ | $\approx 0.0039$ |
| 誤差是否落在 $\pm\Delta/2$ 內 | 否——峰值處削波 | 是 |
| 與訊號的相關性 | 強,$\rho = -0.43$ | 弱,$\rho = 0.15$ |
| 實測 $\sigma_e^2$ 對 $\Delta^2/12$ | $9.2\times10^{-3}$ 對 $5.2\times10^{-3}$——高出 76% | $4.98\times10^{-6}$ 對 $5.09\times10^{-6}$——低 2% |
| 均勻白雜訊模型 | 不適用 | 適用 |
| 3 ビット — パネル (c) | 8 ビット — パネル (d) | |
|---|---|---|
| $\Delta/2$ | $0.125$ | $\approx 0.0039$ |
| 誤差は $\pm\Delta/2$ の内側にとどまるか | いいえ——ピークでクリップする | はい |
| 信号との相関 | 強い、$\rho = -0.43$ | 弱い、$\rho = 0.15$ |
| 実測 $\sigma_e^2$ と $\Delta^2/12$ | $9.2\times10^{-3}$ 対 $5.2\times10^{-3}$——76% 高い | $4.98\times10^{-6}$ 対 $5.09\times10^{-6}$——2% 低い |
| 一様白色雑音モデル | 適用できない | 適用できる |
The right-hand panel is the power spectral density of the same error for $B = 3, 7, 11, 15$, and it turns the two observations above into one picture. Shape answers "is it white?" and height answers "how much of it is there?":
右邊那張是同一個誤差在 $B = 3, 7, 11, 15$ 時的功率譜密度,它把上面兩點觀察合成了一張圖。形狀回答「它白不白?」,高度回答「它有多大?」:
右のパネルは $B = 3, 7, 11, 15$ における同じ誤差の電力スペクトル密度であり、上の二つの観察を一枚の絵にまとめてくれる。形が「白いか?」に答え、高さが「どれだけあるか?」に答える:
Averaging each trace gives floors of $-26.1$, $-47.3$, $-71.0$ and $-95.1$ dB, so the steps are $21.2$, $23.7$ and $24.1$ dB against an ideal $4 \times 6.02 = 24.1$. The last step is exact and the middle one nearly so, but $3 \to 7$ falls 3 dB short. The reason is the amplitude 0.99: the largest level a $B$-bit quantizer offers is $1 - \Delta$, which is $0.75$ at $B=3$ and $0.984$ at $B=7$ — both below 0.99, so both clip. Overload error is far larger than $\Delta^2/12$, so those two floors sit above where the law would put them. At $B=11$ the top level is $0.999$, clipping stops, and the ideal 24 dB step reappears.
把每條曲線平均,得到的雜訊底是 $-26.1$、$-47.3$、$-71.0$、$-95.1$ dB,於是每一階的落差為 $21.2$、$23.7$、$24.1$ dB,而理想值是 $4 \times 6.02 = 24.1$。最後一階完全吻合,中間那階也幾乎吻合,但 $3 \to 7$ 少了 3 dB。原因就是振幅 0.99:$B$ 位元量化器能提供的最高位階是 $1 - \Delta$,在 $B=3$ 時是 $0.75$、$B=7$ 時是 $0.984$——兩者都低於 0.99,所以兩者都會削波。過載誤差遠大於 $\Delta^2/12$,因此這兩條雜訊底都高於定律該有的位置。到了 $B=11$,最高位階是 $0.999$,削波消失,理想的 24 dB 落差就回來了。
各軌跡を平均するとフロアは $-26.1$、$-47.3$、$-71.0$、$-95.1$ dB となり、段差は $21.2$、$23.7$、$24.1$ dB、理想値は $4 \times 6.02 = 24.1$ である。最後の段差はぴたりと合い、真ん中もほぼ合うが、$3 \to 7$ は 3 dB 足りない。原因は振幅 0.99 である。$B$ ビットの量子化器が提供できる最大レベルは $1 - \Delta$ であり、$B=3$ では $0.75$、$B=7$ では $0.984$——どちらも 0.99 より下なのでどちらもクリップする。過負荷誤差は $\Delta^2/12$ よりはるかに大きいので、この二つのフロアは法則が置くはずの位置より上にある。$B=11$ では最大レベルが $0.999$ となってクリッピングが止み、理想の 24 dB の段差が戻ってくる。
With signal power $P_{\text{avg}} = \sigma_x^2$ and noise power $\sigma_e^2 = \Delta^2/12$, substituting $\Delta = 2\,m_{\max}\,2^{-B}$ gives $\sigma_e^2 = \tfrac{1}{3}\,m_{\max}^2\,2^{-2B}$, so:
設訊號功率為 $P_{\text{avg}} = \sigma_x^2$、雜訊功率為 $\sigma_e^2 = \Delta^2/12$,代入 $\Delta = 2\,m_{\max}\,2^{-B}$ 得到 $\sigma_e^2 = \tfrac{1}{3}\,m_{\max}^2\,2^{-2B}$,因此:
信号電力 $P_{\text{avg}} = \sigma_x^2$、雑音電力 $\sigma_e^2 = \Delta^2/12$ とし、$\Delta = 2\,m_{\max}\,2^{-B}$ を代入すると $\sigma_e^2 = \tfrac{1}{3}\,m_{\max}^2\,2^{-2B}$ となるので:
Every added bit halves $\Delta$, quarters the noise power, and adds $20\log_{10}2 \approx 6.02$ dB of SNR. For a full-scale sinusoid $P_{\text{avg}} = m_{\max}^2/2$, giving the famous $\mathrm{SNR} = 6.02B + 1.76$ dB. The constants 1.76 and 1.17 quoted in audio specs come from this family of formulas; they are loose upper bounds for real signals.
每多一個位元,$\Delta$ 減半、雜訊功率變成四分之一,SNR 就增加 $20\log_{10}2 \approx 6.02$ dB。對滿刻度正弦訊號 $P_{\text{avg}} = m_{\max}^2/2$,得到著名的 $\mathrm{SNR} = 6.02B + 1.76$ dB。音響規格裡常見的 1.76 與 1.17 這兩個常數都出自同一族公式;對真實訊號而言,它們只是寬鬆的上界。
1 ビット増やすごとに $\Delta$ は半分、雑音電力は 4 分の 1 になり、SNR は $20\log_{10}2 \approx 6.02$ dB 増える。フルスケールの正弦波では $P_{\text{avg}} = m_{\max}^2/2$ なので、有名な $\mathrm{SNR} = 6.02B + 1.76$ dB が得られる。オーディオの仕様書に引かれる定数 1.76 や 1.17 はこの公式群から来ており、実際の信号に対してはゆるい上界にすぎない。
An audio CD targets SNR around 95–98 dB. How many bits of resolution are needed?
CD 音訊的目標訊雜比大約是 95–98 dB。需要多少位元的解析度?
オーディオ CD は 95〜98 dB 程度の SNR を目標とする。分解能は何ビット必要か。
Dynamic range of a linear system equals this SNR: the ratio in dB between the largest representable signal and the noise floor. Powers use $10\log_{10}(\cdot)$, amplitudes $20\log_{10}(\cdot)$, since $P \propto |A|^2$. A related implementation issue is coefficient quantization: filter coefficients stored with finite precision move the poles/zeros of $H(z)$ slightly, perturbing the realized frequency response — a preview of finite-wordlength effects (§6.6.6).
線性系統的動態範圍就等於這個 SNR:能表示的最大訊號與雜訊底之間的 dB 比值。功率用 $10\log_{10}(\cdot)$,振幅用 $20\log_{10}(\cdot)$,因為 $P \propto |A|^2$。另一個相關的實作問題是係數量化:濾波器係數以有限精度儲存,會讓 $H(z)$ 的零極點稍微移位,實際做出來的頻率響應也跟著偏掉——這是有限字長效應的前奏(§6.6.6)。
線形システムのダイナミックレンジはこの SNR に等しい。表現できる最大の信号と雑音フロアとの dB 比である。$P \propto |A|^2$ なので、電力には $10\log_{10}(\cdot)$、振幅には $20\log_{10}(\cdot)$ を使う。関連する実装上の問題が係数量子化である。有限精度で格納されたフィルタ係数は $H(z)$ の極・零点をわずかに動かし、実現される周波数応答を乱す——有限語長効果の予告編である(§6.6.6)。
Sections 6.3.3 and 6.6.3 meet here. The anti-aliasing filter of §6.3.3 has a passband and a stopband, and the passband is easy: $0$ dB from DC to 20 kHz, the edge of hearing. The stopband is the real design question — how many dB of attenuation is enough? A brick wall is impossible, so some out-of-band energy always survives the filter and folds into the baseband when the signal is sampled. The quantizer of §6.6 supplies the answer: stop when the residual aliasing has been pushed below the converter's own quantization noise.
§6.3.3 與 §6.6.3 在這裡交會。§6.3.3 的抗混疊濾波器有通帶與阻帶,通帶很好訂:從直流到人耳上限 20 kHz,增益 $0$ dB。真正的設計問題在阻帶——衰減要做到幾 dB 才夠?直角截止不可能存在,所以帶外總有一些能量穿過濾波器,取樣後折回基頻變成混疊。§6.6 的量化器給了答案:把殘留的混疊壓到比轉換器自身的量化雜訊還低,就可以停了。
§6.3.3 と §6.6.3 がここで出会う。§6.3.3 のアンチエイリアシングフィルタには通過域と阻止域があり、通過域のほうは易しい。直流から聴覚の上限である 20 kHz まで $0$ dB でよい。本当の設計課題は阻止域である——減衰は何 dB あれば十分なのか。矩形特性は不可能なので、帯域外のエネルギーは常にいくらかフィルタを生き延び、標本化のときにベースバンドへ折り返してくる。その答えを与えるのが §6.6 の量子化器である。残留した折り返しを変換器自身の量子化雑音より下に押し下げたら、そこでやめればよい。
For a $B$-bit converter, specify the anti-aliasing filter's stopband attenuation as $0$ dB (passband) minus the quantization noise power in dB — that is, the SQNR. For the CD's $B = 16$ bits that is $-98.08$ dB.
對 $B$ 位元的轉換器,抗混疊濾波器的阻帶衰減就訂成「$0$ dB(通帶)減去量化雜訊功率的 dB 值」,也就是 SQNR。CD 的 $B = 16$ 位元對應到 $-98.08$ dB。
$B$ ビットの変換器に対しては、アンチエイリアシングフィルタの阻止域減衰量を「$0$ dB(通過域)から量子化雑音電力の dB 値を引いたもの」、すなわち SQNR として指定する。CD の $B = 16$ ビットでは $-98.08$ dB となる。
The logic is symmetric, and both directions matter:
這個邏輯是對稱的,兩個方向都要想過:
この論法は対称であり、両方向とも重要である:
This is the general engineering pattern of error budgeting: drive every error source down to the level of the one you cannot remove, and then stop.
這是工程上常見的誤差預算思維:把每一項誤差壓到「那個你無論如何都消不掉的誤差」的水準,然後就停手。
これは誤差配分(エラーバジェット)という工学一般の型である。取り除けない誤差の水準まで各誤差源を下げ、そこで止める。
The number is the signal-to-quantization-noise ratio (SQNR) of a $B$-bit quantizer — the same $6.02B + 1.76$ bound derived in §6.6.3, re-assembled here in four steps so the chain from §6.6.1 to the filter specification is visible end to end:
這個數字就是 $B$ 位元量化器的訊號對量化雜訊比(SQNR)——和 §6.6.3 推出的 $6.02B + 1.76$ 是同一條界線;這裡用四個步驟重組一次,好讓「§6.6.1 的量化器 → 濾波器規格」這條鏈從頭到尾都看得見:
この数は $B$ ビット量子化器の信号対量子化雑音比(SQNR)である——§6.6.3 で導いた $6.02B + 1.76$ と同じ上界を、§6.6.1 からフィルタ仕様までの鎖が端から端まで見えるように、ここで四段階に組み直したものである:
| Quantity | Value | Where it comes from |
|---|---|---|
| Sampling rate $f_s$ | 44.1 kHz | CD format (§6.3.5) |
| Nyquist frequency $f_s/2$ | 22.05 kHz | half the sampling rate |
| Passband | 0 – 20 kHz at 0 dB | upper limit of human hearing |
| Stopband attenuation | $\ge 98.08$ dB | SQNR of the 16-bit quantizer |
| Stopband edge | 22.05 kHz or 24.1 kHz | strict or relaxed reading — see below |
| 項目 | 值 | 來源 |
|---|---|---|
| 取樣率 $f_s$ | 44.1 kHz | CD 規格(§6.3.5) |
| Nyquist 頻率 $f_s/2$ | 22.05 kHz | 取樣率的一半 |
| 通帶 | 0 – 20 kHz,增益 0 dB | 人耳聽覺上限 |
| 阻帶衰減 | $\ge 98.08$ dB | 16 位元量化器的 SQNR |
| 阻帶起點 | 22.05 kHz 或 24.1 kHz | 嚴格或放寬兩種看法——見下 |
| 量 | 値 | 出どころ |
|---|---|---|
| 標本化レート $f_s$ | 44.1 kHz | CD の規格(§6.3.5) |
| ナイキスト周波数 $f_s/2$ | 22.05 kHz | 標本化レートの半分 |
| 通過域 | 0 – 20 kHz で 0 dB | 人間の聴覚の上限 |
| 阻止域減衰量 | $\ge 98.08$ dB | 16 ビット量子化器の SQNR |
| 阻止域の始まり | 22.05 kHz または 24.1 kHz | 厳格な読みか緩い読みか——下記参照 |
Where the stopband starts admits two defensible answers, and they differ by more than 2 kHz of precious transition band:
阻帶從哪裡開始,有兩種都說得通的答案,而兩者差了 2 kHz 以上的寶貴過渡帶:
阻止域がどこから始まるかについては、どちらも擁護できる答えが二つあり、しかも両者は貴重な遷移帯域にして 2 kHz 以上も違う:
§6.3.5 noted that the 4.1 kHz between $2 \times 20$ kHz and 44.1 kHz is the filter's transition band. The relaxed reading above is exactly that statement, made quantitative: the format was chosen so that a realizable filter would have room to fall 98 dB.
§6.3.5 提過,$2 \times 20$ kHz 與 44.1 kHz 之間多出來的 4.1 kHz 就是留給濾波器的過渡帶。上面「放寬」的看法正是這句話的量化版本:這個格式之所以這樣訂,就是要讓一個做得出來的濾波器有空間掉完 98 dB。
§6.3.5 では、$2 \times 20$ kHz と 44.1 kHz のあいだの 4.1 kHz がまさにフィルタの遷移帯域だと述べた。上の緩い読みは、その一文を定量化したものにほかならない。実現可能なフィルタが 98 dB 落ちきる余地をもつように、この規格が選ばれたのである。
Falling from 0 dB to $-98$ dB inside a few kHz demands a very high order. With a 0.1 dB passband ripple allowance and the relaxed 24.1 kHz edge, a Butterworth needs order 71, a Chebyshev type I order 23, and even an elliptic filter order 12; take the strict 22.05 kHz edge and those become 135, 31 and 14. Such filters are built from a dozen or more cascaded analog stages, are hypersensitive to component tolerance and drift, and — the sharper the cutoff, the worse — have violently nonlinear phase near the band edge, smearing transients in exactly the top octave of the audio you were trying to protect.
要在幾 kHz 之內從 0 dB 掉到 $-98$ dB,需要非常高的階數。若允許 0.1 dB 的通帶漣波、用放寬的 24.1 kHz 起點,Butterworth 要 71 階、Chebyshev I 型要 23 階,連橢圓濾波器都要 12 階;換成嚴格的 22.05 kHz 起點,則分別變成 135、31、14 階。這種濾波器要用十幾級以上的類比電路串接,對元件公差與漂移極度敏感,而且截止越陡就越糟——band edge 附近的相位嚴重非線性,會把暫態抹開,而抹到的正好是你想保護的音訊最高那個八度。
数 kHz のあいだに 0 dB から $-98$ dB まで落ちるには、非常に高い次数が要る。通過域リプルを 0.1 dB まで許し、緩い 24.1 kHz の端をとっても、バターワースは71 次、チェビシェフ I 型は23 次、楕円フィルタでさえ12 次を要する。厳格な 22.05 kHz の端をとれば、それぞれ 135、31、14 次になる。こうしたフィルタは十段以上のアナログ段を縦続して作られ、部品公差とドリフトに極度に敏感で、しかも——遮断が急峻なほど悪くなるのだが——帯域端の近くで位相が激しく非線形になり、まさに守ろうとしていた音声の最上オクターブで過渡応答をにじませてしまう。
Modern converters sidestep the whole problem by sampling far faster than 44.1 kHz — 64× is typical in sigma-delta audio ADCs. The Nyquist frequency moves to 1.41 MHz, so the analog anti-aliasing filter now needs to reach $-98$ dB somewhere beyond 2.80 MHz instead of 24.1 kHz. That is over seven octaves of transition band, and the order collapses:
現代的轉換器繞過整個問題的方法,是用遠高於 44.1 kHz 的頻率取樣——$\Sigma\Delta$ 音訊 ADC 常用 64 倍。Nyquist 頻率移到 1.41 MHz,於是類比抗混疊濾波器只要在 2.80 MHz 之後掉到 $-98$ dB 就好,而不是 24.1 kHz。這等於有七個八度以上的過渡帶,階數隨之崩塌:
現代の変換器は 44.1 kHz よりはるかに速く標本化することで、この問題をまるごと回避する——シグマデルタ音声 ADC では 64 倍が典型である。ナイキスト周波数は 1.41 MHz へ移るので、アナログのアンチエイリアシングフィルタは 24.1 kHz ではなく 2.80 MHz より先のどこかで $-98$ dB に達すればよくなる。これは 7 オクターブ以上の遷移帯域であり、次数は一気に崩れ落ちる:
| Oversampling factor | $f_s$ | Stopband edge $f_s - 20$ kHz | Butterworth order | Elliptic order |
|---|---|---|---|---|
| 1× (direct) | 44.1 kHz | 24.1 kHz | 71 | 12 |
| 2× | 88.2 kHz | 68.2 kHz | 11 | 6 |
| 4× | 176.4 kHz | 156.4 kHz | 7 | 5 |
| 8× | 352.8 kHz | 332.8 kHz | 5 | 4 |
| 64× | 2.822 MHz | 2.802 MHz | 3 | 3 |
| 過取樣倍率 | $f_s$ | 阻帶起點 $f_s - 20$ kHz | Butterworth 階數 | 橢圓濾波器階數 |
|---|---|---|---|---|
| 1×(直接取樣) | 44.1 kHz | 24.1 kHz | 71 | 12 |
| 2× | 88.2 kHz | 68.2 kHz | 11 | 6 |
| 4× | 176.4 kHz | 156.4 kHz | 7 | 5 |
| 8× | 352.8 kHz | 332.8 kHz | 5 | 4 |
| 64× | 2.822 MHz | 2.802 MHz | 3 | 3 |
| オーバーサンプリング倍率 | $f_s$ | 阻止域の端 $f_s - 20$ kHz | バターワースの次数 | 楕円フィルタの次数 |
|---|---|---|---|---|
| 1×(直接) | 44.1 kHz | 24.1 kHz | 71 | 12 |
| 2× | 88.2 kHz | 68.2 kHz | 11 | 6 |
| 4× | 176.4 kHz | 156.4 kHz | 7 | 5 |
| 8× | 352.8 kHz | 332.8 kHz | 5 | 4 |
| 64× | 2.822 MHz | 2.802 MHz | 3 | 3 |
(Orders computed for a 0.1 dB passband ripple and 98.08 dB stopband attenuation, the same spec throughout.) A 3rd-order analog filter is a handful of passive components — cheap, stable, and with mild phase behaviour across the audio band.
(階數都是以 0.1 dB 通帶漣波、98.08 dB 阻帶衰減這同一組規格算出來的。)3 階類比濾波器不過是幾個被動元件——便宜、穩定,而且在整個音訊頻帶內相位都很溫和。
(次数はいずれも通過域リプル 0.1 dB、阻止域減衰 98.08 dB という同一の仕様で計算した。)3 次のアナログフィルタは受動部品が数個あれば済む——安価で安定しており、音声帯域全体にわたって位相のふるまいも穏やかである。
The sharp 20 kHz cutoff still has to happen — it just moves into the digital domain, where a high-order FIR filter running at 2.82 MHz does it with exact coefficients, no drift, and (being linear-phase) no phase distortion at all. The output is then decimated back down to 44.1 kHz, which is legal precisely because the digital filter has already removed everything above 20 kHz. That decimation stage is the downsampling chain sketched in §6.3.5 and is developed properly in Chapter 7.
陡峭的 20 kHz 截止還是得做——只是搬到數位域去:一個跑在 2.82 MHz 的高階 FIR 濾波器用精確的係數完成它,不會漂移,而且(因為是線性相位)完全沒有相位失真。接著再把輸出降取樣回 44.1 kHz,而這一步之所以合法,正是因為數位濾波器已經把 20 kHz 以上的東西都清乾淨了。這個降取樣階段就是 §6.3.5 勾勒的流程,第 7 章會完整展開。
急峻な 20 kHz の遮断は依然として行わなければならない——ただしそれがディジタル領域へ移るだけである。2.82 MHz で動く高次の FIR フィルタが、正確な係数で、ドリフトなしに、しかも(直線位相なので)位相歪みをまったく生じずにそれを行う。その出力はその後 44.1 kHz へ間引かれる。これが許されるのは、ディジタルフィルタが 20 kHz より上をすでに取り除いているからにほかならない。この間引き段が §6.3.5 で素描したダウンサンプリングの流れであり、第 7 章できちんと展開する。
Steepness costs an analog designer components, tolerance budget and phase linearity; it costs a digital designer only taps, i.e. arithmetic. Oversampling converts an impossible analog problem into an easy analog problem plus a routine digital one. This trade — spend sample rate to buy filter simplicity — is one of the most reused ideas in DSP, and sigma-delta conversion is its extreme: a 1-bit quantizer running at hundreds of times the Nyquist rate, with the resolution recovered entirely by digital filtering.
「陡」這件事,對類比設計者的代價是元件數、公差預算與相位線性度;對數位設計者的代價只是抽頭數,也就是算術運算。過取樣把一個做不到的類比問題,換成一個很好做的類比問題加上一個例行的數位問題。這個取捨——用取樣率去買濾波器的簡單——是 DSP 裡最常被重複使用的想法之一,而 $\Sigma\Delta$ 轉換是它的極端:用一個跑在 Nyquist 速率數百倍的 1 位元量化器,解析度全部靠數位濾波救回來。
急峻さはアナログ設計者には部品・公差予算・位相直線性を代価として求めるが、ディジタル設計者にはタップ数、すなわち算術演算しか求めない。オーバーサンプリングは不可能なアナログ問題を、易しいアナログ問題と型どおりのディジタル問題に変換する。この取引——標本化レートを払ってフィルタの単純さを買う——は DSP で最も再利用されている発想の一つであり、シグマデルタ変換はその極端な形である。ナイキストレートの数百倍で動く 1 ビット量子化器を使い、分解能はまるごとディジタル濾波で取り戻す。
Worked Example 6-2 quoted the TLV320AIC23B codec as having "$\approx 14.6$ effective bits", and a fractional bit ought to look suspicious — no converter emits 0.6 of a bit. The number is an effective number of bits (ENOB), and it is not the width of the output word at all. It is the ideal-quantizer resolution back-solved from a measured SNR, which is why it comes out fractional.
範例 6-2 提到 TLV320AIC23B 編解碼器有「約 $14.6$ 個有效位元」,而「0.6 個位元」這種說法本來就該讓人起疑——沒有任何轉換器會輸出 0.6 個位元。這個數字是有效位元數(ENOB),它根本不是輸出字組的寬度,而是從量測到的 SNR 反推回去的理想量化器解析度,所以自然會是小數。
例題 6-2 では TLV320AIC23B コーデックが「$\approx 14.6$ 有効ビット」をもつと述べたが、ビットに端数があるのは怪しく見えるはずだ——0.6 ビットを出力する変換器など存在しない。この数は有効ビット数(ENOB)であり、出力語の幅ではまったくない。測定された SNR から逆算された理想量子化器の分解能であり、だからこそ小数になる。
Take the ideal-quantizer bound of §6.6.3 and solve it for $B$ instead of evaluating it:
把 §6.6.3 理想量化器的那條界線反過來解 $B$,而不是拿來求值:
§6.6.3 の理想量子化器の上界を、値を求めるのではなく $B$ について解いてみよう:
SNR is a continuous measured quantity, so the $B$ that falls out of it is continuous too. The question ENOB answers is:
SNR 是連續的量測值,所以反推出來的 $B$ 自然也是連續的。ENOB 回答的問題是:
SNR は連続量の測定値なので、そこから出てくる $B$ も連続である。ENOB が答える問いはこうだ:
This real converter performs like an ideal converter of how many bits? A physical chip always emits an integer word — the TLV320AIC23B can be configured for 16, 20, 24 or 32 bits — but thermal noise, clock jitter and circuit nonlinearity mean the lowest few bits carry no signal information at all. They are noise wearing the costume of resolution. An ADC measuring 90 dB SNR has a noise floor matching that of an ideal 14.66-bit quantizer; configure it to output 24 bits and roughly the bottom 9 are buried.
這顆真實的轉換器,表現得像一個幾位元的理想轉換器?實體晶片輸出的一定是整數字長——TLV320AIC23B 可以設定成 16、20、24 或 32 位元——但熱雜訊、時脈抖動與電路非線性,使得最低的那幾個位元根本不帶任何訊號資訊。它們只是披著「解析度」外衣的雜訊。一顆量到 90 dB SNR 的 ADC,其雜訊底相當於理想的 14.66 位元量化器;就算把它設定成輸出 24 位元,最低的約 9 個位元仍然是被埋掉的。
この実際の変換器は、何ビットの理想変換器のようにふるまうか。物理的なチップは必ず整数の語を出力する——TLV320AIC23B は 16、20、24、32 ビットに設定できる——が、熱雑音、クロックジッタ、回路の非線形性により、下位の数ビットは信号情報をまったく担わない。分解能の衣をまとった雑音である。90 dB の SNR を示す ADC の雑音フロアは理想的な 14.66 ビット量子化器のそれに等しく、24 ビット出力に設定しても下位のおよそ 9 ビットは埋もれている。
Every figure on the slide comes from the same division. THD (total harmonic distortion) is converted by the identical formula, where it reads as "this much distortion is equivalent to the quantization error of an ideal converter of so many bits":
投影片上的每一個數字都出自同一個除法。THD(總諧波失真)也用完全一樣的公式換算,讀法是「這麼大的失真,相當於幾位元理想轉換器的量化誤差」:
スライド上のどの数字も同じ割り算から出ている。THD(全高調波歪み)も同一の公式で換算され、「これだけの歪みは、何ビットの理想変換器の量子化誤差に相当するか」と読む:
| Item | dB | $(\mathrm{dB} - 1.76)/6.02$ | On the slide |
|---|---|---|---|
| CD signal SNR | 95 | 15.49 | 15.5 → so $B = 16$ |
| ADC SNR | 90 | 14.66 | 14.6 bits |
| ADC THD | 80 | 13.00 | 13 bits |
| DAC SNR | 100 | 16.32 | 16 bits |
| DAC THD | 88 | 14.33 | 14.3 bits |
| 項目 | dB | $(\mathrm{dB} - 1.76)/6.02$ | 投影片 |
|---|---|---|---|
| CD 訊號 SNR | 95 | 15.49 | 15.5 → 所以 $B = 16$ |
| ADC SNR | 90 | 14.66 | 14.6 bits |
| ADC THD | 80 | 13.00 | 13 bits |
| DAC SNR | 100 | 16.32 | 16 bits |
| DAC THD | 88 | 14.33 | 14.3 bits |
| 項目 | dB | $(\mathrm{dB} - 1.76)/6.02$ | スライドの表記 |
|---|---|---|---|
| CD 信号の SNR | 95 | 15.49 | 15.5 → ゆえに $B = 16$ |
| ADC の SNR | 90 | 14.66 | 14.6 ビット |
| ADC の THD | 80 | 13.00 | 13 ビット |
| DAC の SNR | 100 | 16.32 | 16 ビット |
| DAC の THD | 88 | 14.33 | 14.3 ビット |
Since one bit is worth about 6 dB, the fraction is simply a gap smaller than 6 dB:
因為 1 個位元約當 6 dB,小數部分不過就是「不到 6 dB 的差距」:
1 ビットが約 6 dB に相当するので、小数部分は 6 dB に満たない差にすぎない:
So "14.6 bits" means: about $0.6 \times 6.02 = 3.6$ dB better than an ideal 14-bit converter, but not good enough to reach 15. Read the other way, buying one more genuine bit of performance means finding another 6 dB — which in a real design is a matter of layout, supply noise, reference stability and jitter, not of widening the output word.
所以「14.6 位元」的意思是:比理想的 14 位元轉換器好約 $0.6 \times 6.02 = 3.6$ dB,但還不足以達到 15 位元。反過來讀,要真正多買到 1 個位元的性能,就得再找出 6 dB——在真實設計中,那是佈線、電源雜訊、參考電壓穩定度與抖動的問題,而不是把輸出字長加寬就能解決的。
つまり「14.6 ビット」とは、理想的な 14 ビット変換器よりおよそ $0.6 \times 6.02 = 3.6$ dB よいが、15 ビットに届くほどではない、という意味である。逆から読めば、本物の 1 ビット分の性能を買うにはさらに 6 dB を見つけ出さねばならず、実際の設計ではそれは基板レイアウト、電源雑音、基準電圧の安定度、ジッタの問題であって、出力語を広げる話ではない。
The table above converts SNR and THD separately, which is what makes the bottleneck visible. The standard datasheet ENOB, however, is defined from SINAD — signal to noise and distortion — which adds the two error powers before converting. For this codec that gives $\mathrm{SINAD}_{\text{ADC}} = 79.6$ dB → 12.93 bits and $\mathrm{SINAD}_{\text{DAC}} = 87.7$ dB → 14.28 bits. Notice how little the combination changes the answer: the worse of the two terms dominates almost completely, which is exactly why the separate reading is a fair shortcut here.
上表是把 SNR 與 THD 分開換算,這樣才看得出瓶頸在哪。不過規格書上標準的 ENOB 是由 SINAD(訊號對雜訊與失真比)定義的,也就是先把兩種誤差功率相加再換算。對這顆編解碼器而言,$\mathrm{SINAD}_{\text{ADC}} = 79.6$ dB → 12.93 位元,$\mathrm{SINAD}_{\text{DAC}} = 87.7$ dB → 14.28 位元。注意合併後答案幾乎沒變:兩項之中較差的那一項幾乎完全主導了結果——這也正是為什麼在這裡分開來看是個公平的捷徑。
上の表は SNR と THD を別々に換算しており、だからこそボトルネックが見えるようになっている。しかしデータシート標準の ENOB は SINAD——信号対雑音および歪み比——から定義され、二つの誤差電力を足してから換算する。このコーデックでは $\mathrm{SINAD}_{\text{ADC}} = 79.6$ dB → 12.93 ビット、$\mathrm{SINAD}_{\text{DAC}} = 87.7$ dB → 14.28 ビットとなる。合算しても答えがほとんど変わらないことに注目してほしい。二つのうち悪いほうがほぼ完全に支配しており、だからこそここで別々に読むのは公正な近道なのである。
Now the design question the slide is really asking. Record through this board and play back, and the signal passes through every stage in turn; the effective resolution of the whole path is set by whichever stage is worst:
現在才是投影片真正要問的設計問題。用這塊板子錄音再播放,訊號會依序通過每一級;整條路徑的有效解析度,由其中最差的那一級決定:
ここからがスライドの本当に問うている設計上の問いである。この基板で録音して再生すれば、信号は各段を順に通過し、経路全体の実効分解能は最も悪い段で決まる:
| Stage | SNR bits | THD bits | Worse of the two |
|---|---|---|---|
| CD signal itself | 15.49 | — | 15.49 |
| ADC | 14.66 | 13.00 | 13.00 ← bottleneck |
| DAC | 16.32 | 14.33 | 14.33 |
| 階段 | SNR 位元 | THD 位元 | 兩者中較差者 |
|---|---|---|---|
| CD 訊號本身 | 15.49 | — | 15.49 |
| ADC | 14.66 | 13.00 | 13.00 ← 瓶頸 |
| DAC | 16.32 | 14.33 | 14.33 |
| 段 | SNR によるビット | THD によるビット | 二つのうち悪いほう |
|---|---|---|---|
| CD 信号そのもの | 15.49 | — | 15.49 |
| ADC | 14.66 | 13.00 | 13.00 ← ボトルネック |
| DAC | 16.32 | 14.33 | 14.33 |
The ADC's THD of 13 bits is the worst number anywhere in the chain, so recording and playing back through this board preserves roughly 13 effective bits — despite the source being 16-bit and the DAC being capable of more. Looking at noise alone and ignoring distortion, the bottleneck is instead the ADC's 14.6 bits.
ADC 的 THD 只有 13 位元,是整條鏈中最差的數字,所以用這塊板子錄音再播放,大約只能保有 13 個有效位元——儘管來源是 16 位元、DAC 的能力也更好。若只看雜訊而不看失真,瓶頸則換成 ADC 的 14.6 位元。
ADC の THD の 13 ビットが鎖全体で最も悪い数字なので、この基板で録音して再生すればおよそ 13 有効ビットしか保たれない——音源が 16 ビットで、DAC にはもっと余力があるにもかかわらず、である。歪みを無視して雑音だけを見るなら、ボトルネックは代わりに ADC の 14.6 ビットになる。
Two consequences follow. First, paying for a 24-bit part buys nothing if the analog front end in front of it delivers 13 effective bits — the extra bits digitize your own noise at higher precision. Second, distortion and noise are not interchangeable: 13 bits of THD sounds worse than 13 bits of white noise, because harmonic distortion is correlated with the signal and the ear locates it as tonal colouration rather than hiss. That is the same distinction drawn in §6.6.2 between an alias or a correlated error and a flat noise floor.
這帶來兩個推論。第一,如果前面的類比前端只能提供 13 個有效位元,那花錢買 24 位元的晶片毫無意義——多出來的位元只是把你自己的雜訊用更高的精度記錄下來。第二,失真與雜訊並不能互相換算:13 位元的 THD 聽起來會比 13 位元的白雜訊更糟,因為諧波失真和訊號相關,人耳會把它定位成音色的染色,而不是嘶聲。這正是 §6.6.2 區分「混疊或相關誤差」與「平坦雜訊底」時談的同一件事。
帰結は二つある。第一に、前段のアナログフロントエンドが 13 有効ビットしか届けないなら、24 ビットの部品に金を払っても何も買えない——余分なビットは自分の雑音をより高精度にディジタル化するだけである。第二に、歪みと雑音は交換可能ではない。THD 由来の 13 ビットは白色雑音由来の 13 ビットより悪く聞こえる。高調波歪みは信号と相関しており、耳はそれをヒスではなく音色の色づきとして聞き分けるからである。これは §6.6.2 で折り返しや相関のある誤差と平坦な雑音フロアとを区別したのと同じ論点である。
Everything so far quantized the signal. A second, completely separate wordlength problem quantizes the system: the coefficients of $H(z)$ must also be stored in finite precision. §6.6.3 mentioned it in passing; here is what it actually does.
到目前為止量化的都是訊號。還有第二個完全獨立的字長問題,量化的是系統本身:$H(z)$ 的係數同樣必須以有限精度儲存。§6.6.3 只順帶提過一句,這裡看它到底造成什麼。
ここまではすべて信号を量子化してきた。もう一つ、まったく別の語長の問題がシステムを量子化する。$H(z)$ の係数もまた有限精度で格納しなければならないのである。§6.6.3 はそれをついでに触れただけだった。ここではそれが実際に何をするのかを見る。
"A high-Q pole becomes unstable" does not mean somebody designed an unstable filter. Nobody does that. It means a pole that was designed safely inside the unit circle is pushed onto or past the circle by the rounding of its coefficients. The design is correct; the implementation destroys it.
「高 Q 極點變得不穩定」不是說有人設計了一個不穩定的濾波器。沒有人會那樣做。它的意思是:一個原本被設計在單位圓內、且留有餘裕的極點,因為係數被四捨五入而被推到單位圓上或圓外。設計是對的,是實作把它毀了。
「高 Q の極点が不安定になる」とは、誰かが不安定なフィルタを設計したという意味ではない。そんなことをする者はいない。単位円の十分内側に安全に設計された極点が、係数の丸めによって円上あるいは円の外へ押し出されるという意味である。設計は正しく、それを壊すのは実装である。
How to read it. The grey dots are not a drawing aid — they are the complete list of places a pole can exist in that implementation. Finite coefficient wordlength means finitely many coefficient values, hence finitely many pole positions. Your designed pole is almost never one of them, so it snaps to the nearest grid point. In panel (a) the nearest grid point happens to lie on the unit circle.
怎麼看這張圖。那些灰點不是輔助線——它們是該實作中極點可能存在的全部位置。係數字長有限,代表係數只有有限多個值,因此極點也只有有限多個可能位置。你設計出來的極點幾乎不會剛好是其中之一,於是它會被吸附到最近的格點。在 (a) 圖中,最近的格點正好落在單位圓上。
読み方。灰色の点は作図の補助ではない——その実装において極点が存在しうる場所の完全な一覧である。係数の語長が有限であれば係数値は有限個しかなく、したがって極点の位置も有限個しかない。設計した極点がその一つに一致することはまずないので、最も近い格子点へ吸い寄せられる。パネル (a) では、最も近い格子点がたまたま単位円の上にある。
The Q factor(品質因數)measures how sharp a resonance is, and it is set by how close the pole sits to the unit circle. Continuing the pole-zero reasoning of Chapter 5: $|H(e^{j\omega})|$ grows as the point $e^{j\omega}$ on the circle approaches a pole, so a pole at radius $r$ produces a peak whose 3 dB width is roughly
Q 值(品質因數)描述共振有多尖銳,而它由極點離單位圓多近決定。延續第 5 章的零極點推理:當單位圓上的點 $e^{j\omega}$ 越靠近某個極點,$|H(e^{j\omega})|$ 就越大,所以半徑為 $r$ 的極點會產生一個峰,其 3 dB 頻寬大約是
Q 値(品質係数)は共振の鋭さを測る量であり、極点が単位円にどれだけ近いかで決まる。第 5 章の極・零点の議論を続ければ、円上の点 $e^{j\omega}$ が極点に近づくほど $|H(e^{j\omega})|$ は大きくなるので、半径 $r$ の極点が作るピークの 3 dB 幅はおよそ次のようになる
At $r = 0.999$ that is a bandwidth of $0.002$ rad/sample — extraordinarily narrow. Filters like this are ordinary, not exotic:
當 $r = 0.999$ 時頻寬只有 $0.002$ rad/sample——窄得驚人。這種濾波器很常見,一點也不稀奇:
$r = 0.999$ では帯域幅は $0.002$ rad/sample——とてつもなく狭い。こうしたフィルタは特殊なものではなく、ごく普通に使われる:
So a pole near the circle is a requirement, not a mistake. The trouble is that it leaves almost no margin to the stability boundary — a small shove sends it over.
所以靠近單位圓的極點是設計需求,不是錯誤。問題在於它離穩定邊界幾乎沒有餘裕——輕輕一推就越界了。
つまり円の近くの極点は要求仕様であって誤りではない。やっかいなのは、それが安定限界に対してほとんど余裕を残さないことだ——少し押されただけで越えてしまう。
The key point is that you do not store the pole — you store the coefficients. A second-order section with poles at $re^{\pm j\theta}$ has denominator
關鍵在於:你存的不是極點,而是係數。極點在 $re^{\pm j\theta}$ 的二階節,其分母為
肝心なのは、格納されるのは極点ではなく係数であるという点である。$re^{\pm j\theta}$ に極点をもつ 2 次セクションの分母は次のようになる
What goes into memory is $a_1$ and $a_2$, not $r$ and $\theta$. Quantization rounds those two numbers, and the poles are whatever the rounded polynomial happens to have.
進到記憶體裡的是 $a_1$ 與 $a_2$,不是 $r$ 與 $\theta$。量化四捨五入的是這兩個數,而極點則變成「四捨五入後的那個多項式」所擁有的極點。
メモリに入るのは $a_1$ と $a_2$ であって $r$ と $\theta$ ではない。量子化はこの二つの数を丸め、極点は丸められた多項式がたまたまもつ根になる。
Keep these apart. Signal quantization (§6.6.2) injects an error that changes sample by sample; modelled as additive noise, it raises the noise floor but leaves the system alone. Coefficient quantization is a one-off, deterministic, permanent change to $H(z)$ itself: it does not add noise, it builds a different filter — shifted band edges, degraded stopband, and in the worst case a pole outside the unit circle. There is no statistical model for it and no dither that helps; it is checked, not averaged. Chapters 12 and 13 develop the structures that keep it under control.
這兩件事要分開。訊號量化(§6.6.2)注入的是逐樣本變化的誤差;把它模型化成加性雜訊,它抬高雜訊底,但不動系統本身。係數量化則是對 $H(z)$ 本身一次性的、確定性的、永久的改變:它不是加入雜訊,而是做出了一個不同的濾波器——頻帶邊界位移、阻帶變差,最糟的情況是極點跑到單位圓外。它沒有統計模型,也沒有任何抖動技巧能救;它只能被檢查,不能被平均掉。第 12、13 章會發展出控制它的各種結構。
この二つは区別しておくこと。信号の量子化(§6.6.2)は標本ごとに変化する誤差を注入する。加法性雑音としてモデル化され、雑音フロアを押し上げるがシステム自体には手を触れない。係数の量子化は $H(z)$ そのものに対する一回限りの、決定論的で永続的な変更である。雑音を加えるのではなく別のフィルタを作ってしまう——帯域端がずれ、阻止域が劣化し、最悪の場合は極点が単位円の外に出る。これには統計モデルもなければ効くディザもない。平均で片づく話ではなく、検査すべき事柄である。第 12 章と第 13 章では、これを抑え込む構造を展開する。
All problems of Homework 6 with full worked solutions. Exercise 1 is the analytical problem; Exercises 2–3 are the MATLAB simulation parts (a)–(d) and (e)–(f).
作業 6 的全部題目,附完整解答。習題 1 是分析題;習題 2–3 是 MATLAB 模擬的 (a)–(d) 與 (e)–(f) 小題。
宿題 6 の全問題と完全な解答。演習 1 は解析問題、演習 2〜3 は MATLAB シミュレーションの (a)〜(d) と (e)〜(f) にあたる。
Problem: The system of Fig. 6-5, preceded by a CT anti-aliasing filter, processes the input $g_c(t) = f_c(t) + e_c(t)$: $g_c(t) \to H_{aa}(j\Omega) \to \text{C/D} \to H(e^{j\omega}) \to \text{D/C} \to y_c(t)$, with both converters running at period $T$.
題目:在圖 6-5 的系統前面再加一個類比抗混疊濾波器,用來處理輸入 $g_c(t) = f_c(t) + e_c(t)$:$g_c(t) \to H_{aa}(j\Omega) \to \text{C/D} \to H(e^{j\omega}) \to \text{D/C} \to y_c(t)$,兩個轉換器的週期都是 $T$。
問題:図 6-5 のシステムの前段に連続時間のアンチエイリアシングフィルタを置き、入力 $g_c(t) = f_c(t) + e_c(t)$ を処理する:$g_c(t) \to H_{aa}(j\Omega) \to \text{C/D} \to H(e^{j\omega}) \to \text{D/C} \to y_c(t)$。両方の変換器は周期 $T$ で動作する。
(a) If the sampling rate is $2\pi/T = 1600\pi$, find $H(e^{j\omega})$ such that $y_c(t) = f_c(t)$.
(b) Is $y_c(t) = f_c(t)$ still possible with $2\pi/T < 1600\pi$? If so, find the minimum $2\pi/T$ and the corresponding $H(e^{j\omega})$.
(a) 若取樣率為 $2\pi/T = 1600\pi$,求能使 $y_c(t) = f_c(t)$ 的 $H(e^{j\omega})$。
(b) 當 $2\pi/T < 1600\pi$ 時,$y_c(t) = f_c(t)$ 還有可能成立嗎?若可以,求最小的 $2\pi/T$ 以及對應的 $H(e^{j\omega})$。
(a) 標本化レートが $2\pi/T = 1600\pi$ のとき、$y_c(t) = f_c(t)$ となる $H(e^{j\omega})$ を求めよ。
(b) $2\pi/T < 1600\pi$ でも $y_c(t) = f_c(t)$ は可能か。可能なら、最小の $2\pi/T$ とそれに対応する $H(e^{j\omega})$ を求めよ。
Setup — what reaches the C/D converter. The filter output is $x_c(t)$ with spectrum $X_c(j\Omega) = H_{aa}(j\Omega)\,[F_c(j\Omega) + E_c(j\Omega)]$:
先看進到 C/D 的是什麼。濾波器的輸出為 $x_c(t)$,其頻譜為 $X_c(j\Omega) = H_{aa}(j\Omega)\,[F_c(j\Omega) + E_c(j\Omega)]$:
準備 — C/D 変換器に届くもの。フィルタの出力は $x_c(t)$ であり、そのスペクトルは $X_c(j\Omega) = H_{aa}(j\Omega)\,[F_c(j\Omega) + E_c(j\Omega)]$ である:
The DT system must therefore do two jobs: (i) reject everything outside the $f_c$ band, and (ii) equalize the phase $e^{-j\Omega^3}$ inside it.
所以數位系統要做兩件事:(i) 把 $f_c$ 頻帶以外的東西全部濾掉;(ii) 在頻帶之內把相位 $e^{-j\Omega^3}$ 等化回來。
したがって離散時間システムは二つの仕事をしなければならない。(i) $f_c$ の帯域の外側をすべて除去すること、(ii) その帯域の内側で位相 $e^{-j\Omega^3}$ を等化することである。
(a) Sampling at $\Omega_s = 2\pi/T = 1600\pi$ (so $T = 1/800$). Since $x_c$ is bandlimited to $800\pi = \Omega_s/2$, there is no aliasing. In the DT domain, with $\omega = \Omega T$:
(a) 以 $\Omega_s = 2\pi/T = 1600\pi$ 取樣(也就是 $T = 1/800$)。因為 $x_c$ 已帶限在 $800\pi = \Omega_s/2$ 以內,所以不會發生混疊。在離散時間域中,代入 $\omega = \Omega T$:
(a) $\Omega_s = 2\pi/T = 1600\pi$ で標本化する場合(すなわち $T = 1/800$)。$x_c$ は $800\pi = \Omega_s/2$ に帯域制限されているので折り返しは起きない。離散時間領域では $\omega = \Omega T$ を用いて:
On the $f_c$ band the baseband spectrum is $X(e^{j\omega}) = \frac{1}{T} F_c(j\omega/T)\,e^{-j(\omega/T)^3}$. The D/C contributes gain $T$ and cuts at $\pi/T$, so to get $Y_c(j\Omega) = F_c(j\Omega)$ we need $H$ to cancel the phase and act as an ideal lowpass with cutoff $\pi/2$:
在 $f_c$ 頻帶上,基頻頻譜為 $X(e^{j\omega}) = \frac{1}{T} F_c(j\omega/T)\,e^{-j(\omega/T)^3}$。D/C 提供增益 $T$ 並在 $\pi/T$ 截止,所以若要得到 $Y_c(j\Omega) = F_c(j\Omega)$,$H$ 必須把相位抵消掉,同時當作一個截止頻率 $\pi/2$ 的理想低通:
$f_c$ の帯域ではベースバンドのスペクトルは $X(e^{j\omega}) = \frac{1}{T} F_c(j\omega/T)\,e^{-j(\omega/T)^3}$ である。D/C は利得 $T$ を与えて $\pi/T$ で遮断するので、$Y_c(j\Omega) = F_c(j\Omega)$ を得るには、$H$ が位相を打ち消し、かつ遮断周波数 $\pi/2$ の理想低域通過フィルタとしてふるまう必要がある:
(The exponent $({\omega/T})^3 = \omega^3/T^3 = 5.12\times 10^8\,\omega^3$.)
(其中指數 $({\omega/T})^3 = \omega^3/T^3 = 5.12\times 10^8\,\omega^3$。)
(指数は $({\omega/T})^3 = \omega^3/T^3 = 5.12\times 10^8\,\omega^3$ である。)
(b) Can we sample slower? Yes. The key observation: aliasing of the noise residue band is harmless as long as the folded copies do not land on top of the $f_c$ band $|\Omega| \le 400\pi$ — whatever lands in $400\pi < |\Omega|$ can still be removed by the DT lowpass.
(b) 可以取樣慢一點嗎?可以。關鍵在於:殘留雜訊那一段就算混疊也無妨,只要折返的複本不要疊到 $f_c$ 頻帶 $|\Omega| \le 400\pi$ 上——凡是落在 $400\pi < |\Omega|$ 的東西,都還能被數位低通濾掉。
(b) もっと遅く標本化できるか。できる。鍵となる観察はこうである。雑音の残りの帯域が折り返しても、折り返したコピーが $f_c$ の帯域 $|\Omega| \le 400\pi$ の上に乗らないかぎり無害である。離散時間の低域通過フィルタで後から取り除けるからだ。取り除けるのは $400\pi < |\Omega|$ に落ちたものすべてである。
When sampling at $\Omega_s$, the replica centered at $+\Omega_s$ occupies $[\Omega_s - 800\pi,\; \Omega_s + 800\pi]$. Its lowest frequency must not intrude below $400\pi$:
以 $\Omega_s$ 取樣時,中心在 $+\Omega_s$ 的複本佔據 $[\Omega_s - 800\pi,\; \Omega_s + 800\pi]$。它的最低頻率不能侵入 $400\pi$ 以下:
$\Omega_s$ で標本化すると、$+\Omega_s$ を中心とする複製は $[\Omega_s - 800\pi,\; \Omega_s + 800\pi]$ を占める。その最低周波数が $400\pi$ より下へ侵入してはならない:
So the minimum rate is $2\pi/T = 1200\pi$, i.e. $T = 1/600$ — only $1.5\times$ the $800\pi$ Nyquist rate of $f_c$ itself, not $2\times$ the $800\pi$ band edge of the filtered noise. At this rate the folded noise occupies exactly $400\pi \le |\Omega| \le 600\pi$ in the baseband, touching but not entering the signal band. In DT frequency the $f_c$ band edge maps to $\omega = 400\pi\,T = 2\pi/3$:
所以最低取樣率是 $2\pi/T = 1200\pi$,也就是 $T = 1/600$ —— 只是 $f_c$ 本身 $800\pi$ 奈奎斯特率的 $1.5$ 倍,而不是濾波後雜訊頻帶邊界 $800\pi$ 的 $2$ 倍。在這個取樣率下,折返的雜訊在基頻恰好佔據 $400\pi \le |\Omega| \le 600\pi$,剛好碰到訊號帶但沒有進入。換到數位頻率,$f_c$ 的頻帶邊界對應到 $\omega = 400\pi\,T = 2\pi/3$:
したがって最小のレートは $2\pi/T = 1200\pi$、すなわち $T = 1/600$ である——$f_c$ 自身のナイキストレート $800\pi$ の $1.5\times$ にすぎず、濾波後の雑音の帯域端 $800\pi$ の $2\times$ ではない。このレートでは折り返した雑音はベースバンドでちょうど $400\pi \le |\Omega| \le 600\pi$ を占め、信号帯に触れはするが入り込まない。離散時間周波数では $f_c$ の帯域端は $\omega = 400\pi\,T = 2\pi/3$ に写る:
Takeaways: (1) the DT filter compensates an analog phase distortion via the substitution $\Omega = \omega/T$; (2) out-of-band noise may alias onto itself without harm — the true constraint is protecting the signal band, which permits a sub-Nyquist (relative to $800\pi$) sampling rate.
重點回顧:(1) 數位濾波器透過代換 $\Omega = \omega/T$,補償掉一個類比的相位失真;(2) 帶外雜訊自己疊到自己身上沒有關係——真正的限制是保護訊號帶,因此取樣率可以低於(相對於 $800\pi$ 的)奈奎斯特率。
要点:(1) 離散時間フィルタは代入 $\Omega = \omega/T$ を通じてアナログの位相歪みを補償する。(2) 帯域外の雑音は自分自身の上に折り返しても害はない——本当の制約は信号帯を守ることであり、そのおかげで($800\pi$ に対しては)ナイキスト未満の標本化レートが許される。
Problem: (a) Generate the "continuous-time" signal $x_c(t) = \sin(4\pi t)$, $0 \le t \le 1$, using the dense grid t = 0:0.001:1, and plot it. (b) Sample $x_c(t)$ with sampling periods $T = 0.01$, $0.05$, $0.1$ s and stem-plot the three sequences $x[n]$. (c) Reconstruct $y_c(t)$ from each sequence using sinc interpolation and plot the three reconstructions. (d) Compute the mean square error (MSE) between $x_c(t)$ and each $y_c(t)$.
題目:(a) 用細網格 t = 0:0.001:1 產生「連續時間」訊號 $x_c(t) = \sin(4\pi t)$,$0 \le t \le 1$,並畫出來。(b) 以取樣週期 $T = 0.01$、$0.05$、$0.1$ 秒對 $x_c(t)$ 取樣,並用 stem 圖畫出三組序列 $x[n]$。(c) 用 sinc 內插從每組序列重建 $y_c(t)$,畫出三條重建曲線。(d) 計算 $x_c(t)$ 與各個 $y_c(t)$ 之間的均方誤差(MSE)。
問題:(a) 細かい格子 t = 0:0.001:1 を用いて「連続時間」信号 $x_c(t) = \sin(4\pi t)$、$0 \le t \le 1$ を生成し、図示せよ。(b) 標本化周期 $T = 0.01$、$0.05$、$0.1$ 秒で $x_c(t)$ を標本化し、三つの系列 $x[n]$ をステムプロットせよ。(c) それぞれの系列から sinc 内挿によって $y_c(t)$ を再構成し、三つの再構成結果を図示せよ。(d) $x_c(t)$ と各 $y_c(t)$ の平均二乗誤差(MSE)を求めよ。
Frequency check first: $\sin(4\pi t)$ has $f_0 = 2$ Hz, so the Nyquist rate is 4 Hz. The three sampling rates are $f_s = 100$, $20$, and $10$ Hz — all comfortably above Nyquist, so in principle every case reconstructs perfectly; the differences we measure come from truncating the sinc sum to the finite interval $[0,1]$.
先檢查頻率:$\sin(4\pi t)$ 的 $f_0 = 2$ Hz,所以奈奎斯特率是 4 Hz。三個取樣率分別是 $f_s = 100$、$20$、$10$ Hz —— 全都遠高於奈奎斯特率,原則上每一種都能完美重建;我們量到的差異,來自把 sinc 級數截斷在有限區間 $[0,1]$ 上。
まず周波数の確認:$\sin(4\pi t)$ は $f_0 = 2$ Hz なので、ナイキストレートは 4 Hz である。三つの標本化レートは $f_s = 100$、$20$、$10$ Hz——いずれもナイキストを余裕で上回るので、原理的にはどの場合も完全に再構成できる。測定される差は、sinc の和を有限区間 $[0,1]$ に打ち切ったことから生じる。
clc; clear; close all;
%% (a) "continuous-time" reference signal
t = 0:0.001:1;
xc = sin(4*pi*t);
figure(1); plot(t, xc, 'r');
title('x_c(t) = sin(4\pi t)'); xlabel('t (s)'); ylabel('x_c(t)');
%% (b)+(c) sample with T = 0.01, 0.05, 0.1 and sinc-reconstruct
Ts = [0.01 0.05 0.1];
mse = zeros(1,3);
figure(2);
for i = 1:3
T = Ts(i);
nT = 0:T:1; % sampling instants
xn = sin(4*pi*nT); % x[n] = xc(nT)
subplot(3,2,2*i-1); % left column: x[n]
stem(nT, xn);
title(sprintf('x[n], T = %.2f', T));
xlabel('n'); ylabel('x[n]');
yc = zeros(size(t)); % sinc interpolation
for k = 1:length(nT)
yc = yc + xn(k) * sinc((t - nT(k)) / T);
end
subplot(3,2,2*i); % right column: yc(t)
plot(t, yc, 'r');
title(sprintf('y_c(t), T = %.2f', T));
xlabel('t (s)'); ylabel('y_c(t)');
mse(i) = mean((xc - yc).^2); % (d) mean square error
fprintf('MSE for T = %.2f : %e\n', Ts(i), mse(i));
end
(d) Results (computed with the same algorithm in numpy):
(d) 結果(用 numpy 以相同演算法計算):
(d) 結果(numpy で同じアルゴリズムを用いて計算):
| $T$ (s) | $f_s$ (Hz) | samples in $[0,1]$ | MSE |
|---|---|---|---|
| 0.01 | 100 | 101 | $2.32\times 10^{-6}$ |
| 0.05 | 20 | 21 | $3.32\times 10^{-4}$ |
| 0.10 | 10 | 11 | $3.24\times 10^{-3}$ |
| $T$(秒) | $f_s$(Hz) | $[0,1]$ 內的樣本數 | 均方誤差 |
|---|---|---|---|
| 0.01 | 100 | 101 | $2.32\times 10^{-6}$ |
| 0.05 | 20 | 21 | $3.32\times 10^{-4}$ |
| 0.10 | 10 | 11 | $3.24\times 10^{-3}$ |
| $T$(秒) | $f_s$(Hz) | $[0,1]$ 内の標本数 | MSE |
|---|---|---|---|
| 0.01 | 100 | 101 | $2.32\times 10^{-6}$ |
| 0.05 | 20 | 21 | $3.32\times 10^{-4}$ |
| 0.10 | 10 | 11 | $3.24\times 10^{-3}$ |
Discussion. Since all three rates satisfy Nyquist, the ideal (infinite-length) sinc sum would give zero error in every case. The nonzero MSE comes from edge effects: the interpolation formula needs samples for all $n\in\mathbb{Z}$, but we only have $t\in[0,1]$. Each missing out-of-window sinc tail decays like $1/t$, and with larger $T$ there are fewer, more widely spaced samples, so the truncation error near the window edges grows — hence MSE increases by roughly $10\times$ for each step of $T$.
討論。三個取樣率都滿足奈奎斯特條件,所以理想的(無限長)sinc 級數在每一種情況下誤差都會是零。之所以 MSE 不為零,是邊界效應造成的:內插公式需要所有 $n\in\mathbb{Z}$ 的樣本,但我們只有 $t\in[0,1]$ 這一段。每個落在視窗外、被漏掉的 sinc 尾巴都以 $1/t$ 衰減;$T$ 越大,樣本越少、間隔越寬,視窗邊緣的截斷誤差就越大 —— 所以 $T$ 每放大一級,MSE 大約增加 $10$ 倍(誤差來自 sinc 級數被截斷,而不是混疊)。
考察。三つのレートはいずれもナイキスト条件を満たすので、理想的な(無限長の)sinc の和ならどの場合も誤差はゼロになるはずである。MSE がゼロでないのは端の効果による。内挿の公式はすべての $n\in\mathbb{Z}$ の標本を必要とするのに、手元にあるのは $t\in[0,1]$ の分だけだからである。窓の外にある欠けた sinc の裾はそれぞれ $1/t$ で減衰し、$T$ が大きいほど標本は少なく間隔も広くなるので、窓の端付近の打ち切り誤差は大きくなる——したがって $T$ を一段上げるごとに MSE はおよそ $10\times$ になる。
Problem: (e) For the $T=0.01$ sequence $x[n]$, quantize with 2 bits (4 levels), 3 bits (8 levels), and 4 bits (16 levels), rounding with offset (midrise). Stem-plot the three quantized signals $x_q[n]$. (f) Compute the MSE between $x[n]$ and each $x_q[n]$, and discuss the advantages and disadvantages of using different numbers of bits.
題目:(e) 對 $T=0.01$ 的序列 $x[n]$,分別用 2 位元(4 階)、3 位元(8 階)、4 位元(16 階)量化,採用帶偏移的四捨五入(中升型),並用 stem 圖畫出三組量化後的 $x_q[n]$。(f) 計算 $x[n]$ 與各個 $x_q[n]$ 的 MSE,並討論使用不同位元數的優缺點。
問題:(e) $T=0.01$ の系列 $x[n]$ を、2 ビット(4 レベル)、3 ビット(8 レベル)、4 ビット(16 レベル)で、オフセット付きの丸め(ミッドライズ型)により量子化せよ。量子化された三つの信号 $x_q[n]$ をステムプロットせよ。(f) $x[n]$ と各 $x_q[n]$ の MSE を計算し、ビット数を変えることの長所と短所を論ぜよ。
Midrise rule. With full scale $m_{\max}=1$ the step is $\Delta = 2/2^B$, and rounding with offset means $x_q = \Delta\,(\lfloor x/\Delta \rfloor + \tfrac12)$, clipped to the outermost levels $\pm(1 - \Delta/2)$ — the staircase of Fig. 6-6 (right).
中升型的規則。滿刻度 $m_{\max}=1$ 時階距為 $\Delta = 2/2^B$,帶偏移的取整就是 $x_q = \Delta\,(\lfloor x/\Delta \rfloor + \tfrac12)$,並截在最外側的階層 $\pm(1 - \Delta/2)$ —— 也就是圖 6-6(右)的那道階梯。
ミッドライズ型の規則。フルスケール $m_{\max}=1$ ではステップは $\Delta = 2/2^B$ であり、オフセット付きの丸めとは $x_q = \Delta\,(\lfloor x/\Delta \rfloor + \tfrac12)$ を最外のレベル $\pm(1 - \Delta/2)$ でクリップすることを意味する——図 6-6(右)の階段である。
%% (e) midrise quantization of the T = 0.01 sequence, B = 2, 3, 4
T = 0.01;
nT = 0:T:1;
xn = sin(4*pi*nT);
bits = [2 3 4];
figure(3);
for i = 1:3
B = bits(i);
D = 2 / 2^B; % step = full scale / #levels
xq = (floor(xn / D) + 0.5) * D; % round with offset (midrise)
xq = min(max(xq, -1 + D/2), 1 - D/2); % clip to outermost levels
subplot(3,1,i);
stem(nT, xq);
title(sprintf('%d-bit midrise quantization (%d levels)', B, 2^B));
xlabel('n'); ylabel('x_q[n]');
%% (f) mean square quantization error
mseq = mean((xn - xq).^2);
fprintf('B = %d bits : Delta = %.4f, MSE = %e (theory %.3e)\n', ...
B, D, mseq, D^2/12);
end
(f) Results:
(f) 結果:
(f) 結果:
| $B$ (bits) | levels | $\Delta$ | MSE measured | $\Delta^2/12$ (theory) |
|---|---|---|---|---|
| 2 | 4 | 0.500 | $2.71\times 10^{-2}$ | $2.08\times 10^{-2}$ |
| 3 | 8 | 0.250 | $6.86\times 10^{-3}$ | $5.21\times 10^{-3}$ |
| 4 | 16 | 0.125 | $2.02\times 10^{-3}$ | $1.30\times 10^{-3}$ |
| $B$(位元) | 階數 | $\Delta$ | 實測 MSE | $\Delta^2/12$(理論) |
|---|---|---|---|---|
| 2 | 4 | 0.500 | $2.71\times 10^{-2}$ | $2.08\times 10^{-2}$ |
| 3 | 8 | 0.250 | $6.86\times 10^{-3}$ | $5.21\times 10^{-3}$ |
| 4 | 16 | 0.125 | $2.02\times 10^{-3}$ | $1.30\times 10^{-3}$ |
| $B$(ビット) | レベル数 | $\Delta$ | 実測 MSE | $\Delta^2/12$(理論) |
|---|---|---|---|---|
| 2 | 4 | 0.500 | $2.71\times 10^{-2}$ | $2.08\times 10^{-2}$ |
| 3 | 8 | 0.250 | $6.86\times 10^{-3}$ | $5.21\times 10^{-3}$ |
| 4 | 16 | 0.125 | $2.02\times 10^{-3}$ | $1.30\times 10^{-3}$ |
Discussion.
討論。
考察。