-Digital Signal Processing- FIR Filter Design Lecture-17 24-May-16
FIR Filter Design! FIR filters can also be designed from a frequency response specification.! The equivalent sampled impulse response which determines the coefficients of the FIR filter can then be found by inverse Discrete Fourier transformation.! The frequency response of an Nth-order causal FIR filter is: ( ) = h n H e jω ( )e jnω! The design of an FIR filter involves finding the coefficients h(n) that result in a frequency response that satisfies a given set of filter specifications. N n=0
FIR Filter Design (cont.)! FIR filter have two important advantages over IIR filters:! They are guaranteed to be stable, even after the filter coefficients have been quantized.! They may be easily constrained to have linear phase.
Basic Design Methods! Windows! Frequency Sampling! Equiripple Design
Filter Design by Windowing! Simplest way of designing FIR filters! Method is all discrete-time no continuous-time involved! Start with ideal frequency response j ( ) ω jωn jω jωn H e = h [ n] e hd[ n] Hd( e ) e dω d n=! Choose ideal frequency response as desired response! Most ideal impulse responses are of infinite length d π 1 = 2π π! The easiest way to obtain a causal FIR filter from ideal is! More generally h [ ] hn = h d 0 [ n] 0 n M else [ n] = h [ n] w[ n] where w[ n] d = 1 0 0 n else M
Windowing in Frequency Domain! Windowed frequency response: π jω 1 jω j( ω θ) ( ) = H ( e ) W( e ) dθ H e 2π π d! Thus, the ideal frequency response is smoothed by the discrete time Fourier transform of the window, W(e jω ).
Windowing in Frequency Domain (cont.)! There are many different types of windows that may be used in the window design method, a few of which are listed below: Rectangular w( n) = 1 0 n N 0 else Hanning or Hann window Hamming Blackman w( n) = w( n) = w( n) = 0.5 0.5cos 2πn N 0 n N 0 else 0.54 0.46cos 2πn N 0 n N 0 else 0.42 0.5cos 2πn + 0.08cos 4πn N N 0 n N 0 else
Windowing in Frequency Domain (cont.)! Magnitude of the Fourier transform for an eight point rectangular window:
Windowing in Frequency Domain (cont.)! The windowed version is smeared version of desired response.! If w[n]=1 for all n, then W(e jω ) is pulse train with 2π period.
Windowing in Frequency Domain (cont.)! There are two methods with which we can determine the desired frequency response :! The width of the main lobe of W(e jω ).! Ideally the main lobe should be narrow and the side lobe amplitude should be small.! However for fixed length window these cannot be minimized independently.! General properties of windows are as follows:! As the length N of the window increases, the width of the main lobe decreases, which results in a decrease in the transition width between pass bands and stop bands. This relationship is given approximately by NΔf=c.! The peak side lobe amplitude of the window is determined by the shape of the window and it is essentially independent of the window length.! If the window shape is changed to decrease the side lobe amplitude, the width of the main lobe will generally increase.
Properties of Windows! Prefer windows that concentrate around DC in frequency! Less smearing, closer approximation! Prefer window that has minimal span in time! Less coefficient in designed filter, computationally efficient! So we want concentration in time and in frequency! Contradictory requirements! Example: Rectangular window jω ( ) W e = M n= 0 e jωn 1 = 1 j e e ω ( M+ 1) jωm / 2 sin[ ω( M + 1) /2] = e jω sin[ ω /2]
Rectangular Window! Narrowest main lobe! 4π/(M+1)! Sharpest transitions at discontinuities in frequency! Large side lobes! -13 db! Large oscillation around discontinuities! Simplest window possible: [ ] w n = 1 0 0 n else M
Rectangular Window (cont.)
Hanning Window! Medium main lobe! 8π/M! Side lobes! -31 db! Hamming window performs better! Same complexity as Hamming [ ] w n = 1 2 1 2πn cos M 0 0 n else M
Hanning Window (cont.)
! Medium main lobe! 8π/M! Good side lobes! -41 db Hamming Window! Simpler than Blackman [ ] w n = 0.54 2πn 0.46cos M 0 0 n else M
Hamming Window (cont.)
! Large main lobe! 12π/M! Very good side lobes! -57 db! Complex equation: Blackman Window [ ] w n = 0.42 2πn 0.5 cos M 0 + 4πn 0.08cos M 0 n else M
Blackman Window (cont.)
Example # 1! Suppose that we would like to design an FIR linear phase low pass filter according to the following specifications: 0.99 H e jω ( ) 1.01 0 ω 0.19π H ( e jω ) 0.01 0.21π ω π! For a stop band attenuation of 20 log (0.01)= -40dB, we may use the Hamming window.! Because the specification calls for a transition width of: Δω = ω s ω p = 0.02π or Δf = 0.01 with NΔf = 3.3! For a hamming window an estimate of the required filter order is:
Example # 1 (cont.) N = 3.3 Δf = 330! Now find the unit sample response of the ideal low pass filter that is to be windowed.! With a cutoff frequency of and a delay of α = N / 2 =165! The unit sample response is: h d ( n) = ( ) / 2 = 0.2π ω c = ω s +ω p ( ) sin 0.2π n 165 ( n 165)π
Kaiser Windows! Kaiser developed a family of windows that are defined by: w( n) = 2 I 0 β 1 ( n α) /α I 0 β ( ) 1/2! Where α=n/2 and I 0 is a zeroth-order modified Bessel function of the first kind, which is: I 0 ( x) =1+ ( x / 2) k k!! Where βdetermines the shape of the window., 0 n M! A kaiser window is nearly optimum in the sense of having the most energy in its main lobe for a given side-lobe amplitude. k=1 2
Kaiser Windows (cont.)! Characteristics of the Kaiser Window as a function of β: Parameter β Side Lobe (db) Transition Width (NΔf) Stopband Attenuation (db) 2.0-19 1.5-29 3.0-24 2.0-37 4.0-30 2.6-45 5.0-37 3.2-54 6.0-44 3.8-63 7.0-51 4.5-72 8.0-59 5.1-81 9.0-67 5.7-90 10.0-74 6.4-99
Kaiser Windows (cont.)! There are two empirically derived relationships for the Kaiser window that facilitate the use of these windows to design FIR filters.! The first relates the stop band ripple of a low-pass filter α s =-20log(δ s ) to the parameter β: β = ( ) α s > 50 0.1102 α s 8.7 0.5842( α s 21) 0.4 + 0.07886( α s 21) 21 α s 50 0.0 α s < 21! The second relates N to the transition width Δf and the stop band attenuation α s, N = α s 7.95 14.36Δf,α s 21! Note that if α s <21 db a rectangular window may be used.
Example #2! Suppose that we would like to design a low-pass filter with a cutoff frequency ω c =π/4, a transition width Δω=0.02 π and a stop band ripple δ s =0.01. Because α s =-20 log (0.01)=-40, the Kaiser window parameter is :! With Δf = Δω / 2π = 0.01 we have: 40 7.95 N = 14.36. 0.01! Therefore, β = 0.5842 40 21 ( ) 0.4 + 0.07886( 40 21) = 3.4 h( n) = h d n h d ( n) = ( ) = 224 ( )w( n) sin ( n 112)π / 4 ( n 112)π! Is the unit sample response of the ideal low-pass filter.