1 / 55

Chapter 10

Chapter 10. FIR Digital Filter Design. Basic approaches to FIR digital filter design. Unlike IIR digital filter design, FIR filter design does not have any connection with the design of analog filters.

aguilarg
Download Presentation

Chapter 10

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter 10 FIR Digital Filter Design

  2. Basic approaches to FIR digital filter design • Unlike IIR digital filter design, FIR filter design does not have any connection with the design of analog filters. • The design of FIR filters is based on a direct approximation of the specified magnitude response, with often added requirement that the phase response be linear.

  3. FIR filter design based on Windowed Fourier series • The real-coefficient FIR filters are described by a transfer function that is a polynomial in z-1 and therefore require different approaches for their design. • A direct and straightforward method is based on truncation the Fourier series representation of the prescribed frequency response • The second method is based on the observation that for a length (N+1) FIR filter, and the impulse response sequence can be readily computed by applying an inverse DFT to the frequency samples.

  4. Least Integral-Squared Error Design of FIR Filters • Let Hd(ejω) denote the desired frequency response • Since Hd(ejω) is a periodic function of ω with a period 2π, it can be expressed as a Fourier series where

  5. Least Integral-Squared Error Design of FIR Filters • In general, Hd(ejω) is piecewise constant with sharp transitions between bands • In which case, {hd[n]} is of infinite length and noncausal • Objective - Find a finite-duration {ht[n]} of length 2M+1 whose DTFT Ht(ejω) approximates the desired DTFT Hd(ejω) in some sense

  6. Least Integral-Squared Error Design of FIR Filters • Commonly used approximation criterion Minimize the integral-squared error where

  7. Best finite-length approximation to ideal infinite-length impulse response in the mean-square sense is obtained by truncation Least Integral-Squared Error Design of FIR Filters • Using Parseval’s relation we can write • It follows from the above that φ is minimum when ht[n]=hd[n] for -M≤n≤M

  8. Least Integral-Squared Error Design of FIR Filters • A causal FIR filter with an impulse response h[n] can be derived from ht[n] by delaying: • The causal FIR filter h[n] has the same magnitude response as ht[n] and its phase response has a linear phase shift of ωM radians with respect to that of ht[n]

  9. Impulse Responses of Ideal Filters • Ideal lowpass filter - Ideal highpass filter -

  10. Impulse Responses of Ideal Filters • Ideal bandpass filter -

  11. Impulse Responses of Ideal Filters • Ideal bandstop filter -

  12. Impulse Responses of Ideal Filters • Ideal multiband filter -

  13. Impulse Responses of Ideal Filters • Ideal discrete-time Hilbert transformer

  14. Impulse Responses of Ideal Filters • Ideal discrete-time differentiator -

  15. Gibbs Phenomenon • Gibbs phenomenon - Oscillatory behavior in the magnitude responses of causal FIR filters obtained by truncating the impulse response coefficients of ideal filter

  16. Gibbs Phenomenon • As can be seen, as the length of the lowpass filter is increased, the number of ripples in both passband and stopband increases, with a corresponding decrease in the ripple widths • Height of the largest ripples remain the same independent of length • Similar oscillatory behavior observed in the magnitude responses of the truncated versions of other types of ideal filters

  17. where and are the DTFTs of and , respectively Gibbs Phenomenon • Gibbs phenomenon can be explained by treating the truncation operation as an windowing operation: In the frequency domain

  18. Thus is obtained by a periodic continuous convolution of with Gibbs Phenomenon

  19. If is a very narrow pulse centered at (ideally a delta function) compared to variations in , then will approximate very closely • On the other hand, length 2M+1 of should be as small as possible to reduce computational complexity Gibbs Phenomenon • Length 2M+1 of w[n] should be very large

  20. Presence of oscillatory behavior in is basically due to: • 1) is infinitely long and not absolutely summable, and hence filter is unstable Gibbs Phenomenon • A rectangular window is used to achieve simple truncation: • 2) Rectangular window has an abrupt transition to zero

  21. Oscillatory behavior can be explained by examining the DTFT of WR[n] has a main lobe centered at ω=0 Gibbs Phenomenon • Other ripples are called sidelobes

  22. Main lobe of characterized by its width 4π/(2M+1) defined by first zero crossings on both sides of ω=0 • Ripples in around the point of discontinuity occur more closely but with no decrease in amplitude as M increases Gibbs Phenomenon • As M increases, width of main lobe decreases as desired • Area under each lobe remains constant while width of each lobe decreases with an increase in M

  23. Rectangular window has an abrupt transition to zero outside the range • -M≤n≤M , which results in Gibbs phenomenon in Gibbs Phenomenon • Gibbs phenomenon can be reduced either: (1) Using a window that tapers smoothly to zero at each end, or (2) Providing a smooth transition from passband to stopband in the magnitude specifications

  24. Low pass FIR filter design 1. Choose a pass band edge frequency for design that is midway through the transition width. 2. Find the impulse response hL[n] for the ideal low pass filter with this pass band edge frequency. 3. Choose a window w[n] that gives adequate stop band attenuation, and determine the number of terms N needed to give the required transition width. An odd number should be chosen, so that the impulse response will be perfectly symmetrical around its middle point.

  25. Low pass FIR filter design 4. Find the impulse response h[n] = hL[n]w[n] for the FIR filter. 5. Shift the impulse response to the right by (N-1)/2 samples. • The impulse response produced by this design method can be used to create a difference equation for the filter and also a plot of the filter shape.

  26. Low Pass Filter Impulse Response and Shape Impulse Response Shape

  27. After High Pass Filtering (pass band edge 80 Hz) After Low Pass Filtering (pass band edge 40 Hz) After Band Stop Filtering (pass band edges 40 Hz and 80 Hz) After Band Pass Filtering (pass band edges 40 Hz and 80 Hz) Filtering a Voltage Signal

  28. Fixed Window Functions • Using a tapered window causes the height of the sidelobes to diminish, with a corresponding increase in the main lobe width resulting in a wider transition at the discontinuity • Hann: W[n[=0.5+0.5cos[2n/(2M+1)], -Mn M • Hamming: W[n[=0.54+0.46cos[2n/(2M+1)], -Mn M • Blackman: W[n[=0.42+0.5cos[2n/(2M+1)] +0.08cos[4n/(2M+1)]

  29. Rectangular Window

  30. Hanning Window w[n[=0.5+0.5cos[2n/(2M+1)], -Mn M

  31. Hamming Window w[n[=0.54+0.46cos[2n/(2M+1)], -Mn M

  32. Blackman Window w[n[=0.42+0.5cos[2n/(2M+1)] +0.08cos[4n/(2M+1)]

  33. Rectangular window Hanning window 0 0 -20 -20 -40 Gain, dB Gain, dB -40 -60 -60 -80 -80 -100 -100 0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1 w p / w p / Hamming window Blackman window 0 0 -20 -20 -40 -40 Gain, dB Gain, dB -60 -60 -80 -80 -100 -100 0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1 w p w p / / Fixed Window Functions • Plots of magnitudes of the DTFTs of these windows for M = 25 are shown below

  34. Fixed Window Functions • Magnitude spectrum of each window characterized by a main lobe centered at w = 0 followed by a series of sidelobes with decreasing amplitudes • Parameters predicting the performance of a window in filter design are: • Main lobe width • Relative sidelobe level

  35. Fixed Window Functions • Main lobe width ML- given by the distance between zero crossings on both sides of main lobe • Relative sidelobe level Asl - given by the difference in dB between amplitudes of largest sidelobe and main lobe

  36. Fixed Window Functions Observe Thus, • Passband and stopband ripples are the same

  37. Fixed Window Functions • Distance between the locations of the maximum passband deviation and minimum stopband value ML • Width of transition band w = s - p < ML

  38. Fixed Window Functions • To ensure a fast transition from passband to stopband, window should have a very small main lobe width • To reduce the passband and stopband ripple d, the area under the sidelobes should be very small • Unfortunately, these two requirements are contradictory

  39. Fixed Window Functions • In the case of rectangular, Hann, Hamming, and Blackman windows, the value of ripple does not depend on filter length or cutoff frequency c , and is essentially constant • In addition, w  c / M where c is a constant for most practical purposes

  40. Rectangular and Blackman windows

  41. Fixed Window Functions Properties of some fixed window functions

  42. Design Steps for Windowed Low Pass FIR Filters • Choose a pass band edge frequency in Hz for the filter in the middle of the transition width: fc=(fp+ fs)/2 (2) Calculate Ωc= 2πfc/fT and substitute into h1[n], the infinite impulse response for an ideal low pass filter: h1[n]=sin(nΩc)/nπ (3) Choose a window based on the specified, and calculate the number of nonzero window terms • Calculate FIR h[n] from h[n]=h1[n]w[n], notice the response is noncausal. • Shift the impulse response to the right by (N-1)/2 to make the filter causal

  43. FIR Filter Design Example • An increase in the main lobe width is associated with an increase in the width of the transition band • A decrease in the sidelobe amplitude results in an increase in the stopband attenuation

  44. FIR Filter Design Example • Specifications: ωp=0.3π, ωs=0.5π , αs=40dB Thus Choose N = 24 implying M =12

  45. Hence where w[n] is the n-th coefficient of a length-25 Kaiser window with β=3.3953 FIR Filter Design Example

  46. FIR Filter Design Example 1 • The specifications of a low pass filter: Pass band edge 2kHz Stop band edge 3kHz Stop band attenuation 40dB Sampling frequency 10kHz

  47. FIR Filter Design Example 1 • Transition width = 3 – 2 = 1 kHz • f1= 2000+1000/2=2500Hz • Ω1=2πf1/fT=2π2500/10000=0.5π • h1[n]=sin(nΩ1)/nπ=sin(0.5πn)/nπ • Choose Hanning window, with • N=3.32fT/T.W.=33.2, choose N=33 • w[n]=0.5+0.5cos(2πn/32) *T.W. Transition Width

  48. FIR Filter Design Example 1

  49. Impulse Response frequency Response FIR Filter Design Example 1 • G(jωp)=-0.06 dB at ωp=2.013 kHz • G(jωs)=-40 dB atωs =2.976 kHz

More Related