DSP-I DSP-I DSP-I DSP-I Digital Signal Proessing I (8-79) Fall Semester, 005 IIR FILER DESIG EXAMPLE hese notes summarize the design proedure for IIR filters as disussed in lass on ovember. Introdution: We are disussing how to design a disrete-time lowpass filter using both the impulse invariane method and the bilinear transform method. he spes for the filter to be designed are Passband utoff frequeny:! p 0.5" Stopband utoff frequeny:! s 0.35" Passband ripple : 3!dB! # H( e j! ) # 0 db,! #! p Stopband attenuation: H( e j! ) # 0 db,! s #! # " In terms of the parameters $ and $, this means that $ 0 3 0 0.7079 $ 0 0 0 0. For onveniene we define two new parameters k and k that are losely related to $ and $ as follows: k % --------------------- ( $ ) 0.9953. ote that the values of passband and stopband attenuation are given in db. If x has the dimensions of amplitude or magnitude (as opposed to energy or power), the value of x expressed in db would be 0log 0 ( x)
IIR filter design example -- Fall, 005 Finally, we are designing our filter by transforming the frequeny response of a ontinuous-time Butterworth filter. As you will reall, the Butterworth filter has the transfer funtion he parameter speifies the number of poles in the prototype filter, and the parameter speifies the ritial utoff frequeny. ote that the magnitude response of the Butterworth filter dereases monotonially with inreasing, that the falloff in response as we transit from passband to stopband beomes sharper as inreases, and that H( j ) equals.0 when 0 and when for all values of. As you will reall from lass, a Butterworth filter with parameters and has poles that fall in the left half of the s-plane, in omplex onjugate loations along a irle of radius separated by angles of ". k ---- 99 $ H( j ) --------------------------- + ------ ' ) ( * Determining design parameters Design proedure using impulse invariane Using the impulse invariane design proedure, we have noted that the relation between frequeny in the ontinuous-time and disrete-time domains is!, where is merely a design parameter (and not neessarily the sampling frequeny). Leaving as an arbitrary onstant for now, we obtain p! p 0.474 s! s.0996 At the passband edge frequeny, H( j ) --------------------------- p + ) ------, * ( $ ) + ' ( With a few algebrai manipulations we obtain p * --------------------- ' ( ( $ ) k
IIR filter design example -3- Fall, 005 Similarly, at the stopband edge frequeny we have H( j ) --------------------------- ------ s + ) ', * $ + ( whih produes s * ---- k ' ( $ Dividing, we obtain ( p ) ---------------------------- ( s ) k ---- k or log( k -- k ) log( ------------------------------ s p ).744 ote that sine s! ------ s! ------------- ------ s, the design parameter has no effet at all on the value of that is p! p! p needed. Furthermore, as expeted, the value of speified inreases as either $ or $ dereases in magnitude (whih implies dereasing the ripple in the passband and/or stopband) or as the ratio s p dereases (whih implies a derease in the width of the transition band). Sine the number of poles must be an integer, we round up to 3. Mathing the frequeny response exatly at passband produes p * or ' ( k p ------------- k (his value is slightly different from the one I gave in lass.) If we were instead to math the frequeny response at stopband, we would obtain s * or ' ( k s ------------- k 0.476 --------------- 0.5 --------------- 0.476 0.5 In priniple, any value of the ritial frequeny that satisfies --------------- # would be valid. As disussed in lass, we will hoose the value that meets the passband spe exatly, 0.476 beause # --------------- this value leaves the greatest margin for error at the stopband edge. Sine the impulse invariane proedure always inurs a ertain degree of aliasing, it will be expeted that the atual response of the filter at the stopband edge will be larger than designed for. Hene, having the stopband edge response be overdesigned will leave more room for error to allow for the effets of aliasing.
IIR filter design example -4- Fall, 005 Prototype filter design As noted above, the poles of a Butterworth filter lie in the left half of the s-plane on a irle of radius in omplex onjugate pairs separated by an angle of " radians. Sine there are three poles, this produes a filter with the system funtion 3 ---------------------------------------------------------------------------------------------------------------------- ( s e j" )( s e j (" + " 3) )( s e j (" " 3) ) Plugging in the value of 0.476, we obtain 3 ---------------------------------------------------------------------------------------------------------------------- ( s e j" )( s e j (" + " 3) )( s e j (" " 3) ) and (with the help of MALAB) we obtain numerially ( 0.476 ) 3 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- ( s + 0.476 ) ( s ( 0.36 + 0.408j) ) ( s ( 0.36 0.408j) ) Conversion to disrete-time form Using partial frations we an rewrite the system funtion of the ontinuous-time prototype filter as A k - ----------------- ( s s k ) k where the parameters A k are the ontinuous-time residues of the poles s k. Using the MALAB routine residue we find the residues for the three poles, produing the transfer funtion 0.476 0.36 0.36j 0.36 + 0.36j ------------------------------- s + 0.476 + ----------------------------------------------------------- s ( 0.36 + 0.408j) + s ----------------------------------------------------------- ( 0.36 0.408j) he orresponding disrete-time filter has the transfer funtion A k - ------------------------------- k e s k z ' ) ( * ote that the poles of the ontinuous-time filter, s k are all of the form of a (generally omplex) onstant divided by the parameter. Sine s k is multiplied by wherever it appears in the equation for above, the speifi value hosen for has no effet at all on the disrete-time filter that results from the design proess. Hene we normally let for simpliity. his produes the transfer funtion
IIR filter design example -5- Fall, 005 or 0.476 0.36 0.36j 0.36 + 0.36j -------------------------------------------------- exp( 0.476)z + ---------------------------------------------------------------------- exp( 0.36 + 0.408j)z + ---------------------------------------------------------------------- exp( 0.36 0.408j)z 0.476 0.36 0.36j ----------------------------- 0.64z + 0.36 + 0.36j -------------------------------------------------------- ( 0.75 + 0.33j)z + -------------------------------------------------------- ( 0.75 0.33j)z Combing the seond and third terms we obtain 0.476 0.47 + 0.34z ----------------------------- 0.64z + ------------------------------------------------------.45z + 0.64z his expression an be implemented easily using any of the tehniques disussed in OSB Chapter 6. Design proedure using bilinear transformation Determining design parameters Here we will onvert from ontinuous-time to disrete-time form using the bilinear transform s -- z ---------------- + z his produes the nonlinear relationship between ontinuous-time frequeny and disrete-time frequeny -- tan(! ) Converting the ritial frequenies! p and! s to their ontinuous-time ounterparts produes p -- tan(! p ) s -- tan(! s ) We use again the design equation 0.480.6 log( k -- k ) log( ------------------------------ s p ).4546 ote that although we still need to have 3 poles, the atual frational value of smaller beause of the greater ratio of stopband to passband edge frequenies provided by the nonlinear frequeny warping of the bilinear transform. We will math the spes exatly in the passband, although there is no speifi need to do so when we use the bilinear transform. he equation for the ritial frequeny then beomes p 0.4806 ------------- --------------- k
IIR filter design example -6- Fall, 005 Prototype filter design As before, the transfer funtion for the Butterworth filter is 3 ---------------------------------------------------------------------------------------------------------------------- ( s e j" )( s e j (" + " 3) )( s e j (" " 3) ) Using the MALAB routine poly and the value for funtion of the prototype filter is 0.0 3 ------------------------------------------------------------------------------ s 3 --------------------- 0.96s 0.460s 0.0 + + ------------------ + ------------ 3 that we had obtained we find that the transfer Conversion to disrete-time form We an now substitute diretly the bilinear transform relationship s -- z ---------------- + z 0.0 3 ------------------------------------------------------------------------------------------------------------------------------------------------------- -- z + ) ---------------- ' + z, * 3 0.96 -- z + ) ---------------- ' + z, * 0.460 ( -- z + ) ---------------- ' + z, * ( 0.0 + --------------------------------------------- + ------------------------------------------ ( + ------------ 3 ote that the design parameter appears in ubi form in the denominator of every term in numerator and denominator. Hene its speifi value does not matter and we an anel it from the design equation. he value of the parameter is frequently set to equal to simplify the expression for the bilinear transform. We also note that simplifying the expression above is an algebrai nightmare. Using the MALAB routine bilinear with the poles and (null) zeros of as input parameters (and a value of for the parameter ), we obtain 0.00854( + 3z + 3z + z 3 ) -------------------------------------------------------------------------------------.064z +.59z 0.386z 3