1. Trang chủ
  2. » Công Nghệ Thông Tin

Infinite Impulse Response Filters

63 246 0
Tài liệu đã được kiểm tra trùng lặp

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 63
Dung lượng 0,9 MB

Nội dung

CHAPTER Infinite Impulse Response Filters 4.1 INTRODUCTION In Chapter 2, we discussed the analysis of discrete-time systems to obtain their output due to a given input sequence in the time domain, using recursive algorithm, convolution, and the z-transform technique In Chapter 3, we introduced the concept of their response in the frequency domain, by deriving the DTFT or the frequency response of the system These two chapters and Chapter were devoted to the analysis of DT systems Now we discuss the synthesis of these systems, when their transfer functions or their equivalent models are given If we are given the input–output sequence, it is easy to find the transfer function H (z) as the ratio of the z transform of the output to the z transform of the input If, however, the frequency response of the system is specified, in the form of a plot, such as when the passband and stopband frequencies along with the magnitude and phase over these bands, and the tolerances allowed for these specifications, are specified, finding the transfer function from such specifications is based on approximation theory There are many well-known methods for finding the transfer functions that approximate the specifications given in the frequency domain In this chapter, we will discuss a few methods for the design of IIR filters that approximate the magnitude response specifications for lowpass, highpass, bandpass, and bandstop filters Usually the specifications for a digital filter are given in terms of normalized frequencies Also, in many applications, the specifications for an analog filter are realized by a digital filter in the combination of an ADC in the front end with a DAC at the receiving end, and these specifications will be in the analog domain The magnitude response of ideal, classical analog filters are shown in Figure 4.1 Several examples of IIR filter design are also included in this chapter, to illustrate the design of these filters and also filters with arbitrary magnitude response, by use of MATLAB functions The design of FIR filters that approximate the specifications in the frequency domain is discussed in the next chapter Introduction to Digital Signal Processing and Filter Design, by B A Shenoi Copyright © 2006 John Wiley & Sons, Inc 186 187 Magnitude Magnitude INTRODUCTION wc Frequency Frequency (a) (b) Magnitude Magnitude wc w1 w2 w1 w2 Frequency Frequency (c) (d ) Figure 4.1 Magnitude responses of analog filters: (a) lowpass filter; (b) highpass filter; (c) bandpass filter; (d) bandstop filter Let us select any one of the following methods to specify the IIR filters The recursive algorithm is given by y(n) = − N a(k)y(n − k) + k=1 M b(k)x(n − k) (4.1) k=0 and its equivalent form is a linear difference equation: N k=0 a(k)y(n − k) = M b(k)x(n − k); a(0) = (4.2) k=0 The transfer function of the IIR filter is given by M −k k=0 b(k)z H (z) = N ; −k k=0 a(k)z a(0) = (4.3) 188 INFINITE IMPULSE RESPONSE FILTERS Let us consider a few properties of the transfer function when it is evaluated on the unit circle z = ej ω , where ω is the normalized frequency in radians: M jω H (e ) = k=0 b(k) cos(kω) N k=0 a(k) cos(kω) = H (ej ω ) ej θ(ω) −j −j M k=0 b(k) sin(kω) k=0 a(k) sin(kω) M (4.4) In this equation, H (ej ω ) is the frequency response, or the discrete-time Fourier transform (DTFT) of the filter, H (e j ω ) is the magnitude response, and θ (ej ω ) jω j ω j α(ω) is the phase response If is the frequency response of ) = X(e ) e X(e j ω the input signal, where X(e ) is its magnitude and α(j ω) is its phase response, jω jω jω jω then jthe frequency response Y (e ) is given by Y (e ) = X(e )H (e ) = X(e ω ) H (ej ω ) ej {α(ω)+θ(j ω)} Therefore the magnitude of the output signal is multiplied by the magnitude H (ej ω ) and its phase is increased by the phase θ (ej ω ) of the filter: ⎧   2 ⎫1/2 M M ⎪ ⎪ ⎨ ⎬ + k=0 b(k) cos(kω) k=0 b(k) sin(kω) H (ej ω ) =  2  2 ⎪ ⎩ N a(k) cos(kω) + M a(k) sin(kω) ⎪ ⎭ k=0 k=0 M M a(k) sin(kω) k=0 b(k) sin(kω) −1 + tan Nk=0 θ (j ω) = − tan M k=0 b(k) cos(kω) k=0 a(k) cos(kω) (4.5) (4.6) The magnitude squared function is H (ej ω ) 2 = H (ej ω )H (e−j ω ) = H (ej ω )H ∗ (ej ω ) (4.7) where H ∗ (ej ω ) = H (e−j ω ) is the complex conjugate of H (ej ω ) It can be shown that the magnitude response is an even function of ω while the phase response is an odd function of ω Very often it is convenient to compute and plot the log magnitude of H (ej ω ) 2 as 10 log H (ej ω ) measured in decibels Also we note that H (ej ω )/H (e−j ω ) = ej 2θ(ω) The group delay τ (j ω) is defined as τ (j ω) = −[dθ (j ω)]/dω and is computed from τ (ω) = du dv − + u2 d ω + v d ω (4.8) where M k=0 b(k) sin(kω) u = M k=0 b(k) cos(kω) (4.9) MAGNITUDE APPROXIMATION OF ANALOG FILTERS N and v = Nk=0 k=0 a(k) sin(kω) 189 (4.10) a(k) cos(kω) Designing an IIR filter usually means that we find a transfer function H (z) in the form of (4.3) such that its magnitude response (or the phase response, the group delay, or both the magnitude and group delay) approximates the specified magnitude response in terms of a certain criterion For example, we may want to amplify the input signal by a constant without any delay or with a constant amount of delay But it is easy to see that the magnitude response of a filter or the delay is not a constant in general and that they can be approximated only by the transfer function of the filter In the design of digital filters (and also in the design of analog filters), three approximation criteria are commonly used: (1) the Butterworth approximation, (2) the minimax (equiripple or Chebyshev) approximation, and (3) the least-pth approximation or the least-squares approximation We will discuss them in this chapter in the same order as listed here Designing a digital filter also means that we obtain a circuit realization or the algorithm that describes its performance in the time domain This is discussed in Chapter It also means the design of the filter is implemented by different types of hardware, and this is discussed in Chapters and Two analytical methods are commonly used for the design of IIR digital filters, and they depend significantly on the approximation theory for the design of continuous-time filters, which are also called analog filters Therefore, it is essential that we review the theory of magnitude approximation for analog filters before discussing the design of IIR digital filters 4.2 MAGNITUDE APPROXIMATION OF ANALOG FILTERS The transfer function of an analog filter H (s) is a rational function of the complex frequency variable s, with real coefficients and is of the form1 H (s) = c0 + c1 s + c2 s + · · · + c m s m , d0 + d1 s + d2 s + · · · + dn s n m≤n (4.11) The frequency response or the Fourier transform of the filter is obtained as a function of the frequency ω,2 by evaluating H (s) as a function of j ω H (j ω) = c0 + j c1 ω − c2 ω2 − j c3 ω4 + c4 ω4 + · · · + (j )m cm ωm (4.12) d0 + j d1 ω − d2 ω2 − j d3 ω3 + d4 ω4 + · · · + (j )n cn ωn = |H (j ω)| ej φ(ω) (4.13) Much of the material contained in Sections 4.2–4.10 has been adapted from the author’s book Magnitude and Delay Approximation of 1-D and 2-D Digital Filters and is included with permission from its publisher, Springer-Verlag In Sections 4.2–4.8, discussing the theory of analog filters, we use ω and to denote the angular frequency in radians per second The notation ω should not be considered as the normalized digital frequency used in H (ej ω ) 190 INFINITE IMPULSE RESPONSE FILTERS where H (j ω) is the frequency response, |H (j ω)| is the magnitude response, and θ (j ω) is the phase response We also find the magnitude squared and the phase response from the following: |H (j ω)|2 = H (j ω)H (−j ω) = H (j ω)H ∗ (j ω) (4.14) H (j ω) = ej 2θ(ω) H (−j ω) (4.15) The magnitude response of an analog filter is an even function of ω, whereas the phase response is an odd function Although these properties of H (j ω) are similar to those of H (ej ω ), there are some differences For example, the frequency variable ω in H (j ω) is (are) in radians per second, whereas ω in H (ej ω ) is the normalized frequency in radians The magnitude response |H (j ω)| (and the phase response) is (are) aperiodic in ω over infinite interval −∞ < the doubly ω < ∞, whereas the magnitude response H (ej ω ) (and the phase response) is (are) periodic with a period of 2π on the normalized frequency scale Example 4.1 Let us take a simple example of a transfer function of an analog function as H (s) = s+1 s + 2s + (4.16) The first step is to multiply H (s) with H (−s) and evaluate the product at s = j ω: {H (s)H (−s)}|s=j ω = |H (j ω)|2  |H (j ω)| = {H (s)H (−s)}|s=j ω = = ω2 + ω4 +  (s + 1)(−s + 1) 2 (s + s + 2)(s − s + 2) s=j ω (4.17) (4.18) (4.19) From this example, we see that to find the transfer function H (s) in (4.16) from the magnitude squared function in (4.19), we reverse the steps followed above in deriving the function (4.19) from the H (s) In other words, we substitute j ω = s (or ω2 = −s ) in the given magnitude squared function to get H (s)H (−s) and factorize its numerator and denominator For every pole at sk (and zero) in H (s), there is a pole at −sk (and zero) in H (−s) So for every pole in the left half of the s plane, there is a pole in the right half of the s plane, and it follows that a pair of complex conjugate poles in the left half of the s plane appear with a pair of complex conjugate poles in the right half-plane also, thereby displaying a quadrantal symmetry Therefore, when we have factorized MAGNITUDE APPROXIMATION OF ANALOG FILTERS 191 the product H (s)H (−s), we pick all its poles that lie in the left half of the s-plane and identify them as the poles of H (s), leaving their mirror images in the right half of the s-plane as the poles of H (−s) This assures us that the transfer function is a stable function Similarly, we choose the zeros in the left half-plane as the zeros of H (s), but we are free to choose the zeros in the right half-plane as the zeros of H (s) without affecting the magnitude It does change the phase response of H (s), giving a non–minimum phase response Consider a simple example: F1 (s) = (s + 1) and F2 (s) = (s − 1) Then F22 (s) = (s + 1)[(s − 1)/(s + 1)] has the same magnitude as the function F2 (s) since the magnitude of (s − 1)/(s + 1) is equal to |(j ω − 1)/(j ω + 1)| = for all frequencies But the phase of F22 (j ω) has increased by the phase response of the allpass function (s − 1)/(s + 1) Hence F22 (s) is a non–minimum phase function In general any function that has all its zeros inside the unit circle in the z plane is defined as a minimum phase function If it has atleast one zero outside the unit circle, it becomes a non–minimum phase function 4.2.1 Maximally Flat and Butterworth Approximation Let us choose the magnitude response of an ideal lowpass filter as shown in Figure 4.1a This ideal lowpass filter passes all frequencies of the input continuoustime signal in the interval |ω| ≤ ωc with equal gain and completely filters out all the frequencies outside this interval In the bandpass filter response shown in Figure 4.1c, the frequencies between ω1 and ω2 and between −ω1 and −ω2 only are transmitted and all other frequencies are completely filtered out In Figure 4.1, for the ideal lowpass filter, the magnitude response in the interval ≤ ω ≤ ωc is shown as a constant value normalized to one and is zero over the interval ωc ≤ ω < ∞ Since the magnitude response is an even function, we know the magnitude response for the interval −∞ < ω < For Ideal Magnitude 1.0 − dp Transition Band Passband Stopband ds wp ws w Figure 4.2 Magnitude response of an ideal lowpass analog filter showing the tolerances 192 INFINITE IMPULSE RESPONSE FILTERS the lowpass filter, the frequency interval ≤ ω ≤ ωc is called the passband, and the interval ωc ≤ ω < ∞ is called the stopband Since a transfer function H (s) of the form (4.11) cannot provide such an ideal magnitude characteristic, it is common practice to prescribe tolerances within which these specifications have to be met by |H (j ω)| For example, the tolerance of δp on the ideal magnitude of one in the passband and a tolerance of δs on the magnitude of zero in the stopband are shown in Figure 4.2 A tolerance between the passband and the stopband is also provided by a transition band shown in this figure This is typical of the magnitude response specifications for an ideal filter Since the magnitude squared function |H (j ω)| = H (j ω)H (−j ω) is an even function in ω, its numerator and denominator contain only even-degree terms; that is, it is of the form |H (j ω)|2 = C0 + C2 ω2 + C4 ω4 + · · · + C2m ω2m + D2 ω2 + D4 ω4 + · · · + D2n ω2n (4.20) In order that it approximates the magnitude of the ideal lowpass filter, let us impose the following conditions The magnitude at ω = is normalized to one The magnitude monotonically decreases from this value to zero as ω → ∞ The maximum number of its derivatives evaluated at ω = are zero Condition is satisfied when C0 = 1, and condition is satisfied when the coefficients C2 = C4 = · · · = C2m = Condition is satisfied when the denominator is + D2n ω2n , in addition to condition being satisfied The magnitude response that satisfies conditions and is known as the Butterworth response, whereas the response that satisfies only condition is known as the maximally flat magnitude response, which may not be monotonically decreasing The magnitude squared function satisfying the three conditions is therefore of the form |H (j ω)|2 = 1 + D2n ω2n (4.21) We scale the frequency ω by ωp and define the normalized analog frequency = ω/ωp so that the passband of this filter is p = Now the magnitude of the lowpass filter satisfies the three conditions listed above and also the condition that its passband be normalized to p = Such a filter is called a prototype lowpass Butterworth filter having a transfer function H (p) = H (s/p), which has its magnitude squared function given by |H (j )|2 = 1 + D2n 2n (4.22) The following specifications are normally given for a lowpass Butterworth filter: (1) a magnitude of H0 at ω = 0, (2) the bandwidth ωp , (3) the magnitude at the MAGNITUDE APPROXIMATION OF ANALOG FILTERS 193 bandwidth ωp , (4) a stopband frequency ωs , and (5) the magnitude of the filter at ωs The transfer function of the analog filter with practical specifications like these will be denoted by H (p) in the following discussion, and the prototype lowpass filter will be denoted by H (s) Before we proceed with the analytical design procedure, we normalize the magnitude of the filter by H0 for convenience and scale the frequencies ωp and ωs by ωp so that the bandwidth of the prototype filter and its stopband frequency become p = and s = ωs /ωp , respectively The specifications about the magnitude at p and s are satisfied by the proper choice of D2n and n in the function (4.22) as explained below √ If, for example, the magnitude at the passband frequency is required to be 1/ 2, which means that the log magnitude required is −3 dB, then we choose D2n = If the magnitude at the passband frequency = p = is required to be − δp , then we choose D2n , normally denoted by  , such that |H (j 1)|2 = 1 = = (1 − δp )2 + D2n + 2 (4.23) If the magnitude at the bandwidth = p = is given as −Ap decibels, the value of  is computed by 10 log = −Ap + 2 10 log(1 +  ) = Ap log(1 +  ) = 0.1Ap (1 +  ) = 100.1Ap " From the last equation, we get the formula  = 100.1Ap − and  = 100.1Ap − Let us consider the common case of a Butterworth filter with a log magnitude of −3 dB at the bandwidth of p to develop the design procedure for a Butterworth lowpass filter In this case, we use the function for the prototype filter, in the form |H (j )|2 = 1 + 2n (4.24) This satisfies the following properties: The magnitude squared of the filter response at = is one The magnitude squared at = is 12 for all integer values of n; so the log magnitude is −3 dB The magnitude decreases monotonically to zero as → ∞; the asymptotic rate is −40n dB/decade 194 INFINITE IMPULSE RESPONSE FILTERS 1.2 Magnitude 0.8 0.6 0.4 0.2 n=2 n=6 0 0.5 Figure 4.3 2.5 1.5 Frequency in rad/sec 3.5 Magnitude responses of Butterworth lowpass filters The magnitude response of Butterworth lowpass filters is shown for n = 2, 3, , in Figure 4.3 Instead of showing the log magnitude of these filters, we show their attenuation in decibels in Figure 4.4 Attenuation or loss measured in decibels is defined as −10 log |H (j )|2 = 10 log(1 + 2n ) The attenuation over the passband only is shown in Figure 4.4a, and the maximum attenuation in the passband is dB for all n; the attenuation characteristic of the filters over ≤ ≤ 10 for n = 1, 2, , 10 is shown in Figure 4.4b 4.2.2 Design Theory of Butterworth Lowpass Filters Let us consider the design of a Butterworth lowpass filter for which (1) the frequency ωp at which the magnitude is dB below the maximum value at ω = 0, and (2) the magnitude at another frequency ωs in the stopband are specified When we normalize the gain constant to unity and normalize the frequency by the scale factor ωp , we get the cutoff frequency of the normalized prototype filter p = and the stopband frequency s = ωs /ωp After we have found the transfer function H (p) of this normalized prototype lowpass filter, we restore the frequency scale and the magnitude scale to get the transfer function H (s) approximating the prescribed magnitude specification of the lowpass filter The analytical procedure used to derive H (p) from the magnitude squared function of the prototype lowpass filter is carried out simply by reversing the MAGNITUDE APPROXIMATION OF ANALOG FILTERS 195 7.0 Passband attenuation a, dB 6.0 5.0 4.0 3.0 2.0 n=1 1.0 0.2 0.4 10 0.6 ω (a) 0.8 1.0 140 10 Stopband attenuation a, dB 120 100 80 60 40 n=1 20 0 2.0 4.0 6.0 8.0 10 ω (b) Figure 4.4 Attenuation characteristics of Butterworth lowpass filters in (a) passband; (b) stopband ... frequency used in H (ej ω ) 190 INFINITE IMPULSE RESPONSE FILTERS where H (j ω) is the frequency response, |H (j ω)| is the magnitude response, and θ (j ω) is the phase response We also find the magnitude... 194 INFINITE IMPULSE RESPONSE FILTERS 1.2 Magnitude 0.8 0.6 0.4 0.2 n=2 n=6 0 0.5 Figure 4.3 2.5 1.5 Frequency in rad/sec 3.5 Magnitude responses of Butterworth lowpass filters The magnitude response. .. magnitude response of the prototype filter given by (4.46) It has a magnitude of −0.5 dB at = and approximately −33 dB at = 5, which exceeds the specified value 202 INFINITE IMPULSE RESPONSE FILTERS

Ngày đăng: 29/09/2013, 21:20

TỪ KHÓA LIÊN QUAN