A discrete-time system(離散時間系統) is a transformation $T\{\cdot\}$ that maps an input sequence $x[n]$ into an output sequence $y[n]$:
離散時間系統(discrete-time system)是一個轉換 $T\{\cdot\}$,把輸入序列 $x[n]$ 映射成輸出序列 $y[n]$:
離散時間システム(離散時間系統)とは、入力系列 $x[n]$ を出力系列 $y[n]$ へ写す変換 $T\{\cdot\}$ のことである:
The operator $T$ may act on the entire input sequence: in general, the output sample $y[n]$ at one time index can depend on input samples $x[k]$ at all indices $k$ — past, present, and future. Everything in this chapter is about classifying systems by which samples they use and how they combine them.
運算子 $T$ 可以作用在整條輸入序列上:一般而言,某一時刻的輸出樣本 $y[n]$ 可以同時取決於所有索引 $k$ 的輸入樣本 $x[k]$——過去、現在與未來都算。本章自始至終都在做一件事:依照系統「用了哪些樣本」以及「如何把它們組合起來」來分類系統。
作用素 $T$ は入力系列全体に作用してよい。一般に、ある時刻の出力標本 $y[n]$ は、あらゆるインデックス $k$ における入力標本 $x[k]$——過去・現在・未来——に依存しうる。本章の内容はすべて、システムがどの標本を使い、それらをどのように組み合わせるかによってシステムを分類することに尽きる。
The moving average(移動平均) system computes, for each $n$, the average of the input over a sliding window. The general (possibly non-causal) form averages $M_1$ future and $M_2$ past samples:
移動平均(moving average,MA)系統對每個 $n$ 計算輸入在一個滑動窗口內的平均值。一般(可能非因果)的形式對 $M_1$ 個未來樣本與 $M_2$ 個過去樣本取平均:
移動平均(移動平均)システムは、各 $n$ について、滑る窓の中での入力の平均を計算する。一般形(因果的でない場合もある)は、未来の $M_1$ 標本と過去の $M_2$ 標本を平均する:
The common causal $M$-point moving average uses only the present and past $M-1$ samples:
常見的因果 $M$ 點移動平均只用到現在與過去的 $M-1$ 個樣本:
よく使われる因果的な $M$ 点移動平均は、現在と過去の $M-1$ 標本だけを用いる:
The MA is the simplest smoother(平滑器): averaging adjacent samples cancels rapid, zero-mean fluctuations (noise) while approximately preserving slow trends. Fig. 2-1 shows a noisy sequence and the output of a 5-point MA.
移動平均是最簡單的平滑器(smoother):把相鄰樣本平均掉,可以抵消快速、零均值的起伏(雜訊),同時大致保留緩慢的趨勢。圖 2-1 顯示一條含雜訊的序列與 5 點移動平均的輸出。
移動平均は最も単純な平滑化器(平滑器)である。隣接する標本を平均すると、速くて平均ゼロの変動(雑音)が打ち消される一方、ゆっくりした傾向はおおむね保たれる。図 2-1 に、雑音を含む系列と 5 点移動平均の出力を示す。
y = conv(x, ones(1,M)/M).
Larger $M$ means stronger smoothing but more delay and more blurring of fast features.$M$ 點移動平均是一個有限脈衝響應(FIR)濾波器,其脈衝響應為 $0 \le n \le M-1$ 時 $h[n] = 1/M$(見 §2.3.2)。在 MATLAB 裡:y = conv(x, ones(1,M)/M)。$M$ 愈大,平滑效果愈強,但延遲也愈大、快速變化被抹得愈糊。$M$ 点移動平均は、インパルス応答が $0 \le n \le M-1$ で $h[n] = 1/M$ となる有限インパルス応答(FIR)フィルタである(§2.3.2 を参照)。MATLAB では y = conv(x, ones(1,M)/M)。$M$ を大きくすると平滑化は強くなるが、遅延が増え、速い特徴もぼやけてしまう。
The accumulator(累加器) sums all input samples up to the present time — the discrete-time analogue of an integrator:
累加器(accumulator)把到目前時刻為止的所有輸入樣本加起來——它是積分器的離散時間對應物:
累算器(累加器)は現在時刻までの入力標本をすべて足し合わせる——積分器の離散時間版である:
Splitting off the newest term gives the equivalent recursive(遞迴) form, which is how you would actually implement it:
把最新的一項單獨拆出來,就得到等價的遞迴(recursive)形式,實作上實際會這樣寫:
最も新しい項を切り離すと、等価な再帰(遞迴)形が得られる。実際に実装するときはこちらを使う:
For example, with input $x[n]=n\,u[n]$ the output is $y[n] = \sum_{k=0}^{n} k = \frac{n(n+1)}{2}\,u[n]$ — the running sum grows like $n^2$. The accumulator will reappear twice in this chapter: as a system that is linear, time-invariant, causal but unstable (§2.2.5), and as the classic example of an invertible system (§2.5.4).
舉例來說,輸入 $x[n]=n\,u[n]$ 時輸出為 $y[n] = \sum_{k=0}^{n} k = \frac{n(n+1)}{2}\,u[n]$——這個連續和以 $n^2$ 的速度成長。累加器在本章會再出現兩次:一次是當作線性、非時變、因果但不穩定的系統(§2.2.5),另一次是當作可逆系統的經典例子(§2.5.4)。
たとえば入力 $x[n]=n\,u[n]$ に対する出力は $y[n] = \sum_{k=0}^{n} k = \frac{n(n+1)}{2}\,u[n]$ となり、累和は $n^2$ のように増大する。累算器は本章で 2 度再登場する。線形・時不変・因果的でありながら不安定なシステムの例として(§2.2.5)、そして可逆なシステムの典型例として(§2.5.4)である。
Five properties are tested over and over in this course. For each one you should know the formal definition, a standard example, and a standard counterexample.
這門課會反覆檢驗五個性質。對每一個性質,你都應該記得它的正式定義、一個標準例子,以及一個標準反例。
この授業では 5 つの性質を繰り返し調べることになる。それぞれについて、形式的な定義、代表的な例、そして代表的な反例を押さえておくこと。
A system is memoryless(無記憶) if $y[n]$ depends only on $x[n]$ at the same index $n$. Example: $y[n]=\left(x[n]\right)^2$. Counterexample: the MA and the accumulator both use past samples, so they have memory.
一個系統是無記憶(memoryless)的,如果 $y[n]$ 只取決於同一個索引 $n$ 上的 $x[n]$。例:$y[n]=\left(x[n]\right)^2$。反例:移動平均與累加器都用到過去的樣本,所以它們有記憶。
システムが無記憶(無記憶)であるとは、$y[n]$ が同じインデックス $n$ の $x[n]$ だけに依存することをいう。例:$y[n]=\left(x[n]\right)^2$。反例:移動平均も累算器も過去の標本を使うので、記憶をもつ。
A system $T$ is linear(線性) if it satisfies superposition: for all signals $x_1, x_2$ and all constants $a, b$,
系統 $T$ 是線性(linear)的,如果它滿足疊加原理:對所有訊號 $x_1, x_2$ 與所有常數 $a, b$,
システム $T$ が線形(線性)であるとは、重ね合わせを満たすことをいう。すなわち、すべての信号 $x_1, x_2$ とすべての定数 $a, b$ について、
Superposition combines two requirements: additivity(可加性) $T\{x_1+x_2\}=T\{x_1\}+T\{x_2\}$ and homogeneity / scaling(齊次性) $T\{a\,x\}=a\,T\{x\}$. Three slide examples:
疊加原理同時包含兩個要求:可加性(additivity)$T\{x_1+x_2\}=T\{x_1\}+T\{x_2\}$,以及齊次性/比例性(homogeneity / scaling)$T\{a\,x\}=a\,T\{x\}$。課堂上的三個例子:
重ね合わせは 2 つの要件を合わせたものである:加法性(可加性) $T\{x_1+x_2\}=T\{x_1\}+T\{x_2\}$ と、斉次性・スケーリング(齊次性) $T\{a\,x\}=a\,T\{x\}$ である。スライドにあった 3 つの例を見てみよう:
A system is time-invariant(非時變), also called shift-invariant, if delaying the input only delays the output by the same amount — the system's behaviour does not change with time:
一個系統是非時變(time-invariant)的,也叫平移不變(shift-invariant),如果把輸入延遲,輸出也只是延遲同樣多——系統的行為不隨時間改變:
システムが時不変(非時變)である(シフト不変ともいう)とは、入力を遅らせると出力も同じだけ遅れるだけで、システムの振る舞いが時間とともに変わらないことをいう:
How to test: (i) shift the input first, push it through the system to get $w[n]=T\{x[n-n_0]\}$; (ii) shift the original output to get $y[n-n_0]$; (iii) compare. They must agree for every $x$ and every $n_0$.
怎麼測:(i) 先把輸入平移,再送進系統得到 $w[n]=T\{x[n-n_0]\}$;(ii) 把原本的輸出平移得到 $y[n-n_0]$;(iii) 比較兩者。它們必須對每一個 $x$ 與每一個 $n_0$ 都相等。
判定の仕方:(i) まず入力をシフトしてからシステムに通し、$w[n]=T\{x[n-n_0]\}$ を得る。(ii) もとの出力をシフトして $y[n-n_0]$ を得る。(iii) 両者を比較する。すべての $x$ とすべての $n_0$ について一致しなければならない。
A system is causal(因果) if $y[n_0]$ depends only on input samples $x[n]$ with $n \le n_0$ — present and past, never the future. Causality is mandatory for real-time processing; offline (stored-data) processing can afford non-causal systems.
一個系統是因果(causal)的,如果 $y[n_0]$ 只取決於 $n \le n_0$ 的輸入樣本 $x[n]$——現在與過去,絕不用到未來。即時處理一定要求因果;離線(資料已存好)處理則可以使用非因果系統。
システムが因果的(因果)であるとは、$y[n_0]$ が $n \le n_0$ なる入力標本 $x[n]$ だけに依存すること、すなわち現在と過去だけを使い、未来を決して使わないことをいう。実時間処理では因果性は必須である。オフライン(蓄積データ)の処理であれば、非因果的なシステムも許される。
A system is BIBO stable(有界輸入有界輸出穩定) if every bounded input produces a bounded output:
一個系統是BIBO 穩定(bounded-input bounded-output,有界輸入有界輸出)的,如果每一個有界輸入都產生有界輸出:
システムがBIBO 安定(有界輸入有界輸出穩定)であるとは、有界な入力がすべて有界な出力を生むことをいう:
To prove instability you only need one bounded input whose output blows up. The classic victim is the accumulator: feed it the bounded step $x[n]=u[n]$ and the output is the unbounded ramp $y[n]=(n+1)u[n]$ — see Fig. 2-4.
要證明不穩定,只需要找到一個有界輸入使輸出發散。最經典的受害者是累加器:餵給它有界的步階 $x[n]=u[n]$,輸出就是無界的斜坡 $y[n]=(n+1)u[n]$——見圖 2-4。
不安定であることを示すには、出力が発散するような有界入力を1 つ見つければよい。典型的な犠牲者は累算器である。有界なステップ $x[n]=u[n]$ を入れると、出力は有界でないランプ $y[n]=(n+1)u[n]$ になる——図 2-4 を参照。
| System | Memoryless | Linear | Time-inv. | Causal | Stable |
|---|---|---|---|---|---|
| Ideal delay $y[n]=x[n-n_d]$, $n_d>0$ | No | Yes | Yes | Yes | Yes |
| Causal $M$-point MA | No | Yes | Yes | Yes | Yes |
| Centered MA ($M_1>0$) | No | Yes | Yes | No | Yes |
| Accumulator | No | Yes | Yes | Yes | No |
| Compressor $y[n]=x[Mn]$ | No | Yes | No | No | Yes |
| $y[n]=n\,x[n]$ | Yes | Yes | No | Yes | No |
| Squarer $y[n]=x^2[n]$ | Yes | No | Yes | Yes | Yes |
| 系統 | 無記憶 | 線性 | 非時變 | 因果 | 穩定 |
|---|---|---|---|---|---|
| 理想延遲 $y[n]=x[n-n_d]$、$n_d>0$ | 否 | 是 | 是 | 是 | 是 |
| 因果 $M$ 點移動平均 | 否 | 是 | 是 | 是 | 是 |
| 置中移動平均($M_1>0$) | 否 | 是 | 是 | 否 | 是 |
| 累加器 | 否 | 是 | 是 | 是 | 否 |
| 壓縮器 $y[n]=x[Mn]$ | 否 | 是 | 否 | 否 | 是 |
| $y[n]=n\,x[n]$ | 是 | 是 | 否 | 是 | 否 |
| 平方器 $y[n]=x^2[n]$ | 是 | 否 | 是 | 是 | 是 |
| システム | 無記憶 | 線形 | 時不変 | 因果的 | 安定 |
|---|---|---|---|---|---|
| 理想遅延 $y[n]=x[n-n_d]$、$n_d>0$ | いいえ | はい | はい | はい | はい |
| 因果的な $M$ 点移動平均 | いいえ | はい | はい | はい | はい |
| 中心化移動平均($M_1>0$) | いいえ | はい | はい | いいえ | はい |
| 累算器 | いいえ | はい | はい | はい | いいえ |
| 圧縮器 $y[n]=x[Mn]$ | いいえ | はい | いいえ | いいえ | はい |
| $y[n]=n\,x[n]$ | はい | はい | いいえ | はい | いいえ |
| 二乗器 $y[n]=x^2[n]$ | はい | いいえ | はい | はい | はい |
A system that is both linear and time-invariant is called LTI(線性非時變) — the slides also use the equivalent name LSI (linear shift-invariant). For LTI systems one single signal characterizes the system completely: the impulse response(脈衝響應)
同時具備線性與非時變的系統稱為 LTI(linear time-invariant,線性非時變)——課堂投影片也用等價的名稱 LSI(linear shift-invariant,線性平移不變)。對 LTI 系統而言,只要一個訊號就能完整刻畫整個系統:脈衝響應(impulse response)
線形かつ時不変であるシステムを LTI(線性非時變) という——スライドでは同義語として LSI(線形シフト不変)も使われている。LTI システムでは、たった 1 つの信号がシステムを完全に特徴づける。それがインパルス応答(脈衝響應)である
The derivation is the most important three lines of the course. Start from the sifting decomposition of Chapter 1 — any sequence is a weighted sum of shifted impulses:
接下來的推導是這門課最重要的三行。從第 1 章的篩選分解出發——任何序列都是位移脈衝的加權和:
この導出は、この授業で最も重要な 3 行である。第 1 章のふるい分けによる分解から始める。任意の系列は、シフトされたインパルスの重み付き和であった:
Apply $T$ and use linearity (the $x[k]$ are just constants) and then time invariance ($\delta[n-k] \mapsto h[n-k]$):
把 $T$ 作用上去,先用線性($x[k]$ 只是常數),再用非時變性($\delta[n-k] \mapsto h[n-k]$):
ここに $T$ を作用させ、線形性($x[k]$ はただの定数である)を使い、次に時不変性($\delta[n-k] \mapsto h[n-k]$)を使う:
Feed $\delta[n]$ into the systems of §2.1 (Fig. 2-2):
把 $\delta[n]$ 餵進 §2.1 的各個系統(圖 2-2):
§2.1 のシステムに $\delta[n]$ を入れてみる(図 2-2):
| $n$ | $u[n]$ | $u[n-M]$ | $u[n]-u[n-M]$ |
|---|---|---|---|
| $<0$ | 0 | 0 | $0$ |
| $0\le n\le M-1$ | 1 | 0 | $1$ |
| $\ge M$ | 1 | 1 | $0$ |
| $n$ | $a\,h[n-1]$ | $+\,\delta[n]$ | $h[n]$ |
|---|---|---|---|
| $<0$ | — | $0$ | $0$(初始靜止) |
| $0$ | $a\cdot 0=0$ | $1$ | $1=a^0$ |
| $1$ | $a\cdot 1=a$ | $0$ | $a=a^1$ |
| $2$ | $a\cdot a=a^2$ | $0$ | $a^2$ |
| $3$ | $a\cdot a^2=a^3$ | $0$ | $a^3$ |
Two complementary readings of the same formula:
同一條公式有兩種互補的讀法:
同じ式には、互いに補い合う 2 通りの読み方がある:
Read $y[n] = \sum_k x[k]\,h[n-k]$ as a sum over input samples: every input sample $x[k]$ launches its own copy of the impulse response, scaled by $x[k]$ and delayed to start at time $k$. The output is the superposition of all these scaled, shifted echoes. This is the direct picture of "linearity + time invariance at work".
把 $y[n] = \sum_k x[k]\,h[n-k]$ 讀成對輸入樣本求和:每一個輸入樣本 $x[k]$ 都發出一份自己的脈衝響應複本,振幅被 $x[k]$ 縮放,並延遲到時刻 $k$ 才開始。輸出就是所有這些縮放、位移後回聲的疊加。這是「線性+非時變一起作用」最直接的圖像。
$y[n] = \sum_k x[k]\,h[n-k]$ を入力標本についての和として読む。どの入力標本 $x[k]$ も、$x[k]$ 倍されて時刻 $k$ から始まるように遅延された、自分自身のインパルス応答の複製を送り出す。出力は、こうしてスケールされ平行移動されたこだまをすべて重ね合わせたものである。これは「線形性+時不変性が働いている様子」をそのまま絵にしたものである。
Read the formula one output sample at a time. To get the single number $y[n]$:
把公式一次只讀一個輸出樣本。要得到單一個數 $y[n]$:
この式を、出力標本 1 個ずつ読む。たった 1 つの数 $y[n]$ を得るには:
Fig. 2-3 walks through $x[n]=\{1,2,3,2,1\}$ convolved with $h[n]=\{1,1,1\}$: at $n=3$ the flipped window $h[3-k]$ overlaps $x[k]$ on $k=1,2,3$, giving $y[3]=2+3+2=7$.
圖 2-3 完整走過 $x[n]=\{1,2,3,2,1\}$ 與 $h[n]=\{1,1,1\}$ 的卷積:在 $n=3$ 時翻轉後的窗口 $h[3-k]$ 與 $x[k]$ 在 $k=1,2,3$ 重疊,得到 $y[3]=2+3+2=7$。
図 2-3 は $x[n]=\{1,2,3,2,1\}$ と $h[n]=\{1,1,1\}$ の畳み込みを順に追ったものである。$n=3$ では、反転した窓 $h[3-k]$ が $k=1,2,3$ で $x[k]$ と重なり、$y[3]=2+3+2=7$ となる。
Commutativity follows from the change of variables $m = n-k$ in the sum; it means "you may flip either signal" — always flip the shorter one. The associative and distributive properties are exactly what make cascade and parallel interconnections work (§2.5.3). Convolution is also linear in each argument and time-invariant: if $y = x*h$ then $x[n-n_0]*h[n] = y[n-n_0]$.
交換律來自求和中的變數代換 $m = n-k$;它的意思是「兩個訊號翻哪一個都可以」——永遠翻比較短的那個。結合律與分配律正是串聯與並聯互連之所以成立的原因(§2.5.3)。卷積對兩個引數也都是線性的,而且是非時變的:若 $y = x*h$,則 $x[n-n_0]*h[n] = y[n-n_0]$。
交換法則は、和の中で変数を $m = n-k$ と置き換えれば従う。これは「どちらの信号を反転してもよい」ということであり、つねに短い方を反転すればよい。結合法則と分配法則は、縦続接続と並列接続が成り立つ理由そのものである(§2.5.3)。畳み込みはまた、各引数について線形であり、かつ時不変でもある:$y = x*h$ ならば $x[n-n_0]*h[n] = y[n-n_0]$ が成り立つ。
For finite-length sequences, convolution is a matrix–vector product. With $x[n]$ of length $N$ and $h[n]$ of length $M$, stack $y = H\,x$ where $H$ is the $(N{+}M{-}1)\times N$ convolution (Toeplitz) matrix(卷積矩陣) whose columns are shifted copies of $h$. For $h=\{h_0,h_1,h_2\}$ and $N=5$:
對有限長度序列而言,卷積就是一個矩陣與向量的乘積。設 $x[n]$ 長度為 $N$、$h[n]$ 長度為 $M$,可以把輸出疊成 $y = H\,x$,其中 $H$ 是 $(N{+}M{-}1)\times N$ 的卷積矩陣(Toeplitz 矩陣),它的每一行都是 $h$ 的位移複本。以 $h=\{h_0,h_1,h_2\}$、$N=5$ 為例:
有限長の系列に対しては、畳み込みは行列とベクトルの積である。長さ $N$ の $x[n]$ と長さ $M$ の $h[n]$ について、$y = H\,x$ と書ける。ここで $H$ は $(N{+}M{-}1)\times N$ の畳み込み行列(Toeplitz 行列)(卷積矩陣)で、その各列は $h$ を平行移動した複製である。$h=\{h_0,h_1,h_2\}$、$N=5$ の場合:
Each column is the echo launched by one input sample (Interpretation 1); each row is the flipped window picking out one output sample (Interpretation 2). The constant-along-diagonals (Toeplitz) structure is time invariance written as a matrix.
每一行是某一個輸入樣本所發出的回聲(讀法一);每一列是翻轉後的窗口挑出某一個輸出樣本(讀法二)。「沿對角線為定值」的 Toeplitz 結構就是非時變性用矩陣寫出來的樣子。
各列は 1 つの入力標本が送り出したこだまであり(読み方 1)、各行は 1 つの出力標本を取り出す反転窓である(読み方 2)。対角線に沿って値が一定である(Toeplitz)という構造こそが、行列の形で書かれた時不変性である。
y = conv(x, h) returns the full
length-$(N{+}M{-}1)$ result. MATLAB vectors carry no time origin — you must track the
starting index: if x starts at $n_x$ and
h at $n_h$, build the output axis as
ny = (nx+nh) : (nx+nh+N+M-2).
Plot discrete sequences with stem, never
plot.y = conv(x, h) 回傳完整長度 $(N{+}M{-}1)$ 的結果。MATLAB 的向量不帶時間原點——追蹤起始索引是你的責任:若 x 從 $n_x$ 開始、h 從 $n_h$ 開始,就要自己把輸出的時間軸建成 ny = (nx+nh) : (nx+nh+N+M-2)。畫離散序列請用 stem,絕不要用 plot。y = conv(x, h) は長さ $(N{+}M{-}1)$ の完全な結果を返す。MATLAB のベクトルは時間原点をもたないので、開始インデックスは自分で管理しなければならない。x が $n_x$ から、h が $n_h$ から始まるなら、出力の時間軸は ny = (nx+nh) : (nx+nh+N+M-2) と作る。離散系列を描くときは必ず stem を使い、plot は使わないこと。
Because $h[n]$ characterizes an LTI system completely, every system property of §2.2 must be readable directly from $h[n]$.
因為 $h[n]$ 完整刻畫了一個 LTI 系統,§2.2 的每一個系統性質都必須能直接從 $h[n]$ 讀出來。
$h[n]$ は LTI システムを完全に特徴づけるので、§2.2 のシステムの性質はどれも $h[n]$ から直接読み取れるはずである。
Why: in $y[n] = \sum_k h[k]\,x[n-k]$, the terms with $k<0$ involve $x[n-k]$ with $n-k > n$ — future inputs. They vanish for every input iff $h[k]=0$ for $k<0$. ($\Leftarrow$) is immediate; ($\Rightarrow$) follows because $h[n]$ is itself the response to $\delta[n]$: a causal system cannot respond before the impulse arrives at $n=0$. A sequence with this property is called a causal sequence.
原因:在 $y[n] = \sum_k h[k]\,x[n-k]$ 中,$k<0$ 的項牽涉到 $n-k > n$ 的 $x[n-k]$——也就是未來的輸入。要讓這些項對每一個輸入都消失,充要條件是 $k<0$ 時 $h[k]=0$。($\Leftarrow$)方向是顯然的;($\Rightarrow$)方向成立是因為 $h[n]$ 本身就是對 $\delta[n]$ 的響應:因果系統不可能在脈衝於 $n=0$ 抵達之前就有反應。具有這個性質的序列稱為因果序列。
理由:$y[n] = \sum_k h[k]\,x[n-k]$ において、$k<0$ の項には $n-k > n$ なる $x[n-k]$——つまり未来の入力——が現れる。これがあらゆる入力について消えるのは、$k<0$ で $h[k]=0$ となるとき、かつそのときに限る。($\Leftarrow$)は直ちに従う。($\Rightarrow$)は $h[n]$ 自身が $\delta[n]$ に対する応答であることから従う:因果的なシステムが、$n=0$ にインパルスが到着する前に応答することはできない。この性質をもつ系列を因果系列という。
Adversarial means an input deliberately constructed to break the system — the worst case. It must still be bounded ($|x[n]|\le1$), because the definition of BIBO stability demands a bounded output for every bounded input, which entitles us to pick the nastiest one.
對抗性(adversarial)指的是刻意構造、用來「打垮」系統的最壞情況輸入,但它仍必須是有界的($|x[n]|\le1$)——因為 BIBO 的定義就是「任何有界輸入」都要產生有界輸出,所以我們有權挑選最刁鑽的那一個。
敵対的とは、システムを壊すために意図的に構成された入力、すなわち最悪の場合を指す。それでいて有界($|x[n]|\le1$)でなければならない。BIBO 安定性の定義はあらゆる有界入力に対して有界な出力を要求するので、こちらは最も意地の悪いものを選ぶ権利がある。
To prove a system unstable you only need one bounded input whose output diverges. So rather than taking an arbitrary input we take the most malicious one: $$x[n] = \operatorname{sgn}\!\bigl(h[-n]\bigr).$$
要證明系統不穩定,只需找到一個有界輸入使輸出發散即可。因此不隨便取,而是選最「惡意」的: $$x[n] = \operatorname{sgn}\!\bigl(h[-n]\bigr).$$
システムが不安定であることを示すには、出力が発散する有界入力が1 つあれば足りる。そこで任意の入力をとるのではなく、最も悪意のあるものをとる: $$x[n] = \operatorname{sgn}\!\bigl(h[-n]\bigr).$$
Its cleverness is that at $n=0$ the signs line up with every $h[k]$: $$y[0] = \sum_k h[k]\,x[-k] = \sum_k h[k]\,\operatorname{sgn}(h[k]) = \sum_k |h[k]| = S.$$ Every term becomes $+|h[k]|$, so nothing cancels and everything adds with the same sign (constructive superposition) — which is exactly the worst case. If $S=\infty$, that single output sample $y[0]$ already diverges, so the system cannot be stable.
它的巧妙之處在於 $n=0$ 時,符號剛好對齊每個 $h[k]$: $$y[0] = \sum_k h[k]\,x[-k] = \sum_k h[k]\,\operatorname{sgn}(h[k]) = \sum_k |h[k]| = S.$$ 每一項都變成 $+|h[k]|$,沒有任何抵消、全部同號相加(建設性疊加)——這正是最壞情況。若 $S=\infty$,則單一個輸出樣本 $y[0]$ 就已發散,系統必不穩定。
この巧妙さは、$n=0$ において符号がすべての $h[k]$ と揃うことにある: $$y[0] = \sum_k h[k]\,x[-k] = \sum_k h[k]\,\operatorname{sgn}(h[k]) = \sum_k |h[k]| = S.$$ どの項も $+|h[k]|$ になるので、何も打ち消し合わず、すべてが同じ符号で足し合わされる(強め合う重ね合わせ)——これがまさに最悪の場合である。$S=\infty$ であれば、この出力標本 $y[0]$ ただ 1 つですでに発散するので、そのシステムは安定ではありえない。
In short: a bounded adversarial input = bounded (a legal test input) + sign-aligned (maximizing the output), the cleanest construction there is for exposing instability.
總結:有界對抗性輸入 = 有界(合法測試輸入)+ 符號對齊(使輸出最大化),是揭露系統不穩定最乾淨俐落的構造。
要するに、有界な敵対的入力 = 有界(判定に使ってよい入力)+ 符号が揃っている(出力を最大化する)であり、不安定性をあぶり出すこれ以上ないほど端正な構成である。
The reason is the time reversal (the flip) that convolution already contains. At $n=0$ the output is $$y[0] = \sum_k h[k]\,x[0-k] = \sum_k h[k]\,x[-k].$$ Note that the input is indexed by $-k$, not $k$. To make every term add with the same sign we therefore need $$x[-k] = \operatorname{sgn}(h[k]) \quad\text{for all } k.$$
關鍵在於卷積本身內建的時間反轉(翻摺,flip)。輸出在 $n=0$ 時為 $$y[0] = \sum_k h[k]\,x[0-k] = \sum_k h[k]\,x[-k].$$ 注意輸入的索引是 $-k$ 而不是 $k$。要讓每一項都同號相加,必須讓 $$x[-k] = \operatorname{sgn}(h[k]) \quad\text{對所有 } k.$$
理由は、畳み込みがすでに内部にもっている時間反転(反転操作)にある。$n=0$ での出力は $$y[0] = \sum_k h[k]\,x[0-k] = \sum_k h[k]\,x[-k].$$ 入力の添字が $k$ ではなく $-k$ であることに注意せよ。したがって、どの項も同じ符号で足し合わされるようにするには $$x[-k] = \operatorname{sgn}(h[k]) \quad\text{for all } k.$$ が必要である。
Substituting $m=-k$ (that is, $k=-m$) gives $$x[m] = \operatorname{sgn}(h[-m]) \;\Longrightarrow\; x[n] = \operatorname{sgn}(h[-n]).$$ That $h[-n]$ is precisely what cancels the flip inside the convolution — two reversals undo each other, and substituting back: $$y[0]=\sum_k h[k]\,\underbrace{\operatorname{sgn}(h[k])}_{x[-k]}=\sum_k|h[k]|=S.$$
令 $m=-k$(即 $k=-m$)代換,得 $$x[m] = \operatorname{sgn}(h[-m]) \;\Longrightarrow\; x[n] = \operatorname{sgn}(h[-n]).$$ 這個 $h[-n]$ 正好抵消卷積的翻摺——兩次反轉互相抵消,代回後: $$y[0]=\sum_k h[k]\,\underbrace{\operatorname{sgn}(h[k])}_{x[-k]}=\sum_k|h[k]|=S.$$
$m=-k$(すなわち $k=-m$)と置き換えると $$x[m] = \operatorname{sgn}(h[-m]) \;\Longrightarrow\; x[n] = \operatorname{sgn}(h[-n]).$$ が得られる。この $h[-n]$ こそが畳み込みの内部にある反転を打ち消すものである——2 回の反転は互いに打ち消し合う。代入し直すと: $$y[0]=\sum_k h[k]\,\underbrace{\operatorname{sgn}(h[k])}_{x[-k]}=\sum_k|h[k]|=S.$$
If we used $x[n]=\operatorname{sgn}(h[n])$ instead, then $x[-k]=\operatorname{sgn}(h[-k])$, whose signs no longer match $h[k]$; the terms would partly cancel and the sum could not be driven up to $S$. That minus sign exists solely to match the flip built into convolution.
若改用 $x[n]=\operatorname{sgn}(h[n])$,則 $x[-k]=\operatorname{sgn}(h[-k])$,符號與 $h[k]$ 對不上,各項會部分抵消,無法把總和逼到 $S$。那個負號的存在,完全是為了配合卷積的翻摺。
もし代わりに $x[n]=\operatorname{sgn}(h[n])$ としていたら、$x[-k]=\operatorname{sgn}(h[-k])$ となり、その符号はもはや $h[k]$ と一致しない。項は部分的に打ち消し合い、和を $S$ まで押し上げることはできない。あのマイナス符号は、ひとえに畳み込みに組み込まれた反転と帳尻を合わせるために存在している。
So can we not take the sign without flipping? We can — taking the sign needs no flip at all. The two operations are independent and serve different purposes. The flip is not there to obtain the sign; it is there to cancel the flip convolution performs by itself:
那「不左右翻摺」就不能取符號嗎?能——取符號(sgn)本身完全不需要翻摺,這兩件事是獨立、目的不同的。翻摺不是為了取得符號,而是為了抵消卷積自己內建的翻摺:
では反転せずに符号だけ取ってはいけないのか。取ってよい——符号を取る操作に反転はまったく要らない。この 2 つの操作は独立であり、目的も異なる。反転は符号を得るためにあるのではなく、畳み込みが自分で行う反転を打ち消すためにある:
Because the input inside $y[0]=\sum_k h[k]\,x[\boldsymbol{-k}]$ has already been flipped once by the convolution. What we want is $x[-k]=\operatorname{sgn}(h[k])$, so $x$ itself must be laid down backwards first; convolution flips it a second time and it comes out the right way round — the two flips cancel. In one line: the sign takes care of “bounded and same-signed”, the flip takes care of “matching the $-k$ of the convolution”. Both are needed and neither replaces the other.
因為輸出 $y[0]=\sum_k h[k]\,x[\boldsymbol{-k}]$ 中的輸入已被卷積翻過一次;我要的是 $x[-k]=\operatorname{sgn}(h[k])$,所以 $x$ 本身必須先反著放,被卷積再翻一次後才正過來——兩次翻摺剛好抵消。簡言之:符號管「有界+同號」,翻摺管「對齊卷積的 $-k$」,兩者缺一不可,但互不替代。
$y[0]=\sum_k h[k]\,x[\boldsymbol{-k}]$ の中の入力は、畳み込みによってすでに 1 度反転されているからである。こちらが欲しいのは $x[-k]=\operatorname{sgn}(h[k])$ なので、$x$ 自体をまず逆向きに並べておく必要がある。畳み込みがそれをもう 1 度反転すると、正しい向きで出てくる——2 回の反転が打ち消し合うのである。一言でいえば、符号が「有界かつ同符号」を引き受け、反転が「畳み込みの $-k$ との辻褄合わせ」を引き受ける。どちらも必要であり、一方が他方の代わりにはならない。
So what does $y[0]$ actually come out to if we really convolve ① $h[k]$ with ③ $x[-k]$? Here it is step by step (still with $h=[0.8,-0.5,0.3,-0.2]$):
那把 ① $h[k]$ 和 ③ $x[-k]$ 真的卷積起來,$y[0]$ 是什麼結果?下面一步一步算(仍用 $h=[0.8,-0.5,0.3,-0.2]$):
では ① $h[k]$ と ③ $x[-k]$ を実際に畳み込むと、$y[0]$ はいくつになるのか。手順を追って見てみよう(引き続き $h=[0.8,-0.5,0.3,-0.2]$ とする):
No. By the time invariance of convolution, delaying the input by $4$ merely delays the output by $4$; the values are unchanged. With $x'[n]=x[n-4]$, $$y'[n]=(h*x')[n]=(h*x)[n-4]=y[n-4]\quad\Longrightarrow\quad y'[4]=y[0]=S=1.8.$$
不變。由卷積的時間不變性:把輸入延遲 $4$,輸出也只是跟著延遲 $4$,數值完全不變。設 $x'[n]=x[n-4]$,則 $$y'[n]=(h*x')[n]=(h*x)[n-4]=y[n-4]\quad\Longrightarrow\quad y'[4]=y[0]=S=1.8.$$
変わらない。畳み込みの時不変性により、入力を $4$ だけ遅らせても出力が $4$ だけ遅れるにすぎず、値は変わらない。$x'[n]=x[n-4]$ とすると、 $$y'[n]=(h*x')[n]=(h*x)[n-4]=y[n-4]\quad\Longrightarrow\quad y'[4]=y[0]=S=1.8.$$
Direct evaluation agrees: $y'[4]=\sum_k h[k]\,x'[4-k]=\sum_k h[k]\,x[-k]=y[0].$ In other words the whole picture just slides 4 steps to the right: the position at which the peak $S$ appears changes, its size does not. This also explains why the proof may pick $n=0$ freely — any sample at which the signs line up equals $S$.
直接驗算也一致:$y'[4]=\sum_k h[k]\,x'[4-k]=\sum_k h[k]\,x[-k]=y[0].$ 換句話說整張圖只是往右滑 4 格,峰值 $S$ 出現的位置變了,大小沒變。這也說明證明裡為何可以隨意挑 $n=0$ 來算——任何一個「符號全對齊」的樣本都等於 $S$。
直接計算しても一致する:$y'[4]=\sum_k h[k]\,x'[4-k]=\sum_k h[k]\,x[-k]=y[0].$ 言い換えれば絵全体がそのまま右へ 4 歩ずれるだけであり、ピーク $S$ が現れる位置は変わるが、その大きさは変わらない。これは、証明が $n=0$ を自由に選んでよい理由でもある——符号が揃う標本であれば、どれをとっても値は $S$ になる。
Correct. The adversarial input is tuned specifically for $n=0$ ($x[-k]=\operatorname{sgn}(h[k])$), so $n=0$ is the only index at which every term is positive: $$y[0]=\sum_k h[k]\,\underbrace{x[-k]}_{=\,\operatorname{sgn}(h[k])}=\sum_k |h[k]|=0.8+0.5+0.3+0.2=1.8=S.$$ At other indices the alignment is lost, the signs are mixed and terms partly cancel; at the ends only a single term survives (so it is not really a “sum” at all):
對。對抗輸入是專為 $n=0$ 調好的($x[-k]=\operatorname{sgn}(h[k])$),所以唯有在 $n=0$ 每一項都同號為正: $$y[0]=\sum_k h[k]\,\underbrace{x[-k]}_{=\,\operatorname{sgn}(h[k])}=\sum_k |h[k]|=0.8+0.5+0.3+0.2=1.8=S.$$ 其他索引對不齊,符號混雜、部分抵消,甚至端點只剩單一項(根本不是「和」):
そのとおりである。敵対的入力は$n=0$ に合わせて特別に調整されている($x[-k]=\operatorname{sgn}(h[k])$)ので、すべての項が正になるインデックスは $n=0$ だけである: $$y[0]=\sum_k h[k]\,\underbrace{x[-k]}_{=\,\operatorname{sgn}(h[k])}=\sum_k |h[k]|=0.8+0.5+0.3+0.2=1.8=S.$$ 他のインデックスでは位置合わせが崩れ、符号が入り混じって項が部分的に打ち消し合う。端では項が 1 つしか残らない(したがってそもそも「和」ですらない):
| $n$ | terms | $y[n]$ |
|---|---|---|
| $-3$ | only $h[0]x[-3]=0.8(-1)$ (a single term) | $-0.8$ |
| $-2$ | $0.8(+1)+(-0.5)(-1)$ | $+1.3$ |
| $-1$ | $0.8(-1)+(-0.5)(+1)+0.3(-1)$ (all negative) | $-1.6$ |
| $0$ | $0.8+0.5+0.3+0.2$ (all positive) | $+1.8=S$ |
| $1$ | mixed signs | $-1.0$ |
| $2$ | mixed signs | $+0.5$ |
| $3$ | only $h[3]x[0]=-0.2$ (a single term) | $-0.2$ |
| $n$ | 各項 | $y[n]$ |
|---|---|---|
| $-3$ | 只有 $h[0]x[-3]=0.8(-1)$(單一項) | $-0.8$ |
| $-2$ | $0.8(+1)+(-0.5)(-1)$ | $+1.3$ |
| $-1$ | $0.8(-1)+(-0.5)(+1)+0.3(-1)$(全負) | $-1.6$ |
| $0$ | $0.8+0.5+0.3+0.2$(全正) | $+1.8=S$ |
| $1$ | 混合正負 | $-1.0$ |
| $2$ | 混合正負 | $+0.5$ |
| $3$ | 只有 $h[3]x[0]=-0.2$(單一項) | $-0.2$ |
| $n$ | 項 | $y[n]$ |
|---|---|---|
| $-3$ | $h[0]x[-3]=0.8(-1)$ のみ(1 項だけ) | $-0.8$ |
| $-2$ | $0.8(+1)+(-0.5)(-1)$ | $+1.3$ |
| $-1$ | $0.8(-1)+(-0.5)(+1)+0.3(-1)$(すべて負) | $-1.6$ |
| $0$ | $0.8+0.5+0.3+0.2$(すべて正) | $+1.8=S$ |
| $1$ | 符号が混在 | $-1.0$ |
| $2$ | 符号が混在 | $+0.5$ |
| $3$ | $h[3]x[0]=-0.2$ のみ(1 項だけ) | $-0.2$ |
Compare the magnitudes: $|y[n]| = 0.8,\,1.3,\,1.6,\,\mathbf{1.8},\,1.0,\,0.5,\,0.2$ — the peak $1.8$ occurs only at $n=0$ and every other sample is strictly smaller. That is why the proof reads $y[0]$ alone: it is the one sample guaranteed to reach $S$, and if $S=\infty$ that single sample already diverges ⇒ the system is unstable.
比較大小:$|y[n]| = 0.8,\,1.3,\,1.6,\,\mathbf{1.8},\,1.0,\,0.5,\,0.2$——峰值 $1.8$ 只在 $n=0$ 出現,其餘樣本嚴格較小。這就是證明只讀 $y[0]$ 的原因:它是唯一保證 $|y|$ 達到 $S$ 的樣本;若 $S=\infty$,光這一個樣本就發散 ⇒ 系統不穩定。
大きさを比べてみよう:$|y[n]| = 0.8,\,1.3,\,1.6,\,\mathbf{1.8},\,1.0,\,0.5,\,0.2$——ピークの $1.8$ は$n=0$ でしか現れず、他の標本はすべて厳密に小さい。証明が $y[0]$ だけを読むのはこのためである。$S$ に到達することが保証された唯一の標本であり、$S=\infty$ ならばその 1 標本だけですでに発散する ⇒ システムは不安定である。
The convolution algebra of §2.4.2 translates directly into block-diagram rules (Fig. 2-5):
§2.4.2 的卷積代數可以直接翻譯成方塊圖的規則(圖 2-5):
§2.4.2 の畳み込みの代数は、そのままブロック図の規則に翻訳される(図 2-5):
A system $h_i[n]$ is the inverse(反系統) of $h[n]$ if their cascade is the identity system:
系統 $h_i[n]$ 是 $h[n]$ 的反系統(inverse system),如果兩者串聯後等於恆等系統:
システム $h_i[n]$ が $h[n]$ の逆システム(反系統)であるとは、両者を縦続接続したものが恒等システムになることをいう:
Linear: superposition $T\{ax_1+bx_2\}=aT\{x_1\}+bT\{x_2\}$ (zero in → zero out is necessary). Time-invariant: $x[n-n_0]\mapsto y[n-n_0]$. Causal: no future samples. BIBO stable: bounded in → bounded out.
線性:疊加原理 $T\{ax_1+bx_2\}=aT\{x_1\}+bT\{x_2\}$(零輸入必須給出零輸出,是必要條件)。非時變:$x[n-n_0]\mapsto y[n-n_0]$。因果:不使用未來樣本。BIBO 穩定:有界輸入給出有界輸出。
線形:重ね合わせ $T\{ax_1+bx_2\}=aT\{x_1\}+bT\{x_2\}$(ゼロ入力→ゼロ出力は必要条件)。時不変:$x[n-n_0]\mapsto y[n-n_0]$。因果的:未来の標本を使わない。BIBO 安定:有界入力→有界出力。
$x[n]=\sum_k x[k]\delta[n-k]$, so $y[n]=\sum_k x[k]h[n-k]=x[n]*h[n]$. The impulse response $h[n]=T\{\delta[n]\}$ fully characterizes the system.
$x[n]=\sum_k x[k]\delta[n-k]$,因此 $y[n]=\sum_k x[k]h[n-k]=x[n]*h[n]$。脈衝響應 $h[n]=T\{\delta[n]\}$ 完整刻畫了整個系統。
$x[n]=\sum_k x[k]\delta[n-k]$ なので $y[n]=\sum_k x[k]h[n-k]=x[n]*h[n]$。インパルス応答 $h[n]=T\{\delta[n]\}$ がシステムを完全に特徴づける。
Commutative, associative, distributive; $x*\delta[n-n_0]=x[n-n_0]$. Length: $N+M-1$; start index $n_x+n_h$. Matrix view: Toeplitz $H$, $y=Hx$.
滿足交換律、結合律與分配律;$x*\delta[n-n_0]=x[n-n_0]$。長度:$N+M-1$;起始索引:$n_x+n_h$。矩陣觀點:Toeplitz 矩陣 $H$,$y=Hx$。
交換法則・結合法則・分配法則が成り立ち、$x*\delta[n-n_0]=x[n-n_0]$。長さ:$N+M-1$、開始インデックス $n_x+n_h$。行列で見ると Toeplitz 行列 $H$ による $y=Hx$。
Causal ⇔ $h[n]=0,\ n<0$. Stable ⇔ $\sum|h[k]|<\infty$. Cascade: $h_1*h_2$. Parallel: $h_1+h_2$. Inverse: $h*h_i=\delta$.
因果 ⇔ $n<0$ 時 $h[n]=0$。穩定 ⇔ $\sum|h[k]|<\infty$。串聯:$h_1*h_2$。並聯:$h_1+h_2$。反系統:$h*h_i=\delta$。
因果的 ⇔ $h[n]=0,\ n<0$。安定 ⇔ $\sum|h[k]|<\infty$。縦続:$h_1*h_2$。並列:$h_1+h_2$。逆システム:$h*h_i=\delta$。
All three problems of ICE503 Homework #2, with full worked solutions.
ICE503 作業 #2 的全部三題,附完整解答。
ICE503 宿題 #2 の全 3 問を、完全な解答つきで掲載する。
Problem: For each of the following systems, determine whether the system is (1) linear, (2) time-invariant, and (3) causal.
題目:對下列各系統,判斷它是否 (1) 線性、(2) 非時變、(3) 因果。
問題:次の各システムについて、(1) 線形か、(2) 時不変か、(3) 因果的か、を判定せよ。
(a) $y[n] = a^2 x[n] - b$, $a$ and $b$ non-zero constants
(b) $y[n] = x[an-b]$, $a$ and $b$ non-zero positive constants
(c) $y[n] = \dfrac{1}{M}\Bigl(x[n] + \displaystyle\sum_{k=1}^{(M-1)/2}\bigl(x[n-k]+x[n+k]\bigr)\Bigr)$ ($M$ odd)
(d) $y[n] = \log_2\bigl(\lvert x[n]\rvert\bigr)$
(a) $y[n] = a^2 x[n] - b$, $a$、$b$ 為非零常數
(b) $y[n] = x[an-b]$, $a$、$b$ 為非零正常數
(c) $y[n] = \dfrac{1}{M}\Bigl(x[n] + \displaystyle\sum_{k=1}^{(M-1)/2}\bigl(x[n-k]+x[n+k]\bigr)\Bigr)$ ($M$ 為奇數)
(d) $y[n] = \log_2\bigl(\lvert x[n]\rvert\bigr)$
(a) $y[n] = a^2 x[n] - b$、 $a$ と $b$ はゼロでない定数
(b) $y[n] = x[an-b]$、 $a$ と $b$ はゼロでない正の定数
(c) $y[n] = \dfrac{1}{M}\Bigl(x[n] + \displaystyle\sum_{k=1}^{(M-1)/2}\bigl(x[n-k]+x[n+k]\bigr)\Bigr)$ ($M$ は奇数)
(d) $y[n] = \log_2\bigl(\lvert x[n]\rvert\bigr)$
(a) $y[n]=a^2x[n]-b$ — not linear; time-invariant; causal.
(a) $y[n]=a^2x[n]-b$ —— 非線性;非時變;因果。
(a) $y[n]=a^2x[n]-b$——線形でない。時不変。因果的。
Linearity: zero input gives $y[n]=-b\neq0$, so the system fails the zero-in/zero-out necessary condition → nonlinear (it is affine). Explicitly, $T\{x_1+x_2\} = a^2(x_1+x_2)-b$ but $T\{x_1\}+T\{x_2\} = a^2(x_1+x_2)-2b$.
線性:零輸入會得到 $y[n]=-b\neq0$,違反「零輸入給出零輸出」這個必要條件 → 非線性(它是仿射系統)。明確寫出來:$T\{x_1+x_2\} = a^2(x_1+x_2)-b$,但 $T\{x_1\}+T\{x_2\} = a^2(x_1+x_2)-2b$。
線形性:入力をゼロにすると $y[n]=-b\neq0$ となり、ゼロ入力→ゼロ出力という必要条件を満たさない → 非線形(アフィンである)。明示的に書けば、$T\{x_1+x_2\} = a^2(x_1+x_2)-b$ である一方、$T\{x_1\}+T\{x_2\} = a^2(x_1+x_2)-2b$ となる。
Time invariance: shifted input $x[n-n_0]$ → $a^2x[n-n_0]-b = y[n-n_0]$. The rule has no explicit dependence on $n$ → time-invariant.
非時變性:把輸入平移成 $x[n-n_0]$ → $a^2x[n-n_0]-b = y[n-n_0]$。這條規則不含 $n$ 的顯式相依 → 非時變。
時不変性:シフトした入力 $x[n-n_0]$ → $a^2x[n-n_0]-b = y[n-n_0]$。規則は $n$ に陽に依存しない → 時不変。
Causality: $y[n]$ uses only $x[n]$ (memoryless) → causal.
因果性:$y[n]$ 只用到 $x[n]$(無記憶)→ 因果。
因果性:$y[n]$ は $x[n]$ しか使わない(無記憶)→ 因果的。
(b) $y[n]=x[an-b]$ — linear; not time-invariant; not causal (in general).
(b) $y[n]=x[an-b]$ —— 線性;非時變不成立;一般而言不因果。
(b) $y[n]=x[an-b]$——線形。時不変でない。(一般には)因果的でない。
Linearity: for input $\alpha x_1+\beta x_2$ the output is $\alpha x_1[an-b]+\beta x_2[an-b] = \alpha y_1[n]+\beta y_2[n]$ → linear (any system that merely re-indexes the input is linear).
線性:輸入 $\alpha x_1+\beta x_2$ 的輸出為 $\alpha x_1[an-b]+\beta x_2[an-b] = \alpha y_1[n]+\beta y_2[n]$ → 線性(任何只對輸入重新索引的系統都是線性的)。
線形性:入力 $\alpha x_1+\beta x_2$ に対する出力は $\alpha x_1[an-b]+\beta x_2[an-b] = \alpha y_1[n]+\beta y_2[n]$ → 線形(入力の添字を付け替えるだけのシステムは必ず線形である)。
Time invariance: shift the input: $w[n]=x[n-n_0]$ gives $T\{w\} = w[an-b] = x[an-b-n_0]$, while the shifted output is $y[n-n_0] = x[a(n-n_0)-b] = x[an-b-an_0]$. These agree for all $x$ only if $an_0=n_0$ for every $n_0$, i.e. only if $a=1$. For a general positive constant $a\neq1$ → not time-invariant (time-scaling re-labels the clock).
非時變性:把輸入平移:$w[n]=x[n-n_0]$ 給出 $T\{w\} = w[an-b] = x[an-b-n_0]$,而平移後的輸出是 $y[n-n_0] = x[a(n-n_0)-b] = x[an-b-an_0]$。兩者對所有 $x$ 都相等的條件是對每個 $n_0$ 都有 $an_0=n_0$,也就是 $a=1$。對一般的正常數 $a\neq1$ → 時變(時間縮放把時鐘重新標號了)。
時不変性:入力をシフトすると、$w[n]=x[n-n_0]$ について $T\{w\} = w[an-b] = x[an-b-n_0]$ となる一方、シフトした出力は $y[n-n_0] = x[a(n-n_0)-b] = x[an-b-an_0]$ である。これらがすべての $x$ について一致するのは、あらゆる $n_0$ で $an_0=n_0$、すなわち $a=1$ のときだけである。一般の正の定数 $a\neq1$ では → 時不変でない(時間軸のスケーリングは時計のラベルを付け替えてしまう)。
Causality: $y[n]$ reads the input at time $an-b$. Causality requires $an-b\le n$, i.e. $(a-1)n\le b$, for every $n$ — impossible for $a>1$ when $n$ grows (e.g. $a=2,b=1$: $y[2]=x[3]$, a future sample) → not causal in general. (In the special case $a=1$ the system is the pure delay $x[n-b]$, $b>0$, which is both time-invariant and causal.)
因果性:$y[n]$ 讀取的是時刻 $an-b$ 的輸入。因果性要求對每一個 $n$ 都有 $an-b\le n$,即 $(a-1)n\le b$——當 $a>1$ 而 $n$ 增大時不可能成立(例如 $a=2,b=1$:$y[2]=x[3]$,用到未來樣本)→ 一般而言不因果。(在 $a=1$ 的特例下,系統就是純延遲 $x[n-b]$、$b>0$,既非時變又因果。)
因果性:$y[n]$ は時刻 $an-b$ の入力を読む。因果性にはあらゆる $n$ について $an-b\le n$、すなわち $(a-1)n\le b$ が必要だが、$a>1$ では $n$ が大きくなると成り立たない(たとえば $a=2,b=1$ なら $y[2]=x[3]$ で未来の標本である)→ 一般には因果的でない。($a=1$ という特別な場合には、このシステムは純粋な遅延 $x[n-b]$、$b>0$ となり、時不変かつ因果的である。)
(c) Centered moving average — linear; time-invariant; not causal.
(c) 置中移動平均 —— 線性;非時變;不因果。
(c) 中心化移動平均——線形。時不変。因果的でない。
Write $y[n] = \frac{1}{M}\sum_{k=-(M-1)/2}^{(M-1)/2} x[n-k]$, a symmetric window of odd length $M$ centered on $n$.
把它寫成 $y[n] = \frac{1}{M}\sum_{k=-(M-1)/2}^{(M-1)/2} x[n-k]$,這是一個以 $n$ 為中心、長度為奇數 $M$ 的對稱窗口。
$y[n] = \frac{1}{M}\sum_{k=-(M-1)/2}^{(M-1)/2} x[n-k]$ と書ける。$n$ を中心とする、長さが奇数 $M$ の対称な窓である。
Linearity: a weighted sum of input samples with constant weights satisfies superposition term by term → linear.
線性:以常數權重對輸入樣本加權求和,逐項都滿足疊加原理 → 線性。
線形性:定数の重みによる入力標本の重み付き和は、項ごとに重ね合わせを満たす → 線形。
Time invariance: replacing $x[\cdot]\to x[\cdot-n_0]$ shifts every term identically: $T\{x[n-n_0]\} = \frac1M\sum_k x[n-n_0-k] = y[n-n_0]$ → time-invariant.
非時變性:把 $x[\cdot]\to x[\cdot-n_0]$ 代入,每一項都平移同樣多:$T\{x[n-n_0]\} = \frac1M\sum_k x[n-n_0-k] = y[n-n_0]$ → 非時變。
時不変性:$x[\cdot]\to x[\cdot-n_0]$ と置き換えると、どの項も同じだけずれる:$T\{x[n-n_0]\} = \frac1M\sum_k x[n-n_0-k] = y[n-n_0]$ → 時不変。
Causality: the terms $x[n+k]$ for $k=1,\dots,(M-1)/2$ are future samples → not causal.
因果性:$k=1,\dots,(M-1)/2$ 的 $x[n+k]$ 各項都是未來樣本 → 不因果。
因果性:$k=1,\dots,(M-1)/2$ の項 $x[n+k]$ は未来の標本である → 因果的でない。
(d) $y[n]=\log_2(|x[n]|)$ — not linear; time-invariant; causal.
(d) $y[n]=\log_2(|x[n]|)$ —— 非線性;非時變;因果。
(d) $y[n]=\log_2(|x[n]|)$——線形でない。時不変。因果的。
Linearity: scaling test: input $\alpha x[n]$ gives $\log_2(|\alpha|\,|x[n]|) = \log_2|\alpha| + \log_2|x[n]| \neq \alpha\,\log_2|x[n]|$ → nonlinear (the log turns scaling into an additive offset).
線性:比例性測試:輸入 $\alpha x[n]$ 得到 $\log_2(|\alpha|\,|x[n]|) = \log_2|\alpha| + \log_2|x[n]| \neq \alpha\,\log_2|x[n]|$ → 非線性(對數把比例縮放變成了相加的位移)。
線形性:スケーリングの判定:入力 $\alpha x[n]$ に対して $\log_2(|\alpha|\,|x[n]|) = \log_2|\alpha| + \log_2|x[n]| \neq \alpha\,\log_2|x[n]|$ → 非線形(対数はスケーリングを加法的なオフセットに変えてしまう)。
Time invariance: the rule is a fixed memoryless nonlinearity, independent of $n$: shifted input → shifted output → time-invariant.
非時變性:這條規則是固定的無記憶非線性映射,與 $n$ 無關:輸入平移 → 輸出平移 → 非時變。
時不変性:この規則は $n$ に依存しない、固定された無記憶の非線形性である。入力をシフトすれば出力もシフトする → 時不変。
Causality: depends only on $x[n]$ → causal.
因果性:只取決於 $x[n]$ → 因果。
因果性:$x[n]$ だけに依存する → 因果的。
| System | Linear | Time-invariant | Causal |
|---|---|---|---|
| (a) $a^2x[n]-b$ | No | Yes | Yes |
| (b) $x[an-b]$ | Yes | No (unless $a{=}1$) | No (unless $a{=}1$) |
| (c) centered MA | Yes | Yes | No |
| (d) $\log_2|x[n]|$ | No | Yes | Yes |
| 系統 | 線性 | 非時變 | 因果 |
|---|---|---|---|
| (a) $a^2x[n]-b$ | 否 | 是 | 是 |
| (b) $x[an-b]$ | 是 | 否(除非 $a{=}1$) | 否(除非 $a{=}1$) |
| (c) 置中移動平均 | 是 | 是 | 否 |
| (d) $\log_2|x[n]|$ | 否 | 是 | 是 |
| システム | 線形 | 時不変 | 因果的 |
|---|---|---|---|
| (a) $a^2x[n]-b$ | いいえ | はい | はい |
| (b) $x[an-b]$ | はい | いいえ($a{=}1$ を除く) | いいえ($a{=}1$ を除く) |
| (c) 中心化移動平均 | はい | はい | いいえ |
| (d) $\log_2|x[n]|$ | いいえ | はい | はい |
Problem: The system $T$ is known to be time-invariant. When the inputs are $x_1[n]$, $x_2[n]$, $x_3[n]$, the responses are $y_1[n]$, $y_2[n]$, $y_3[n]$ (Figure 1 of the homework):
題目:已知系統 $T$ 是非時變的。當輸入為 $x_1[n]$、$x_2[n]$、$x_3[n]$ 時,對應的響應分別是 $y_1[n]$、$y_2[n]$、$y_3[n]$(作業的圖 1):
問題:システム $T$ は時不変であることが分かっている。入力が $x_1[n]$、$x_2[n]$、$x_3[n]$ のとき、応答はそれぞれ $y_1[n]$、$y_2[n]$、$y_3[n]$ であった(宿題の図 1):
Determine whether the system $T$ is linear or nonlinear.
請判斷系統 $T$ 是線性還是非線性。
システム $T$ が線形か非線形かを判定せよ。
Strategy: assume $T$ is linear, combine that assumption with the given fact that $T$ is time-invariant, and look for a contradiction among the three input–output pairs.
策略:先假設 $T$ 是線性的,把這個假設與題目給定的「$T$ 非時變」合起來用,然後在三組輸入輸出對之間找矛盾。
方針:$T$ が線形であると仮定し、それを「$T$ は時不変である」という与えられた事実と組み合わせて、3 組の入出力の間に矛盾を探す。
Step 1 — relate the inputs. Notice that $$x_1[n] = \delta[n] + 2\,\delta[n-1] = \delta[n] + x_2[n].$$ If $T$ were linear (additivity), the response to $\delta[n]$ would have to be $$h[n] \;=\; T\{\delta[n]\} \;=\; y_1[n] - y_2[n] = 2\delta[n-1] + 3\delta[n-2] - 2\delta[n-2] - 4\delta[n-3] = 2\delta[n-1] + \delta[n-2] - 4\delta[n-3].$$
第 1 步 —— 把輸入彼此關聯起來。注意到 $$x_1[n] = \delta[n] + 2\,\delta[n-1] = \delta[n] + x_2[n].$$ 如果 $T$ 是線性的(可加性),那麼對 $\delta[n]$ 的響應必須是 $$h[n] \;=\; T\{\delta[n]\} \;=\; y_1[n] - y_2[n] = 2\delta[n-1] + 3\delta[n-2] - 2\delta[n-2] - 4\delta[n-3] = 2\delta[n-1] + \delta[n-2] - 4\delta[n-3].$$
手順 1 — 入力どうしを関係づける。次に注目する: $$x_1[n] = \delta[n] + 2\,\delta[n-1] = \delta[n] + x_2[n].$$ もし $T$ が線形(加法的)なら、$\delta[n]$ に対する応答は $$h[n] \;=\; T\{\delta[n]\} \;=\; y_1[n] - y_2[n] = 2\delta[n-1] + 3\delta[n-2] - 2\delta[n-2] - 4\delta[n-3] = 2\delta[n-1] + \delta[n-2] - 4\delta[n-3].$$ でなければならない。
Step 2 — invoke time invariance. $T$ is time-invariant, so the response to $x_3[n] = \delta[n-4]$ would have to be $h[n-4]$: $$T\{\delta[n-4]\} = 2\,\delta[n-5] + \delta[n-6] - 4\,\delta[n-7],$$ a sequence supported on $n = 5, 6, 7$.
第 2 步 —— 用上非時變性。$T$ 是非時變的,所以對 $x_3[n] = \delta[n-4]$ 的響應必須是 $h[n-4]$: $$T\{\delta[n-4]\} = 2\,\delta[n-5] + \delta[n-6] - 4\,\delta[n-7],$$ 這是一條支撐在 $n = 5, 6, 7$ 的序列。
手順 2 — 時不変性を使う。$T$ は時不変なので、$x_3[n] = \delta[n-4]$ に対する応答は $h[n-4]$ でなければならない: $$T\{\delta[n-4]\} = 2\,\delta[n-5] + \delta[n-6] - 4\,\delta[n-7],$$ これは $n = 5, 6, 7$ を台にもつ系列である。
Step 3 — compare with the measured response. The actual response is $$y_3[n] = 3\,\delta[n+2] + 2\,\delta[n+1],$$ supported on $n = -2, -1$. The two disagree completely → contradiction.
第 3 步 —— 與實測響應比較。實際的響應是 $$y_3[n] = 3\,\delta[n+2] + 2\,\delta[n+1],$$ 支撐在 $n = -2, -1$。兩者完全不一致 → 矛盾。
手順 3 — 実測の応答と比べる。実際の応答は $$y_3[n] = 3\,\delta[n+2] + 2\,\delta[n+1],$$ であり、台は $n = -2, -1$ である。両者はまったく一致しない → 矛盾。
Cross-check (independent contradiction). Since $x_2[n] = 2\,\delta[n-1] = 2\,x_3[n+3]$: by time invariance the response to $x_3[n+3]$ is $y_3[n+3] = 3\delta[n+5]+2\delta[n+4]$; if $T$ were also linear (homogeneity) we would need $y_2[n] = 2\,y_3[n+3] = 6\,\delta[n+5] + 4\,\delta[n+4]$. But the measured $y_2[n] = 2\delta[n-2]+4\delta[n-3]$ — again a contradiction, confirming nonlinearity.
交叉驗證(另一個獨立的矛盾)。因為 $x_2[n] = 2\,\delta[n-1] = 2\,x_3[n+3]$:由非時變性,對 $x_3[n+3]$ 的響應是 $y_3[n+3] = 3\delta[n+5]+2\delta[n+4]$;若 $T$ 同時是線性的(齊次性),則必須有 $y_2[n] = 2\,y_3[n+3] = 6\,\delta[n+5] + 4\,\delta[n+4]$。但實測的 $y_2[n] = 2\delta[n-2]+4\delta[n-3]$ —— 又是一個矛盾,確認系統非線性。
別ルートでの確認(独立な矛盾)。$x_2[n] = 2\,\delta[n-1] = 2\,x_3[n+3]$ であるから、時不変性により $x_3[n+3]$ に対する応答は $y_3[n+3] = 3\delta[n+5]+2\delta[n+4]$ である。もし $T$ が線形(斉次的)でもあるなら $y_2[n] = 2\,y_3[n+3] = 6\,\delta[n+5] + 4\,\delta[n+4]$ でなければならない。しかし実測は $y_2[n] = 2\delta[n-2]+4\delta[n-3]$ であり、ここでも矛盾する。非線形であることが裏づけられた。
Remark: note the logic direction — the data can disprove linearity, but no finite set of input–output pairs could ever prove it.
附註:請留意論證的方向——這些資料可以推翻線性,但任何有限多組輸入輸出對都無法證明線性。
注意:論理の向きに注意せよ——データは線形性を反証できるが、有限個の入出力の組がそれを証明することは決してできない。
Problem: The input signal is
$$x[n] = \delta[n] + 3\,\delta[n-1] + 7\,\delta[n-2] + 2\,\delta[n-3] + 4\,\delta[n-4]$$
and the output of a 5-point moving average is
$$y[n] = \frac{1}{5}\sum_{k=0}^{4} x[n-k].$$
(a) Use the stem function to plot $x[n]$.
(b) Use a for loop to calculate $y[n]$.
(c) Use the convolution function to calculate $y[n]$ (results of (b) and (c) must agree).
(d) Use stem to plot $y[n]$.
題目:輸入訊號為
$$x[n] = \delta[n] + 3\,\delta[n-1] + 7\,\delta[n-2] + 2\,\delta[n-3] + 4\,\delta[n-4]$$
而 5 點移動平均的輸出為
$$y[n] = \frac{1}{5}\sum_{k=0}^{4} x[n-k].$$
(a) 用 stem 函式畫出 $x[n]$。
(b) 用 for 迴圈計算 $y[n]$。
(c) 用卷積函式計算 $y[n]$((b) 與 (c) 的結果必須一致)。
(d) 用 stem 畫出 $y[n]$。
問題:入力信号を
$$x[n] = \delta[n] + 3\,\delta[n-1] + 7\,\delta[n-2] + 2\,\delta[n-3] + 4\,\delta[n-4]$$
とし、5 点移動平均の出力を
$$y[n] = \frac{1}{5}\sum_{k=0}^{4} x[n-k].$$
とする。(a) stem 関数で $x[n]$ を描け。(b) for ループで $y[n]$ を計算せよ。(c) 畳み込み関数で $y[n]$ を計算せよ((b) と (c) の結果は一致しなければならない)。(d) stem で $y[n]$ を描け。
Setup. The input vector is $x = [1\;3\;7\;2\;4]$ on $n=0,\dots,4$ ($N=5$) and the filter is the FIR impulse response $h[n]=\frac15$ for $0\le n\le4$ ($M=5$). The output has length $N+M-1 = 9$, on $n = 0,\dots,8$.
設定。輸入向量是 $n=0,\dots,4$ 上的 $x = [1\;3\;7\;2\;4]$($N=5$),濾波器是 FIR 脈衝響應 $h[n]=\frac15$($0\le n\le4$,$M=5$)。輸出長度為 $N+M-1 = 9$,落在 $n = 0,\dots,8$。
準備。入力ベクトルは $n=0,\dots,4$ 上の $x = [1\;3\;7\;2\;4]$($N=5$)であり、フィルタは $0\le n\le4$ で $h[n]=\frac15$ となる FIR のインパルス応答である($M=5$)。出力の長さは $N+M-1 = 9$ で、$n = 0,\dots,8$ にわたる。
clc; clear; close all;
n = 0:4; % time index of the input
x = [1 3 7 2 4]; % x[n] sample values
N = length(x); % input length
M = 5; % moving-average length
%% (a) plot x[n] with stem
figure(1)
stem(n, x, 'filled');
xlabel('n'); ylabel('x[n]');
title('Input signal x[n]');
grid on;
%% (b) compute y[n] with a for loop
x_padded = [x zeros(1, M-1)]; % zero-pad to handle the boundary
y_loop = zeros(1, N + M - 1); % preallocate the output
for i = 1:(N + M - 1) % loop over output samples
sum_val = 0;
for k = 0:(M - 1) % accumulate the M-sample window
if (i - k) > 0 % keep the index valid (x[n]=0 for n<0)
sum_val = sum_val + x_padded(i - k);
end
end
y_loop(i) = sum_val / M; % the average
end
%% (c) compute y[n] with conv
h = (1/M) * ones(1, M); % MA impulse response h[n] = 1/5, n = 0..4
y_conv = conv(x, h); % identical to y_loop
%% (d) plot y[n] with stem
n_out = 0:(N + M - 2); % output time index, length N+M-1
figure(2)
subplot(2,1,1)
stem(n_out, y_loop, 'filled');
xlabel('n'); ylabel('y[n]');
title('Output y[n] (for loop)');
grid on;
subplot(2,1,2)
stem(n_out, y_conv, 'filled');
xlabel('n'); ylabel('y[n]');
title('Output y[n] (conv)');
grid on;
Hand check (and program output). $y[n] = \frac15\,(x*\mathbf{1}_5)[n]$: each output is the sum of the (at most five) input samples in the window $n-4,\dots,n$, divided by 5:
手算驗證(也就是程式的輸出)。$y[n] = \frac15\,(x*\mathbf{1}_5)[n]$:每一個輸出都是窗口 $n-4,\dots,n$ 內(至多五個)輸入樣本的總和除以 5:
手計算での確認(およびプログラムの出力)。$y[n] = \frac15\,(x*\mathbf{1}_5)[n]$:各出力は、窓 $n-4,\dots,n$ に入る(最大 5 個の)入力標本の和を 5 で割ったものである:
| $n$ | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
|---|---|---|---|---|---|---|---|---|---|
| window sum | 1 | 4 | 11 | 13 | 17 | 16 | 13 | 6 | 4 |
| $y[n]$ | 0.2 | 0.8 | 2.2 | 2.6 | 3.4 | 3.2 | 2.6 | 1.2 | 0.8 |
| $n$ | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
|---|---|---|---|---|---|---|---|---|---|
| 窗口總和 | 1 | 4 | 11 | 13 | 17 | 16 | 13 | 6 | 4 |
| $y[n]$ | 0.2 | 0.8 | 2.2 | 2.6 | 3.4 | 3.2 | 2.6 | 1.2 | 0.8 |
| $n$ | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
|---|---|---|---|---|---|---|---|---|---|
| 窓内の和 | 1 | 4 | 11 | 13 | 17 | 16 | 13 | 6 | 4 |
| $y[n]$ | 0.2 | 0.8 | 2.2 | 2.6 | 3.4 | 3.2 | 2.6 | 1.2 | 0.8 |
The loop and conv give exactly the
same vector, as required — the nested loop literally evaluates the convolution sum
$y[n]=\sum_k h[k]\,x[n-k]$ that conv
implements. Sanity checks from §2.4.4: length $5+5-1=9$ ✓; first sample
$y[0]=x[0]h[0]=0.2$ ✓; $\sum_n y[n] = 17\cdot1 = 17$, and indeed $\sum x = 17$, $\sum h = 1$ ✓.
迴圈與 conv 給出完全相同的向量,正如題目要求——巢狀迴圈其實就是逐字地在計算 conv 所實作的那個卷積和 $y[n]=\sum_k h[k]\,x[n-k]$。用 §2.4.4 的檢查法驗算:長度 $5+5-1=9$ ✓;首樣本 $y[0]=x[0]h[0]=0.2$ ✓;$\sum_n y[n] = 17\cdot1 = 17$,而確實 $\sum x = 17$、$\sum h = 1$ ✓。
ループと conv は要求どおりまったく同じベクトルを与える——入れ子のループは、conv が実装している畳み込み和 $y[n]=\sum_k h[k]\,x[n-k]$ を文字どおり評価しているからである。§2.4.4 の検算:長さ $5+5-1=9$ ✓、最初の標本 $y[0]=x[0]h[0]=0.2$ ✓、$\sum_n y[n] = 17\cdot1 = 17$ で、実際 $\sum x = 17$、$\sum h = 1$ ✓。