頻率取樣法

對理想濾波器的頻率響應取樣。由下式 H ( k ) = H d ( e j ω ) | ω = 2 π N k , k ∈ [ 0 , N − 1 ] {\displaystyle H(k)=H_{d}(e^{j\omega })|_{\omega ={\frac {2\pi }{N}}k},k\in [0,N-1]} 即可設計不同k點(離散的頻率點) 之值。舉例，將較小的k對應的響應值設計為1，較大的k對應的響應值設計為0,可得低通濾波器響應；將較小的k對應的響應值設計為0，較大的k對應的響應值設計為1,可得高通濾波器響應。 給定一個理想濾波器的離散時間傅立葉轉換 H d ( f ) {\displaystyle H_{d}(f)} ， h [ n ] {\displaystyle h[n]} 則為我們要設計的有限脈衝響應濾波器的脈衝響應，在 n ∈ [ 0 , N − 1 ] {\displaystyle n\in [0,N-1]} 區間設計。考慮 R ( f ) {\displaystyle R(f)} 是 r [ n ] = h [ n + P ] {\displaystyle r[n]=h[n+P]} 的離散時間傅立葉轉換。 此方法基本精神要求為 R ( m N f s ) = H d ( m N f s ) , ∀ m ∈ 0 , 1 , 2 , . . . N − 1 f s : s a m p l i n g   f r e q u e n c y {\displaystyle {\begin{aligned}R({\frac {m}{N}}f_{s})=H_{d}({\frac {m}{N}}f_{s}),&\forall m\in 0,1,2,...N-1\\\\&f_{s}:sampling\ frequency\end{aligned}}} 若以 normalized frequency F = f f s {\displaystyle F={\frac {f}{f_{s}}}} 對公式進行變數變換 則 R ( m N ) = H d ( m N ) {\displaystyle R({\frac {m}{N}})=H_{d}({\frac {m}{N}})} 取樣 normalized過後的理想濾波器的離散時間傅立葉轉換 H d ( m N ) , ∀ m ∈ 0 , 1 , 2 , . . . N − 1 {\displaystyle H_{d}({\frac {m}{N}}),\forall m\in 0,1,2,...N-1} 求 H d ( m N ) {\displaystyle H_{d}({\frac {m}{N}})} 的逆離散傅立葉轉換(IDFT)(inverse discrete Fourier transform) r 1 [ n ] = 1 N ∑ m = 0 N − 1 H d ( m N ) e x p ( j 2 π m N n ) {\displaystyle r_{1}[n]={\frac {1}{N}}\sum _{m=0}^{N-1}H_{d}({\frac {m}{N}})exp(j{\frac {2\pi m}{N}}n)} 考慮 N {\displaystyle N} 的奇偶情形 若 N {\displaystyle N} 是奇數，則 r [ n ] = { r 1 [ n ] for   n = 0 , 1 , . . . , k     k = N − 1 2 r 1 [ n + N ] for   n = − k , − k + 1 , . . . , − 1. {\displaystyle r[n]={\begin{cases}r_{1}[n]&{\text{for}}\ n=0,1,...,k\ \ k={\frac {N-1}{2}}\\r_{1}[n+N]&{\text{for}}\ n=-k,-k+1,...,-1.\end{cases}}} 若 N {\displaystyle N} 是偶數，則 r [ n ] = { r 1 [ n ] for   n = 1 , . . . , k     k = N 2 r 1 [ n + N ] for   n = − k , − k + 1 , . . . , − 1. {\displaystyle r[n]={\begin{cases}r_{1}[n]&{\text{for}}\ n=1,...,k\ \ k={\frac {N}{2}}\\r_{1}[n+N]&{\text{for}}\ n=-k,-k+1,...,-1.\end{cases}}} 我們據此法得到的有限響應濾波器 h [ n ] {\displaystyle h[n]} ，即 h [ n ] = r [ n − k ] {\displaystyle h[n]=r[n-k]} 若 R ( F ) {\displaystyle R(F)} 是 r [ n ] {\displaystyle r[n]} 的離散時間傅立葉轉換 R ( F ) = ∑ n = − ∞ ∞ r [ n ] e − j 2 π F n = ∑ n = 0 N − 1 r 1 [ n ] e − j 2 π F n {\displaystyle R(F)=\sum _{n=-\infty }^{\infty }{r[n]e^{-j2\pi Fn}}=\sum _{n=0}^{N-1}{r_{1}[n]e^{-j2\pi Fn}}} 令 F = m N {\displaystyle F={\frac {m}{N}}} , R ( m N ) = ∑ n = 0 N − 1 r 1 [ n ] e − j 2 π m N n {\displaystyle R({\frac {m}{N}})=\sum _{n=0}^{N-1}{r_{1}[n]e^{-j{\frac {2\pi m}{N}}n}}} 又 r 1 [ n ] {\displaystyle r_{1}[n]} 是 H d ( m N ) {\displaystyle H_{d}({\frac {m}{N}})} 的IDFT ∴ R ( m N ) = H d ( m N ) {\displaystyle R({\frac {m}{N}})=H_{d}({\frac {m}{N}})} 證明了照上述方法設計可得到在特定頻率上都會與理想濾波器響應吻合的有限響應近似濾波器 簡單且直觀 所得到的有限響應濾波器並非最優化的，有限響應造成的漣波 大小介於用MSE和MINIMAX方法設計的濾波器之間 難以跟權重函數結合 考慮理想的離散希爾伯特轉換濾波器，我們打算據此設計15點有限響應濾波器 先對此理想濾波器進行15個點的採樣 r 1 [ n ] = i f f t ( [ 0 , − 0.9 , − 1 , − 1 , − 1 , − 1 , − 1 , − 0.7 , 0.7 , 1 , 1 , 1 , 1 , 1 , 0.9 ] ) {\displaystyle r_{1}[n]=ifft([0,-0.9,-1,-1,-1,-1,-1,-0.7,0.7,1,1,1,1,1,0.9])} ifft為(逆離散傅立葉轉換) r [ n ] = [ − 0.0315 , 0.0182 , − 0.0693 , 0.0132 , − 0.1690 , 0.0078 , − 0.6206 , 0.0000 , 0.6206 , − 0.0078 , 0.1690 , − 0.0132 , 0.0693 , − 0.0182 , 0.0315 ] {\displaystyle {\begin{aligned}r[n]=&[-0.0315,0.0182,-0.0693,0.0132,-0.1690,0.0078,-0.6206,0.0000,0.6206,\\&-0.0078,0.1690,-0.0132,0.0693,-0.0182,0.0315]\\\end{aligned}}} h [ n ] = r [ n − 8 ] = [ − 0.0315 , 0.0182 , − 0.0693 , 0.0132 , − 0.1690 , 0.0078 , − 0.6206 , 0.0000 ,     0.6206 , − 0.0078 , 0.1690 , − 0.0132 , 0.0693 , − 0.0182 , 0.0315 ] {\displaystyle {\begin{aligned}h[n]=r[n-8]&=[-0.0315,0.0182,-0.0693,0.0132,-0.1690,0.0078,-0.6206,0.0000,\\&\ \ 0.6206,-0.0078,0.1690,-0.0132,0.0693,-0.0182,0.0315]\end{aligned}}} 最後設計出的濾波器頻率響應 Jian-Jiun Ding (2024), Advanced Digital Signal Processing