匹配濾波器

在信號處理中，匹配濾波器可以用來解調基頻帶脈波信號，基頻帶脈波信號意指信號內容為同一波形信號乘上一個常數，在每個周期出現，每個周期中代表著或多或少的資訊量。匹配濾波器解調出來的結果其SNR (Signal Noise Ratio)為最大的，匹配濾波器需要事先知道 1.傳送的訊號 2.訊號的同步 才能解調出傳送的信號。 此外，匹配濾波器也可用於模式識別 、相似度測試（similarity measure）。 假設 g(t)：傳送訊號 w(t)：可加性高斯白雜訊 x(t) = g(t) + w(t) h(t)：未知波形 y(t)：解調結果 1. x ( t ) = g ( t ) + w ( t ) {\displaystyle 1.x(t)=g(t)+w(t)} 2. y ( t ) = [ g ( t ) + w ( t ) ] ∗ h ( t ) {\displaystyle 2.y(t)=[g(t)+w(t)]\ast h(t)} 　 = g ( t ) ∗ h ( t ) + w ( t ) ∗ h ( t ) {\displaystyle =g(t)\ast h(t)+w(t)\ast h(t)} = G ( t ) + N ( t ) {\displaystyle =G(t)+N(t)} 3. S N R = | G ( T ) | 2 / E [ N 2 ( T ) ] | {\displaystyle 3.SNR=|G(T)|^{2}/E[N^{2}(T)]|} SNR = 信號瞬間功率 / Noise平均功率 信號瞬間功率 | G ( T ) | 2 = ∫ − ∞ ∞ H ( f ) G ( f ) e j 2 π f T d f {\displaystyle |G(T)|^{2}=\int _{-\infty }^{\infty }H(f)G(f)e^{j2\pi fT}\,df} 雜訊平均功率 E [ N 2 ( T ) ] = N 0 2 ∫ − ∞ ∞ | H ( f ) | 2 d f {\displaystyle E[N^{2}(T)]={\frac {N_{0}}{2}}\int _{-\infty }^{\infty }|H(f)|^{2}\,df} S N R = ∫ − ∞ ∞ H ( f ) G ( f ) e j 2 π f T d f N 0 2 ∫ − ∞ ∞ | H ( f ) | 2 d f {\displaystyle SNR={\frac {\int _{-\infty }^{\infty }H(f)G(f)e^{j2\pi fT}\,df}{{\frac {N_{0}}{2}}\int _{-\infty }^{\infty }|H(f)|^{2}\,df}}} ≤ ∫ − ∞ ∞ | H ( f ) | 2 e j 2 π f T d f ∫ − ∞ ∞ | G ( f ) e j 2 π f T | 2 d f N 0 2 ∫ − ∞ ∞ | H ( f ) | 2 d f {\displaystyle \leq {\frac {\int _{-\infty }^{\infty }|H(f)|^{2}e^{j2\pi fT}\,df\int _{-\infty }^{\infty }|G(f)e^{j2\pi fT}|^{2}\,df}{{\frac {N_{0}}{2}}\int _{-\infty }^{\infty }|H(f)|^{2}\,df}}} = 2 N 0 ∫ − ∞ ∞ | G ( f ) | 2 d f {\displaystyle ={\frac {2}{N_{0}}}\int _{-\infty }^{\infty }|G(f)|^{2}\,df} 4. 當 H o p t ( f ) = k [ G ( f ) e j 2 π f T ] ∗ {\displaystyle H_{opt}(f)=k[G(f)e^{j2\pi fT}]^{*}} , S N R m a x = 2 N 0 ∫ − ∞ ∞ | G ( f ) | 2 d f {\displaystyle SNR_{max}={\frac {2}{N_{0}}}\int _{-\infty }^{\infty }|G(f)|^{2}\,df} 所以 h o p t ( t ) = k ∫ − ∞ ∞ G ( − f ) e − j 2 π f T e j 2 π f t d f {\displaystyle h_{opt}(t)=k\int _{-\infty }^{\infty }G(-f)e^{-j2\pi fT}e^{j2\pi ft}\,df} = k ∫ − ∞ ∞ G ( z ) e − j 2 π f ( T − t ) d z {\displaystyle =k\int _{-\infty }^{\infty }G(z)e^{-j2\pi f(T-t)}\,dz} = k g ( T − t ) {\displaystyle =kg(T-t)} (備註) 柯西-施瓦茨不等式 若 ∫ − ∞ ∞ | A ( x ) | 2 d x < ∞ {\displaystyle \int _{-\infty }^{\infty }|A(x)|^{2}\,dx<\infty } 且 ∫ − ∞ ∞ | B ( x ) | 2 d x < ∞ {\displaystyle \int _{-\infty }^{\infty }|B(x)|^{2}\,dx<\infty } 則 | ∫ − ∞ ∞ A ( x ) B ( x ) d x | 2 ≤ ∫ − ∞ ∞ | A ( x ) | 2 d x ∫ − ∞ ∞ | B ( x ) | 2 d x {\displaystyle |\int _{-\infty }^{\infty }A(x)B(x)\,dx|^{2}\leq \int _{-\infty }^{\infty }|A(x)|^{2}\,dx\int _{-\infty }^{\infty }|B(x)|^{2}\,dx} 當 A = k B ∗ {\displaystyle A=kB^{*}} 時，等號成立。   x = s + v , {\displaystyle \ x=s+v,\,}   R v = E { v v H } . {\displaystyle \ R_{v}=E\{vv^{\mathrm {H} }\}.\,} S N R = | y s | 2 E { | y v | 2 } . {\displaystyle \mathrm {SNR} ={\frac {|y_{s}|^{2}}{E\{|y_{v}|^{2}\}}}.}   | y s | 2 = y s H y s = h H s s H h . {\displaystyle \ |y_{s}|^{2}={y_{s}}^{\mathrm {H} }y_{s}=h^{\mathrm {H} }ss^{\mathrm {H} }h.\,}   E { | y v | 2 } = E { y v H y v } = E { h H v v H h } = h H R v h . {\displaystyle \ E\{|y_{v}|^{2}\}=E\{{y_{v}}^{\mathrm {H} }y_{v}\}=E\{h^{\mathrm {H} }vv^{\mathrm {H} }h\}=h^{\mathrm {H} }R_{v}h.\,} S N R = h H s s H h h H R v h . {\displaystyle \mathrm {SNR} ={\frac {h^{\mathrm {H} }ss^{\mathrm {H} }h}{h^{\mathrm {H} }R_{v}h}}.} 如果我們限制分母為1, 最大化 S N R {\displaystyle \mathrm {SNR} } 的問題可以被簡化為最大化分子. 於是可以使用 拉格朗乘數   h H R v h = 1 {\displaystyle \ h^{\mathrm {H} }R_{v}h=1}   L = h H s s H h + λ ( 1 − h H R v h ) {\displaystyle \ {\mathcal {L}}=h^{\mathrm {H} }ss^{\mathrm {H} }h+\lambda (1-h^{\mathrm {H} }R_{v}h)}   ∇ h ∗ L = s s H h − λ R v h = 0 {\displaystyle \ \nabla _{h^{*}}{\mathcal {L}}=ss^{\mathrm {H} }h-\lambda R_{v}h=0}   ( s s H ) h = λ R v h {\displaystyle \ (ss^{\mathrm {H} })h=\lambda R_{v}h}   h H ( s s H ) h = λ h H R v h . {\displaystyle \ h^{\mathrm {H} }(ss^{\mathrm {H} })h=\lambda h^{\mathrm {H} }R_{v}h.} 因為 s s H {\displaystyle ss^{\mathrm {H} }} 是一維, 他只有一個非零特徵值. 此特徵值=   λ max = s H R v − 1 s , {\displaystyle \ \lambda _{\max }=s^{\mathrm {H} }R_{v}^{-1}s,}   h = 1 s H R v − 1 s R v − 1 s . {\displaystyle \ h={\frac {1}{\sqrt {s^{\mathrm {H} }R_{v}^{-1}s}}}R_{v}^{-1}s.} 若欲偵測一特定信號 h[n]，我們可以將h[n]時域反向並取共軛，當做濾波器。 一維信號 y [ n ] = x [ n ] ∗ h ∗ [ − n ] = ∑ τ = τ 1 τ 2 x [ n − τ ] h ∗ [ − τ ] = ∑ τ = τ 1 τ 2 x [ n + τ ] h ∗ [ τ ] {\displaystyle y[n]=x[n]*h^{*}[-n]=\sum _{\tau =\tau _{1}}^{\tau _{2}}x[n-\tau ]h^{*}[-\tau ]=\sum _{\tau =\tau _{1}}^{\tau _{2}}x[n+\tau ]h^{*}[\tau ]} x[n] :數入信號 ，h[n]：欲偵測的特定信號，且假設當 τ 1 ≤ n ≤ τ 2 {\displaystyle \tau _{1}\leq n\leq \tau _{2}} 時， h[n]≠0 二維信號 y [ m , n ] = x [ m , n ] ∗ h ∗ [ − m , − n ] = ∑ τ = τ 1 τ 2 ∑ ρ = ρ 1 ρ 2 x [ m + τ , n + ρ ] h ∗ [ τ , ρ ] {\displaystyle y[m,n]=x[m,n]*h^{*}[-m,-n]=\sum _{\tau =\tau _{1}}^{\tau _{2}}\sum _{\rho =\rho _{1}}^{\rho _{2}}x[m+\tau ,n+\rho ]h^{*}[\tau ,\rho ]} 假設當 τ 1 ≤ m ≤ τ 2 , ρ 1 ≤ m ≤ ρ 2 {\displaystyle \tau _{1}\leq m\leq \tau _{2},\rho _{1}\leq m\leq \rho _{2}} 時， h[m,n]≠0 模擬結果： 但由於卷積是線性的，當信號能量大，算出來的值也會跟著變大而有誤差，因此我們需要標準化。 標準化公式 一維信號 當 ∑ s = n + τ 1 n + τ 2 | x [ s ] | 2 {\displaystyle \sum _{s=n+\tau _{1}}^{n+\tau _{2}}|x[s]|^{2}} ≠0 y [ n ] = {\displaystyle y[n]=} ∑ τ = τ 1 τ 2 x [ n + τ ] h ∗ [ τ ] ∑ s = n + τ 1 n + τ 2 | x [ s ] | 2 ∑ s = τ 1 τ 2 | h [ s ] | 2 {\displaystyle {\sum _{\tau =\tau _{1}}^{\tau _{2}}x[n+\tau ]h^{*}[\tau ]} \over {\sqrt {\sum _{s=n+\tau _{1}}^{n+\tau _{2}}|x[s]|^{2}\sum _{s=\tau _{1}}^{\tau _{2}}|h[s]|^{2}}}} 當 ∑ s = n + τ 1 n + τ 2 | x [ s ] | 2 {\displaystyle \sum _{s=n+\tau _{1}}^{n+\tau _{2}}|x[s]|^{2}} =0 y [ n ] = 0 {\displaystyle y[n]=0} 二維信號 當 ∑ s = m + τ 1 m + τ 2 ∑ v = n + ρ 1 n + ρ 2 | x [ s , v ] | 2 {\displaystyle \sum _{s=m+\tau _{1}}^{m+\tau _{2}}\sum _{v=n+\rho _{1}}^{n+\rho _{2}}|x[s,v]|^{2}} ≠0 y [ m , n ] = {\displaystyle y[m,n]=} ∑ τ = τ 1 τ 2 ∑ ρ = ρ 1 ρ 2 x [ m + τ , n + ρ ] h ∗ [ τ , ρ ] ∑ s = m + τ 1 m + τ 2 ∑ v = n + ρ 1 n + ρ 2 | x [ s , v ] | 2 ∑ s = τ 1 τ 2 ∑ v = ρ 1 ρ 2 | h [ s , v ] | 2 {\displaystyle {\sum _{\tau =\tau _{1}}^{\tau _{2}}\sum _{\rho =\rho _{1}}^{\rho _{2}}x[m+\tau ,n+\rho ]h^{*}[\tau ,\rho ]} \over {\sqrt {\sum _{s=m+\tau _{1}}^{m+\tau _{2}}\sum _{v=n+\rho _{1}}^{n+\rho _{2}}|x[s,v]|^{2}\sum _{s=\tau _{1}}^{\tau _{2}}\sum _{v=\rho _{1}}^{\rho _{2}}|h[s,v]|^{2}}}} 當 ∑ s = m + τ 1 m + τ 2 ∑ v = n + ρ 1 n + ρ 2 | x [ s , v ] | 2 {\displaystyle \sum _{s=m+\tau _{1}}^{m+\tau _{2}}\sum _{v=n+\rho _{1}}^{n+\rho _{2}}|x[s,v]|^{2}} = 0 y [ m , n ] = 0 {\displaystyle y[m,n]=0} 標準化後的模擬結果： Haykin,S. / Moher,M. Haykin: Communication Systems 5/E （中文）.  Jian-Jiun Ding, Advanced Digital Signal Processing, the Department of Electrical Engineering, National Taiwan University (NTU), Taipei, Taiwan, 2015. 霍夫變換 拉東變換 週期圖法 疊代稀疏漸近最小方差算法