Digital Filter Design Digital Filter Specifications Digital Filter
Total Page:16
File Type:pdf, Size:1020Kb
Digital Filter Design Digital Filter Specifications • Usually, either the magnitude and/or the • Objective - Determination of a realizable phase (delay) response is specified for the transfer function G(z) approximating a design of digital filter for most applications given frequency response specification is an important step in the development of a • In some situations, the unit sample response digital filter or the step response may be specified • If an IIR filter is desired, G(z) should be a • In most practical applications, the problem stable real rational function of interest is the development of a realizable approximation to a given magnitude • Digital filter design is the process of response specification deriving the transfer function G(z) Copyright © 2001, S. K. Mitra Copyright © 2001, S. K. Mitra Digital Filter Specifications Digital Filter Specifications • We discuss in this course only the • As the impulse response corresponding to magnitude approximation problem each of these ideal filters is noncausal and • There are four basic types of ideal filters of infinite length, these filters are not with magnitude responses as shown below realizable j j HLP(e ) HHP(e ) • In practice, the magnitude response 1 1 specifications of a digital filter in the passband and in the stopband are given with – 0 c c – c 0 c j j HBS(e ) HBP (e ) some acceptable tolerances –1 1 • In addition, a transition band is specified between the passband and stopband – – c2 c1 c1 c2 – c2 – c1 c1 c2 Copyright © 2001, S. K. Mitra Copyright © 2001, S. K. Mitra Digital Filter Specifications Digital Filter Specifications ω • For example, the magnitude response G(e j ) • As indicated in the figure, in the passband, ≤ ω ≤ ω of a digital lowpass filter may be given as defined by 0 p , we require that jω ≅ ±δ indicated below G(e ) 1 with an error p , i.e., −δ ≤ jω ≤ +δ ω ≤ ω 1 p G(e ) 1 p , p ω ≤ ω ≤ π •In the stopband, defined by s , we jω ≅ δ require that G ( e ) 0 with an error s , i.e., jω ≤ δ ω ≤ ω ≤ π G(e ) s , s Copyright © 2001, S. K. Mitra Copyright © 2001, S. K. Mitra 1 Digital Filter Specifications Digital Filter Specifications ω • p - passband edge frequency ω • s - stopband edge frequency • Specifications are often given in terms of δ loss function ( ω ) = − 20 log G ( e j ω ) in dB • p - peak ripple value in the passband G 10 δ • Peak passband ripple • s - peak ripple value in the stopband jω α = − −δ • Since G ( e ) is a periodic function of ω, p 20log10 (1 p ) dB ω and G ( e j ) of a real-coefficient digital • Minimum stopband attenuation filter is an even function of ω α = − δ s 20log 10 ( s ) dB • As a result, filter specifications are given only for the frequency range 0 ≤ ω ≤ π Copyright © 2001, S. K. Mitra Copyright © 2001, S. K. Mitra Digital Filter Specifications Digital Filter Specifications • Magnitude specifications may alternately be • Here, the maximum value of the magnitude given in a normalized form as indicated in the passband is assumed to be unity below • 1 / 1 + ε 2 - Maximum passband deviation, given by the minimum value of the magnitude in the passband • 1 - Maximum stopband magnitude A Copyright © 2001, S. K. Mitra Copyright © 2001, S. K. Mitra Digital Filter Specifications Digital Filter Specifications • In practice, passband edge frequency Fp and stopband edge frequency F s are • For the normalized specification, maximum specified in Hz value of the gain function or the minimum • For digital filter design, normalized value of the loss function is 0 dB bandedge frequencies need to be computed • Maximum passband attenuation - from specifications in Hz using α = ( + ε 2 ) Ω 2πF max 20 log 10 1 dB ω = p = p = π p 2 FpT • For δ << 1 , it can be shown that FT FT p Ω π α ≅ −20log (1− 2δ ) ω = s = 2 Fs = π max 10 p dB s 2 FsT FT FT Copyright © 2001, S. K. Mitra Copyright © 2001, S. K. Mitra 2 Selection of Filter Type Digital Filter Specifications • The transfer function H(z) meeting the frequency response specifications should be = = •Example - Let F p 7 kHz, F s 3 kHz, and a causal transfer function = FT 25 kHz • For IIR digital filter design, the IIR transfer − •Then function is a real rational function of z 1 : 3 2π (7×10 ) − − − ω = = 0.56π p + p z 1 + p z 2 +L+ p z M p × 3 H (z) = 0 1 2 M 25 10 + −1 + −2 +L+ −N d0 d1z d2 z dN z π × 3 ω = 2 (3 10 ) = π • H(z) must be a stable transfer function and s 3 0.24 25×10 must be of lowest order N for reduced computational complexity Copyright © 2001, S. K. Mitra Copyright © 2001, S. K. Mitra Selection of Filter Type Selection of Filter Type • For FIR digital filter design, the FIR • Advantages in using an FIR filter - transfer function is a polynomial in z−1 with real coefficients: (1) Can be designed with exact linear phase, N (2) Filter structure always stable with H (z) = å h[n]z−n n=0 quantized coefficients • Disadvantages in using an FIR filter - Order • For reduced computational complexity, of an FIR filter, in most cases, is degree N of H(z) must be as small as possible considerably higher than the order of an equivalent IIR filter meeting the same • If a linear phase is desired, the filter coefficients must satisfy the constraint: specifications, and FIR filter has thus higher computational complexity h[n] = ± h[N − n] Copyright © 2001, S. K. Mitra Copyright © 2001, S. K. Mitra Digital Filter Design: Digital Filter Design: Basic Approaches Basic Approaches • This approach has been widely used for the • Most common approach to IIR filter design - following reasons: (1) Convert the digital filter specifications (1) Analog approximation techniques are into an analog prototype lowpass filter highly advanced specifications (2) They usually yield closed-form • (2) Determine the analog lowpass filter solutions transfer function H (s) (3) Extensive tables are available for a analog filter design • (3) Transform H ( s ) into the desired digital a (4) Many applications require digital transfer function G(z) simulation of analog systems Copyright © 2001, S. K. Mitra Copyright © 2001, S. K. Mitra 3 Digital Filter Design: Digital Filter Design: Basic Approaches Basic Approaches • An analog transfer function to be denoted as • Basic idea behind the conversion of H a (s) into G ( z ) is to apply a mapping from the P (s) H (s) = a s-domain to the z-domain so that essential a D (s) a properties of the analog frequency response where the subscript “a” specifically are preserved indicates the analog domain • Thus mapping function should be such that • A digital transfer function derived from H a (s) – Imaginary ( j Ω ) axis in the s-plane be shall be denoted as mapped onto the unit circle of the z-plane P(z) G(z) = – A stable analog transfer function be mapped D(z) into a stable digital transfer function Copyright © 2001, S. K. Mitra Copyright © 2001, S. K. Mitra Digital Filter Design: Digital Filter Design: Basic Approaches Basic Approaches • FIR filter design is based on a direct Basic Approaches approximation of the specified magnitude • Three commonly used approaches to FIR response, with the often added requirement filter design - that the phase be linear (1) Windowed Fourier series approach • The design of an FIR filter of order N may be accomplished by finding either the (2) Frequency sampling approach length-(N+1) impulse response samples{h[n]} (3) Computer-based optimization methods or the (N+1) samples of its frequency ω response H (e j ) Copyright © 2001, S. K. Mitra Copyright © 2001, S. K. Mitra IIR Digital Filter Design: Bilinear Bilinear Transformation Transformation Method • Bilinear transformation - • Digital filter design consists of 3 steps: æ −1 ö (1) Develop the specifications of H ( s ) by 2 ç1− z ÷ a s = ç − ÷ T è1+ z 1 ø applying the inverse bilinear transformation to specifications of G(z) • Above transformation maps a single point in the s-plane to a unique point in the (2) Design Ha (s) z-plane and vice-versa (3) Determine G(z) by applying bilinear transformation to Ha (s) • Relation between G(z) and H a ( s ) is then given by • As a result, the parameter T has no effect on = æ − −1 ö G(z) Ha (s) = 2ç1 z ÷ G(z) and T = 2 is chosen for convenience s ç − ÷ T è1+z 1 ø Copyright © 2001, S. K. Mitra Copyright © 2001, S. K. Mitra 4 Bilinear Transformation • Inverse bilinear transformation for T = 2 is Bilinear Transformation + z = 1 s 1− s • Mapping of s-plane into the z-plane = σ + Ω •Fors o j o 2 2 (1+σ ) + jΩ 2 (1+σ ) + Ω z = o o Þ z = o o −σ − Ω −σ 2 + Ω2 (1 o ) j o (1 o ) o σ = → = • Thus, o 0 z 1 σ < → < o 0 z 1 σ > → > o 0 z 1 Copyright © 2001, S. K. Mitra Copyright © 2001, S. K. Mitra Bilinear Transformation Bilinear Transformation = jω • For z e with T = 2 we have • Mapping is highly nonlinear − − jω jΩ = 1 e = j tan(ω / 2) • Complete negative imaginary axis in the s- + − jω 1 e plane from Ω = −∞ toΩ = 0 is mapped into or Ω = tan(ω / 2) the lower half of the unit circle in the z-plane from z = − 1 to z =1 • Complete positive imaginary axis in the s- plane from Ω = 0 to Ω = ∞ is mapped into the upper half of the unit circle in the z-plane from z = 1 toz = −1 Copyright © 2001, S.