--- title: 第三~四週 tags: 訊號與系統 --- # Convolution 卷積 ✽ 在 Time Domainn 中,每個訊號都可以以 **權重過的 $\delta(t)$ 進行位移的和**表示 $$ DT:x[n] = ...x[-1]\delta[n-(-1)]+x[0]\delta[n-0]+x[1]\delta[n-1]+... $$ 或者更簡潔的表示為 $$ DT:x[n]=\sum_{k=-\infty}^{\infty} x[k]\delta [n-k]\\ CT:x(t)=\int_{-\infty }^{\infty}x(\tau)\delta (t-\tau) d\tau $$ 如果他經過了一個線性系統,根據線性系統的性質可以發現: $$ DT:y[n]=H\{x[n]\}=\sum_{k=-\infty}^{\infty} x[k]H\{\delta [n-k]\}\\ CT:y(t)=H\left \{ x(t) \right \}=H\left \{ \int_{-\infty }^{\infty}x(\tau)\delta (t-\tau) d\tau \right \} = \int_{-\infty }^{\infty}x(\tau)H\left \{ \delta (t-\tau) \right \} d\tau\\ h(t)=H\left \{ \delta (t) \right \} \equiv Impulse \ response \ of \ the \ LTI \ system \ H \\ DT:y[n]=x[n] \ast h[n]=\sum_{k=-\infty}^{\infty} x[k]h[n-k]\\ CT:y(t)=x(t) \ast h(t)=\int_{-\infty }^{\infty}x(\tau)h(t-\tau)d\tau $$ 這是一個運算符號,那他做了什麼事情呢? >[name=郭昌興]它毀滅了我的作息 # 物理意義 因為到時候函數 y 會以 $t/n$ 的區間的方式表示值,如 $$ \begin{eqnarray} y(t) & = & \left\{\begin{matrix} 1, & t>0\\ 0, & t<0 \end{matrix}\right. \ \ \ y[n] & = & \left\{\begin{matrix} 1, & n\ge 0\\ 0, & n<0 \end{matrix}\right. \end{eqnarray} $$ 那我們就將 $t/n$ 分段討論,也就是當成常數 此時先跳脫 級數/積分 的思維 將函數 $h$,換成以 $k/\tau$ 作為變數 $$ DT:x[k]h[-(k-n)]\\ CT:x(\tau)h(-(\tau-t)) $$ 會發現只是對函數 $h$ 做了翻轉跟位移後,再乘上一開始的函數 $x$ 這時候就可以開始對 $t/n$ 分段討論了 將 $t/n$ 從 $-\infty$ 移到 $\infty$ 看看 $h$ 對 $x$ 有沒有重疊的部分,有重疊代表乘積是有值的 連續的情況中,從左邊移到右邊,碰到一次 $x$ 的邊界就停下來 並記錄小於該邊界值的範圍 # 舉例 $x(t)=(t-1)[u(t-1)-u(t-3)]$ and $h(t)=u(t+1)-2u(t-2)$ 先畫出兩者的圖形 $$ \begin{eqnarray} x(\tau) & = & \left\{\begin{matrix} \tau-1, & 1<\tau<2\\ 0, & other \end{matrix}\right. \end{eqnarray} $$ ![](https://drive.google.com/uc?id=1EiQHrDCIYhymerwCNmEuVSu33OlYZvVM&export=download ) $$ \begin{eqnarray} h(\tau) & = & \left\{\begin{matrix} 1, & -1<\tau<2\\ -1, & \tau>2\\ 0 & other \end{matrix}\right. \end{eqnarray} $$ ![](https://drive.google.com/uc?id=1cnIrfLT0m8AMnin-hVrSz3QppInYoCcN&export=download) $$ h(-\tau) $$ ![](https://drive.google.com/uc?id=1X87woieZaTQ4gR603Yh_HOah3no94IJh&export=download) 上圖中,假設將圖形整體對 0 點往右移 t 格 則邊界的相對位置如上圖所標示 ## Case 1 $\ \ t+1<1$ 此時 $h$ 的右端正要碰到 $x$ 的左端 但是圖形都沒有交集,所以乘積為 0 ![](https://drive.google.com/uc?id=1j7w6R1k9dttvFLNdg2l_45xiAEBQ5c1m&export=download) ## Case 2 $\ \ 1\le t+1 <3 ,\ 1<\tau<t+1$ 此時 $h$ 的右端介於 $x$ 的左端和右端之間 所以這區間的面積就是 $$ \int_{1}^{t+1}x(\tau)h(t-\tau)d\tau = \int_{1}^{t+1}(\tau-1)×1d\tau $$ ![](https://drive.google.com/uc?id=1Cqf51DyHgwE3cWfKD_fYQw9ABt4XEj22&export=download) ## Case 3 $\ \ 3\le t+1<4,\ 1<\tau<3$ 此時 $h$ 的右端在 $x$ 的右端右邊 由中間的區段提供乘積 這區間的面積就是 $$ \int_{1}^{3}x(\tau)h(t-\tau)d\tau = \int_{1}^{3}(\tau-1)×1d\tau $$ ![](https://drive.google.com/uc?id=1YkpzxVUX5lNjbJiIh-sG6_eUA7EdC4Dk&export=download) ...雖然上圖看似重合,但就當作他們是很接近的吧... ## Case 4 $\ \ 4\le t+1<6,\ t-2<\tau<3$ 此時 $h$ 的左端在 $x$ 的左端和右端之間 這區間的面積就是 $$ \int_{t-2}^{3}x(\tau)h(t-\tau)d\tau = \int_{t-2}^{3}(\tau-1)×1d\tau $$ ![](https://drive.google.com/uc?id=1Q48vRZCD2UHdUG3pOvkjRvtJ93w14Cc_&export=download) ...雖然上圖看似重合,但就當作他們是很接近的吧... ## Case 5 $\ \ 6\le t+1,\ 1<\tau<3$ 此時 $h$ 的左端在 $x$ 右端的右邊 這時換 $h$ 負的區域提供乘積 這區間的面積就是 $$ \int_{t-2}^{3}x(\tau)h(t-\tau)d\tau = \int_{t-2}^{3}(\tau-1)×(-1)d\tau $$ ![](https://drive.google.com/uc?id=1DEF-QshznJuvQBNgXYVLdZHuEqBu7Pr7&export=download) ...雖然上圖看似重合,但就當作他們是很接近的吧... --- 以上,你就成功的使用卷積了 可以將結果表示成 $$ \begin{eqnarray} y(t) & = & \left\{\begin{matrix} 0, & 0 < t \\ \frac{t^2}{2}, & 0 \le t < 2\\ 2, & 2 \le t < 3\\ -t^2+6t-7, & 3 \le t < 5\\ -2, & 5 \le t\\ \end{matrix}\right. \end{eqnarray} $$ DT 也是用相同的方法 不過 DT 可以用另一種解法... # 推廣性質 在LTI(linear-time invariant)的系統中,訊號將具備以下運算特質 #### 分配律(Distributive) $$ x(t)\ast h_{1}(t)+x(t)\ast h_{2}(t)=x(t)\ast \{h_{1}(t)+h_{2}(t)\}\\ x[n]\ast h_{1}[n]+x[n]\ast h_{2}[n]=x[n]\ast \{h_{1}[n]+h_{2}[n]\} $$ #### 結合律(Associative) $$ \{x(t)\ast h_{1}(t)\}\ast h_{2}(t)=x(t)\ast \{h_{1}(t)\ast h_{2}(t)\}\\ \{x[n]\ast h_{1}[n]\}\ast h_{2}[n]=x[n]\ast \{h_{1}[n]\ast h_{2}[n]\} $$ #### 交換律(Commutative) $$ h_{1}(t)\ast h_{2}(t) = h_{2}(t)\ast h_{1}(t)\\ h_{1}[n]\ast h_{2}[n] = h_{2}[n]\ast h_{1}[n] $$ >[name=郭昌興]我話就說到這裡 --- # Memoryless LTI Systems 如果輸出訊號 y 只有跟==當前的輸入值 x==有關的話 >也就是 x[n] 或 x(t) 就是沒有記憶性的 Memoryless $$ DT:y[n]=x[n] \ast h[n]=h[n] \ast x[n]=\sum_{k=-\infty}^{\infty} h[k]x[n-k]\\ CT:y(t)=x(t) \ast h(t)=h(t) \ast x(t)=\int_{-\infty }^{\infty}h(\tau)x(t-\tau)d\tau $$ 上面藉由交換律對調兩個函數,再根據卷積的定義,可以得到等號最後面的樣子 由於是 Memoryless,所以就不考慮 $x[n-k]$ 或 $x(n-\tau)$ 或者說,讓他們都乘上 0,而這正好就是 $\delta$ 在做的事情 於是可以得到結論: $$ 當且僅當\\ h[n] = c\delta[n]\ \ or \ \ h(t)=c\delta(t)\\ y\ 是\ Memoryless $$ 這樣的話只有 x[n] 或 x(t) 會保留下來 # Causal LTI Systems 如果輸出訊號 y 只有跟==過去或當前的輸入值 x==有關的話 就是 Causal $$ DT:y[n]=x[n] \ast h[n]=h[n] \ast x[n]=\sum_{k=-\infty}^{\infty} h[k]x[n-k]\\ CT:y(t)=x(t) \ast h(t)=h(t) \ast x(t)=\int_{-\infty }^{\infty}h(\tau)x(t-\tau)d\tau $$ 一樣也是用交換過的 所以只要 $$ h[n] = 0\ for\ k<0\\ or \\ h(t)=0\ for\ t<0 $$ # Stable LTI Systems # Step Response $$ s[n]=h[n]\ast u[n]=\sum_{k=-\infty}^{\infty}h[k]u[n-k]\\ s(n)=h(n)\ast u(n)=\int_{-\infty}^{\infty}h(n)u(n-k) $$ n-k < 0 u 的值就是 0,所以範圍可改為 $$ \sum_{k=-\infty}^{n}h[k]u[n-k]\\ \int_{-\infty}^{n}h(n)u(n-k) $$ n-k $\ge$ 0 u 的值就是 1,所以可化簡為 $$ s[n]=\sum_{k=-\infty}^{n}h[k]\\ s(n)=\int_{-\infty}^{n}h(n)dn $$ 並且可以得到一些推論 $$ h[n] = s[n]-s[n-1]\\ h(n)=\frac{d}{dn}s(n) $$ >對,我放棄用兩種變數表示了,但上面好像一起改掉會比較好