离散时间信号处理DSP第章.ppt
Digital Signal Processing,Chapter 7 Filter Design Techniques,2,7.1 Design of Discrete-Time IIR Filters from Continuous-Time Filters,In the chapter, we deal with the digital filter design methods in which a desired frequency response of the system is approximated by a system function consisting of a ratio of polynomials. Generally, the design of an IIR digital filter is carried out in three steps as follows. Specifications Approximations Realization,3,7.1 Design of Discrete-Time IIR Filters from Continuous-Time Filters,4,Figure 1 Ideal magnitude specifications for digital lowpass filter,理想滤波器的幅度特性有理想、陡截止的通带和无穷大衰减的阻带两个范围,如图1所示,这显然是无法实现的,因为它们的单位取样响应均是非因果和无限长的。 实践中只能用一种因果可实现的滤波器去与之逼近,使其满足给定的误差容限。一个实际滤波器的幅度特性在通带中允许有一定的波动,阻带衰减则应大于给定的衰减要求,且在通带与阻带之间允许有一定宽度的过渡带,如图2所示。,5,Figure 2 Magnitude specifications for digital lowpass filter,6,Lowpass filter specification,Passband(通带) The frequency range of 0 pc is called the passband; pc is the passband cutoff frequency(通带截止频率); p is the passband tolerance, that is Stopband(阻带) The frequency range of sc is called the stopband; sc is the stopband cutoff frequency(阻带截止频率); s is the stopband tolerance, that is Transition band The frequency range of pc sc is called the transition band;,7,Lowpass filter specification,Maximum passband attenuation p Minimum stopband attenuation p Commonly, the maximum magnitude response is assumed to be normalized to unity. For a lowpass filter, we have,8,Design Stages for Digital Filter,Design stages Analog filter approximations, including Butterworth, Chebyshev and elliptic. Continuous-time to discrete-time transformation, including impulse invariance and bilinear transformation. Frequency transformations, that is, transforming a lowpass filter into a highpass or bandpass or bandstop filter.,9,1 Analog Butterworth(巴特沃思)Lowpass Filters,The Butterworth lowpass filter has several properties: All poles, and no zero. No ripples(波纹) in the passband and stopband. The Butterworth lowpass filter is defined in a magnitude-squared function(幅度平方函数): where N is a positive integer and is called the order of the filter, c is the passband cutoff frequency,10,1 Analog Butterworth Lowpass Filters,Because The cutoff frequency c is called the half-power frequency point of the filter. The maximum passband attenuation is the frequency c is also called 3-dB cutoff frequency or 3-dB bandwidth of the filter.,11,1 Analog Butterworth Lowpass Filters,In practical applications, the analog lowpass filter is specified by the specifications as follows: pc: the passband cutoff frequency in rad/s; p: the maximum passband attenuation in dB; sc: the stopband cutoff frequency in rad/s; s: the minimum stopband attenuation in dB; To use the Butterworth lowpass filter to approximate a lowpass filter, we should obtain the order N and the 3-dB cutoff frequency c.,12,1 Analog Butterworth Lowpass Filters,The magnitude response of the filter is The maximum passband attenuation p arrives at =pc, which is represented as The minimum stopband attenuation s arrives at =sc, which is represented as,(7.141),(7.142),(7.140),13,1 Analog Butterworth Lowpass Filters,Solving the above two equations, we have,14,1 Analog Butterworth Lowpass Filters,There are two choices to determine c Substituting N in Eq.(7.141), we have Using this formula to determine c, p is exactly met at =pc and s is exceeded for the stopband, provided that p3dB. Substituting N in Eq.(7.142), we have Using this formula to determine c, s is exactly met at =sc and p is exceeded for the passband, provided that s3dB.,15,1 Analog Butterworth Lowpass Filters,To determine the transfer function Ha(s) of the filter, we substitute s = j, therefore The poles of the magnitude-squared function Ha(s)Ha(-s) are given by Figure 3 shows all the poles when N = 3.,16,Figure 3 Pole plot for a third-order Butterworth filter,k = 0,k = 1,k = 2,k = 3,k = 4,k = 5,j,17,1 Analog Butterworth Lowpass Filters,The 2N poles equally spaced in angle on a circle in the s-plane. They are symmetric about the imaginary axis. In order to obtain a stable system, we choose the n poles on the left-side of the s-plane. Then, we get the transfer function as follows where,18,1 Analog Butterworth Lowpass Filters,The attenuation of the Butterworth approximation increases monotonically(单调地)with frequency. And it increases very slowly in the passband and quickly in the stopband. If one wants to increase the attenuation one has to increase the filter order. The 3-dB bandwidth is unrelated to the filter order.,19,Figure 4 The magnitude-frequency response of Butterworth Lowpass Filters,20,2 Analog Chebyshev(切贝雪夫)Lowpass Filters,The Chebyshev-I lowpass filters have equiripple(等波纹的) magnitude response in the passband and monotonic(单调的) magnitude response in the stopband. The magnitude-squared response of an analog Chebyshev-I lowpass filter is given by where N is the order of the filter, is a positive and less than unity number which is the passband ripple factor, c is the passband cutoff frequency at which the attenuation of the magnitude response is not necessary to be 3-dB. The function TN(x) is an Nth-order Chebyshev polynomial defined by,(7.147),21,2 Analog Chebyshev Lowpass Filters,The characteristics of the Chebyshev-I filters are as follows: At = 0, |Ha(j0)| = 1 for N odd and |Ha(j0)| = for N even; At =c, |Ha(jc)| = for all N; Within the passband of 0c, |Ha(j)| oscillates between 1 and ; For c, |Ha(j)| approaches zero monotonically and rapidly; At =s (the stopband cutoff frequency), |Ha(js)| = 1/A.,22,Figure 5 Analog Chebyshev Lowpass Filters,23,2 Analog Chebyshev Lowpass Filters,In the design of Chebyshev-I lowpass filter, the specifications are given by: c: the passband cutoff frequency in rad/s; p: the passband ripple in dB; s: the stopband cutoff frequency in rad/s; s: the minimum stopband attenuation in dB; To design the filter, the order N and ripple factor should be determined.,24,2 Analog Chebyshev Lowpass Filters,Since Then And Therefore,25,2 Analog Chebyshev Lowpass Filters,To obtain the transfer function Ha(s) of the Chebyshev-I filter, we substitute =s/j into Eq.(7.147) (p19), and then we get There are 2N poles of the magnitude-squared function Ha(s)Ha(-s), They are spaced on a ellipse in the s-plane and symmetric about the imaginary axis. In order to obtain a stable system, we choose the N poles on the left-side of the s-plane and get the transfer function as follows.,26,2 Analog Chebyshev Lowpass Filters,where and,27,两种典型模拟滤波器,两种典型模拟滤波器: Butterworth(巴特沃思)滤波器:幅频特性单调下降,但衰减特性较差; Chebyshev(切贝雪夫)滤波器:在通带(或阻带)中幅频特性单调下降,在阻带(或通带)中有波纹,衰减特性好于巴特沃思滤波器;,28,Analog-to-Digital Filter Transformations,The continuous-time to discrete-time transformations include three steps: Transformations of specifications in discrete-time domain into ones in continuous-time domain. Designing the analog filter according to the specifications in continuous-time domain. Transform the filter in s domain into the one in z domain. The main methods of transformations have two kinds: Impulse-invariance method Bilinear transformation method,29,z transform and Laplace transform,Laplace transform z transform The Laplace transform of x(nT) is Therefore the relationship between the Laplace transform and z transform of x(nT) is,30,z transform and Laplace transform,Let and The relationship between r and If = 0 (s 平面的虚轴), r = 1(z平面单位圆上); If 0 (s 平面的右半平面), r 1(z平面单位圆外); If 0 (s 平面的左半平面), r 1(z平面单位圆内). The relationship between and : = T If = 0( s 平面的实轴), = 0( z平面正实轴) = 0( s 平面平行于实轴的直线), = 0T( z平面始于原点角度为 = 0T 的辐射线).,31,z transform and Laplace transform, 从 /T 增长到 /T,相应的, 从 增长到 ,即 s 平面宽为 2/T 的一个水平条带相当于 z 平面辐角转了一周,即整个 z 平面。 因此 每增加一个抽样角频率 s = 2/T,则 增加 2。所以从 s 平面到 z 平面的映射是多值映射。,32,7.1.1 Filter Design by Impulse Invariance,The transfer function of the analog filter can be expressed in terms of a partial-fraction expansion as follows The corresponding impulse response is,33,7.1.1 Filter Design by Impulse Invariance,Sampling the analog impulse response, we can obtain the discrete-time impulse response The corresponding discrete-time transfer function is,34,s 平面的单极点 s = pl 变换为 z 平面上 z = eplT 处的单极点; Ha(s) 与 H(z) 的部分分式的系数是相同的; 如果模拟滤波器是稳定的,即所有极点 s = pl 的实部小于零,则所有 z = eplT 均在单位圆内,即变换后的数字滤波器也是稳定的。,7.1.1 Filter Design by Impulse Invariance,35,7.1.1 Filter Design by Impulse Invariance,In order to obtain the same passband gain for the continuous- and discrete-time filters, we should use the following expression for Hd(z):,36,Example,Transform the continuous-time lowpass filter transfer function given by into a discrete-time transfer function using the impulse invariance transformation method with s = 10 rad/s. Solution,37,Example (cont.),38,Example (cont.),39,7.1.2 Bilinear Transformation,The bilinear transformation method avoids the problem of aliasing. In the bilinear transformation method, the entire s-plane is mapped into the entire z-plane. The left half s-plane maps into the interior of the unit circle in the z-plane; The right half s-plane maps into the exterior of the unit circle in the z-plane; The imaginary axis of the s-plane maps onto the unit circle;,40,7.1.2 Bilinear Transformation,The bilinear transformation is defined as If the continuous-time transfer function is Ha(s), then Frequency transformation relation,41,7.1.2 Bilinear Transformation,That is Since We should choose,42,7.1.2 Bilinear Transformation,In conclusion, the bilinear transformation of a continuous-time transfer function into a discrete-time transfer function is Therefore the bilinear transformation maps analog frequencies into digital frequencies as follows: For high frequencies, this relationship is highly nonlinear. The bilinear transformation method avoids the problem of aliasing, but the price paid for this is the introduction of a distortion in frequency axis, known as the warping.,43,7.1.2 Bilinear Transformation,The warping effect can be compensated by prewarping the frequency specifications. The steps are Prewarp the passband and stopband frequencies and obtain ap and ar through the following mapping: Generate Ha(s) satisfying the specifications for the frequencies ap and ar ; Obtain Hd(z) by replacing s with in Ha(s).,44,7.2 Design of FIR Filters by Windowing,Basic conception In order to design the frequency responses satisfying the prescribed specifications, the filter order and multiplier coefficients should be determined. Characteristics of FIR filters It is possible to obtain exact linear phase. FIR systems are always stable. Fast algorithms such as FFT can be used. A higher order means more delays, multipliers and adders. Design approaches frequency sampling, window functions, maximally flat approximation.,45,Ideal characteristics of standard filters,Four commonly used FIR filters Lowpass filters Highpass filters Bandpass filters Bandstop filters Fourier transform pair,46,Four ideal filters lowpass,Frequency response Impulse response,47,Figure - impulse response of lowpass filter,48,Four standard filters highpass,Frequency response Impulse response,49,Figure - impulse response of highpass filter,50,Four standard filters bandpass,Frequency response Impulse response,51,Figure - impulse response of bandpass filter,52,Four standard filters bandstop,Frequency response Impulse response,53,Figure - impulse response of bandstop filter,54,Notes,The durations of the impulse responses of the four kinds of filters are infinite. The impulse responses are noncausal. So, all these four kinds of filters are ideal ones and can not be realized.,55,Properties of Linear Phase FIR Filters,The linear-phase FIR filters: This equation shows that the h(n) of a linear-phase FIR filter is symmetric or antisymmetric about M/2. There are four kinds of linear-phase FIR filters, which is shown in the figures.,56,Properties of Linear Phase FIR Filters,57,Frequency sampling(频率采样法),工程上,常给定频域上的技术指标,所以采用频域设计更直接。 基本思想:使所设计的FIR数字滤波器的频率特性在某些离散频率点上的值准确地等于所需滤波器在这些频率点处的值,在其它频率处的特性则有较好的逼近。,58,Frequency sampling,Let Hd() be the desired frequency response. The design approach of frequency sampling is just to sample the Hd(). Suppose that H(k) are samples of the Hd(), i.e. Let then A(k) = |H(k)| (k) = argH(k) A(k) is the magnitude of the H(k) and (k) its phase.,59,Frequency sampling,We can get the impulse response h(n) from H(k) using IDFT Then the z transform of the designed FIR filter we can also get the frequency response H(e j),60,For example,Ripples in the passband and stopband.,61,Frequency sampling,If the linear phase is required, A(k) and (k) must satisfy the conditions for linear phase. Four types of linear-phase filters Type I: the order M is even and the h(n) is symmetric. Type II: the order M is odd and the h(n) is symmetric. Type III: the order M is even and the h(n) is antysymmetric. Type IV: the order M is odd and the h(n) is antysymmetric. Relation between the length of h(n), N, and order M N = M +1,62,Frequency sampling type I,In this case, the order M is even and the h(n) is symmetric. Review The frequency response H() is symmetric about = 0 and = .,63,Frequency sampling type I,Phase Magnitude,64,Frequency sampling type II,In this case, the order M is odd and the h(n) is symmetric. Review The frequency response H() is symmetric about = 0 and antisymmetric about = . So, H() = 0, at = .,65,Frequency sampling type II,Phase Magnitude Because H() = 0, at = , highpass and bandstop filters cannot be realized in Type II filters.,66,Frequency sampling type III,In this case, the order M is even and the h(n) is antisymmetric. Review The frequency response H() is antisymmetric about = 0 and = . So, H() = 0, at = 0 and = .,67,Frequency sampling type III,Phase Magnitude Because H() = 0, at = 0 and = , lowpass, highpass and bandstop filters cannot be realized in Type III filters.,68,Frequency sampling type IV,In this case, the order M is odd and the h(n) is antisymmetric. Review The frequency response H() is antisymmetric about = 0 and symmetric at = . So, H() = 0, at = 0.,69,Frequency sampling type IV,Phase Magnitude Because H() = 0, at = 0, lowpass and bandstop filters cannot be realized in Type IV filters.,70,72,Design of Linear-Phase FIR filters using windows,All ideal filters have infinite duration, so they can not be realized. Truncating the impulse response h(n), we can get its approximation with finite duration. where M is the filter order and assuming that it is even. The transfer function is,73,Design of Linear-Phase FIR filters using windows,After h(n) is truncated, the system is still noncausal. In order to make it causal, we can shift it right by M/2, without either distorting the filter magnitude response or destroying the linear-phase property. There are ripples close to the ban