! y n[ ]= h k[ ]x n " k[ ]k= 0M#convolution! x n[ ]= Aej"ejˆ # nComplex exponential input! y n[ ]= h k[ ]Aej"ejˆ # n$k( )k= 0M%frequency response! = h k[ ]e" jˆ # kk= 0M$% & ' ( ) * Aej+ejˆ # n ! = Hˆ " ( )Aej#ejˆ " n ! Hˆ " ( )= h[k]ejˆ " kk=0M#let ! Hˆ " ( )! y n[ ]= bkx n " k[ ]k= 0M#FIREx.! y n[ ]=13x n[ ]+13x n "1[ ]+13x n " 2[ ]! h n[ ]=13"n[ ]+13"n #1[ ]+13"n # 2[ ] ! Hˆ " ( )= h[k]e# jˆ " kk=02$= h[0]e# jˆ " 0+ h[1]e# jˆ " 1+ h[2]e# jˆ " 2=13+13e# jˆ " +13e# jˆ " 2=131+ e# jˆ " + e# j 2ˆ " ( )=13e# jˆ " ejˆ " +1+ e# jˆ " ( )=13e# jˆ " 1+ 2 cosˆ " ( )FIR! Hˆ " ( )=13e# jˆ " 1+ 2 cosˆ " ( )=131+ 2 cosˆ " ( )cosˆ " # j sinˆ " ( ) ! Hˆ " ( )=131+ 2 cosˆ " ( ) ! "Hˆ # ( )= $ˆ # =$ˆ # 2%3 &ˆ # < 0$ˆ # +% %&ˆ # < 2%3' ( ) linear phase-4 -3 -2 -1 0 1 2 3 4-3-2-10123-4 -3 -2 -1 0 1 2 3 400.20.40.60.81 ! "H #ˆ $ ( )= #"Hˆ $ ( ) ! H2"3( )= 0Note:linear phaselow pass filter! Hˆ " ( )! "Hˆ # ( )! ˆ " principal value of phase fnzero! Hˆ " ( )=131+ 2 cosˆ " ( )linear phase-4 -3 -2 -1 0 1 2 3 4-3-2-10123-4 -3 -2 -1 0 1 2 3 400.20.40.60.81 ! H2"3( )= 0Note:low pass filter! Hˆ " ( )! ˆ " zero! ˆ " ! ˆ " =2#3! f = ?normalized frequency! ˆ f =ffs! "#<ˆ $ <#! ˆ " = 2#ˆ f = 2#ffs! f =ˆ " fs2#! fˆ " =#=#fs2#=fs2Nyquist! ˆ " =2#3, fs= 8000Hz! f =2"380002"=80003Hz = 1667HzNormalized vs. actual frequencyactual frequency (Hz)! y n[ ]=13x n[ ]+13x n "1[ ]+13x n " 2[ ]! x n[ ]= 3 + 3cos 0.6"n( )inputFIR filter! y n[ ]= 1 + cos 0.6"n( )+ 1 + cos 0.6"n #1( )( )+ 1 + cos 0.6"n # 2( )( )! = 3 + 0.382cos 0.6"n # 0.6"( )sample domainConvolution / solving the difference equation! = 3 + cos 0.6"n( )+ cos 0.6"( )cos 0.6"n( )+ sin 0.6"( )sin 0.6"n( )+ cos 1.2"( )cos 0.6"n( )+ sin 1.2"( )sin 0.6"n( ) ! M-4 -3 -2 -1 0 1 2 3 4-3-2-10123-4 -3 -2 -1 0 1 2 3 400.20.40.60.81 ! Hˆ " ( )=131+ 2 cosˆ " ( ) ! "Hˆ # ( )= $ˆ # ! H 0( )= 1 ! H 0.6"( )= 0.127 ! "H 0( )= 0 ! "H 0.6#( )= $0.6#! y[n] = 3 1( )+ 3 0.127( )cos 0.6"n # 0.6"( )Multiplication in frequency domain! = 3 + 0.382cos 0.6"n # 0.6"( )! Hˆ " ( )! "Hˆ # ( )closer to a zero,the smaller theoutput.! ˆ " ! x n[ ]= 3 + 3cos 0.6"n( )! ˆ "h1[n]=[1/3,1/3,1/3] h2[n]=[1/3,-1/3,1/3]h1[n]* h2[n]=[1/9,0,1/9,0,1/9]0 0 . 5 1 1. 5 2 2. 5 300. 10. 20. 30. 40. 50. 60. 70. 80. 910 0. 5 1 1. 5 2 2. 5 3 3. 500. 10. 20. 30. 40. 50. 60. 70. 80. 91! H1ˆ " ( ) ! Hˆ " ( )= H1ˆ " ( )#H2ˆ " ( )sample domain convolution= freq domain multiplication(and visa versa)lowpass highpassbandstop! x n[ ]! y n[ ]h1[n]=[1/3,1/3,1/3]h2[n]=[1/3,-1/3,1/3]! x n[ ]! y n[ ]h1[n]* h2[n]0 0 .5 1 1. 5 2 2 .5 3 3. 500. 050. 10. 150. 20. 250. 30. 35! H2ˆ " ( )! H1ˆ " ( )H2ˆ " ( )! ˆ " ! ˆ " ! ˆ "0 0. 5 1 1 .5 2 2.5 300. 10. 20. 30. 40. 50. 60. 70. 80. 91passbands don’t overlaplowpass highpassnull! x n[ ]! y n[ ]IdealLow pass!c=.8Ideal High pass!c=2.6! x n[ ]! y n[ ]h1[n]* h2[n]! H1ˆ " ( )! H2ˆ " ( )! H1ˆ " ( )H2ˆ " ( )! ˆ " ! ˆ " ! ˆ " 0 0. 5 1 1.5 2 2 .5 300. 20. 40. 60. 810 0. 5 1 1.5 2 2 .5 300. 20. 40. 60. 810 0. 5 1 1.5 2 2 .5 300. 20. 40. 60. 810 0. 5 1 1.5 2 2 .5 300. 20. 40. 60. 810 0. 5 1 1.5 2 2 .5 300. 20. 40. 60. 81passbands overlaplowpass highpassbandpass! x n[ ]! y n[ ]IdealLow pass!c=.2.6Ideal High pass!c=0.8! x n[ ]! y n[ ]h1[n]* h2[n]Ideal Bandpass!c=0.8 -> 2.6! H1ˆ " ( )! H2ˆ " ( )! H1ˆ " ( )H2ˆ " ( )! ˆ " ! ˆ " ! ˆ "0 0. 5 1 1.5 2 2 .5 300. 20. 40. 60. 810 0. 5 1 1.5 2 2 .5 300. 20. 40. 60. 810 0. 5 1 1.5 2 2 .5 300. 20. 40. 60. 81passbands don’t overlaplowpass highpassbandstop! x n[ ]! y n[ ]IdealLow pass!c=.8Ideal High pass!c=2.6! x n[ ]! y n[ ]h1[n]+ h2[n]! H1ˆ " ( )! H2ˆ " ( )! H1ˆ " ( )+ H2ˆ " ( )! ˆ " ! ˆ " ! ˆ " Ideal Bandstop!c=0.8 -> 2.60 0. 5 1 1.5 2 2 .5 300. 20. 40. 60. 810 0. 5 1 1.5 2 2 .5 300. 20. 40. 60. 810 0. 5 1 1.5 2 2 .5 300. 20. 40. 60. 81all-pass lowpasshighpass! x n[ ]! y n[ ]IdealLow pass!c=.8Ideal All - pass"[n]! x n[ ]! y n[ ]"[n]- h2[n]! H1ˆ " ( )! H2ˆ " ( )! 1" H2ˆ # ( )! ˆ " ! ˆ " ! ˆ " Highpass!c=0.8-0 0. 5 1 1.5 2 2 .5 300. 20. 40. 60. 811. 21. 40 0. 5 1 1.5 2 2 .5 300. 20. 40. 60. 811. 21. 4h1[n]=[1/3,1/3,1/3]! H1ˆ " ( )lowpass! ˆ " h2[n]="[n]-h1[n]=[2/3,-1/3,-1/3]! H2ˆ " ( )= 1 # H1ˆ " ( )highpass! ˆ " 0 0. 5 1 1.5 2 2 .5 300. 20. 40. 60. 811. 21. 4h3[n] =h1[n]* h2[n] =[2/9, 1/9, 0, -2/9, -1/9]! H3ˆ " ( )= H1ˆ " ( )H2ˆ " ( )bandpass! ˆ " 0 0. 5 1 1 .5 2 2.5 300. 20. 40. 60. 811. 21. 4h4[n] =h1[n]+ [1/3 -1/3 1/3] =[2/3 0 2/3]! H4ˆ " ( )= H4ˆ " ( )+ H5ˆ " ( )bandstop! ˆ " ! h5[n]0 0.5 1 1.5 2 2.5 300.20.40.60.810 0.5 1 1.5 2 2.5 300.20.40.60.810 0.5 1 1.5 2 2.5 300.20.40.60.81FIR low-pass filter response vs. number of taps NN=20N=50 N=100More coefficients (“taps”), can achieve more ideal response;Longer to compute, more memory, greater phase shift0 0.5 1 1.5 2 2 . 5 300.20.40.60.81N=5Note: These aren’t L-point averagers,fir1(), Hammingwindow, Wn=0.8b =[0, -0.049, 0.549, 0.549, -0.049, 0]Causal FIR filter! y n[ ]! x n[ ] ! y n[ ]= b0x n[ ]+ b1x n "1[ ]+ K + bMx n " M[ ]! y n[ ]= bkx n " k[ ]k= 0M#In an FIR filter, the output y at each sample n is a weighted sum of the …
View Full Document