Lecture Filtering: Applied Concept In the previou two lecture, you have learned about finite-impule-repone (FIR) and infinite-impule-repone (IIR) filter. In thee lecture, we introduced the concept of filtering in the context of low-pa filtering a ignal. In thi lecture, we will firt introduce other type of filter, namely high-pa, band-pa, band-top and notch, and will give you the tool to deign thee filter uing the low-pa filter deign method you have een in the previou lecture. We will then dicu the application of the bilinear tranform to a dicretetime filtering problem highlighting the importance of prewarping frequencie when converting between dicrete time and continuou time. Finally, we will dicu practical conideration that motivate the election of FIR or IIR filter. Outline. High-Pa Filter Deign................................ Deigning a high-pa filter in CT...................... Deigning a high-pa filter in DT.................... 4. Band-Pa Filter Deign.............................. 5.3 Band-Stop Filter Deign.............................. 8.4 Notch Filter Deign................................ 9.5 Frequency Warping and the Bilinear Tranform..................6 IIR v FIR Filter Deign............................... High-Pa Filter Deign Conider the ideal frequency repone of low-pa and high-pa filter in CT: { ω ω c H LPI (ω) = ω c < ω { ω ω c H HPI (ω) = ω c < ω. One can readily relate the two a H HPI (ω) = H LPI (ω), and may therefore be inclined to calculate the tranfer function of a high-pa filter from the tranfer function of a low-pa filter a: Updated: December 4, 7 H HP () = H LP ().
Let u conider thi tranformation in more detail. Take, for example, a firt-order low-pa filter with CT tranfer function H LP () = ω c. + ω c Uing the above method, the correponding high-pa filter i calculated a H HP () = ω c + ω c = and ha, for ω c =, the following magnitude repone: + ω c, HHP(jω) (db) Ideal H HP () 4 3 4 5 6 Now conider the econd-order, low-pa Butterworth filter with CT tranfer function H LP () = ω c +. ω c + ωc The correponding high-pa filter i calculated a H HP () = H LP () = + ω c +, ω c + ωc and, with ω c =, ha the magnitude repone: HHP(jω) (db) Ideal H HP () 4 3 4 5 6 Note that thi repone i not flat and doe not roll-off at 4 db/decade, a one would expect from a econd-order Butterworth filter. Thi i due to the relationhip H HP () = H LP () only holding when conidering the ideal repone H HPI (ω) and H LPI (ω); the actual repone of a low-pa filter will caue undeired behavior... Deigning a high-pa filter in CT We now conider an alternative method to calculate the tranfer function of a high-pa filter from the tranfer function of a low-pa filter by performing a tranformation in the frequency domain. Thi tranformation hould
. preerve tability the open left halfplane hould be mapped to the open left halfplane;. map the jω axi to the jω axi; and 3. map ω = to ω = and ω = to ω =. One uch tranformation i, which atifie the above propertie in the following way:. Let = a + jb. Then = a + jb = a jb a + b, therefore Re () = a, Re ( ) = a a + b and Re () < Re ( ) <. Thu the tranformation preerve tability, ince it map the open left halfplane to the open left halfplane.. Let = jω. Then = j ω, thu the jω axi i mapped to the jω axi. Note that poitive frequencie are mapped to negative frequencie. 3. I trivial to ee. We can ee what thi tranformation doe to the ideal repone, where we now include negative frequencie becaue of item above (although, a we hall ee, it make no difference). H LPI (ω) = H HPI (ω) = H LPI ( /ω) = { ω /ω c /ω c < ω { ω ω c ω c < ω. We therefore have the following technique: given a deired corner frequency ω c for a high-pa filter, we firt deign a low-pa filter H LP () with corner frequency /ω c, and then calculate the tranfer function of the correponding high-pa filter a H HP () = H LP ( ). Example (Deigning a CT high-pa filter) Let ω H LP () = c +, ω c then H HP () = H LP ( ) = 3 ω c + =, + ω ω c c
the ame a we aw before. Now conider a econd-order low-pa Butterworth filter with tranfer function then H HP () = H LP ( ) = H LP () = + ωc ω c + ωc ωc + ω + c ωc, = +, ω c + ωc which i a econd-order, high-pa Butterworth filter with corner frequency ω c. For ω c =, thi ha the deired magnitude repone: HHP(jω) (db) Ideal H HP () 4 3 4 5 6.. Deigning a high-pa filter in DT An alternative frequency-domain tranformation exit in DT. Thi tranformation hould. preerve tability the inide of the unit circle hould be mapped to the inide of the unit circle;. map the unit circle to the unit circle; 3. for z = e jω, map Ω = to Ω = π, and Ω = π to Ω =. One uch tranformation i z z, which atifie the above propertie in the following way:. z < z = z <. z = z = z = 3. z = e j = z = = e jπ z = e jπ = z = = e j Note that z z e jω e jω = e jπ e jω = e j(ω+π) : thi tranformation caue the frequency repone to be hifted by π. We therefore have the following technique: Let Ω c be the deired corner frequency of a highpa filter, where < Ω c < π without lo of generality. Since the ideal frequency repone at negative frequencie i the ame a at poitive frequencie, we deign a low-pa filter H LP (z) with corner frequency at (π + Ω c ) (π + Ω c ) + π = π Ω c, where < π Ω c < π, and calculate the tranfer function of the correponding high-pa filter a H HP (z) = H LP ( z). 4
Example (Deigning a DT high-pa filter) Let +z ( α)( ) H LP (z) = αz, where α i choen uch that the deired roll-off i at π Ω c. Then H HP (z) = H LP ( z) = which ha magnitude repone: H(Ω).5 ( α)( z ) + αz, Ideal H LP (Ω) H HP (Ω) Ω c π Ω c π. Band-Pa Filter Deign The ideal frequency repone of a CT band-pa filter with corner frequencie ω and ω > ω i given by: ω ω H BPI (ω) = ω < ω ω ω < ω and can be achieved by multiplying an ideal low-pa repone with corner frequency ω and an ideal high-pa repone with corner frequency ω : H BPI (ω) = H LPI (ω)h HPI (ω). One might therefore expect to obtain a band-pa filter a follow: H BP () = H LP ()H HP (). A we now illutrate with an example, thi method of deigning a band-pa filter lead to the expected reult, provided that ω /ω. Example Conider the econd-order, low-pa Butterworth filter with corner frequency ω H LP () = ω + ω + ω and the econd-order, high-pa Butterworth filter with corner frequency ω H HP () = + ω + ω. 5
Uing the propoed method, we write the tranfer function of the band-pa filter a H BP () = ω ( + ω + ω )( + ω + ω ). For ω /ω, we obtain the deired magnitude repone: HBP(jω) (db) 4 3 4 5 6 If, however, ω and ω are relatively cloe (e.g. ω = 8 and ω = ), the magnitude repone exhibit undeirable characteritic: trong attenuation in the pa band. HBP(jω) (db) 4 3 4 5 6 We now preent a technique that work for all ratio of ω /ω > : Low-pa to band-pa filter tranformation in CT Similar to the deign of a high-pa filter, we can perform a tranformation in the frequency domain to obtain a band-pa filter from a low-pa filter. In order to obtain a band-pa with corner frequencie ω and ω, we firt deign a low-pa filter with corner frequency ω c = ω ω. We then tranform it uing the following tranformation + ω, where ω = ω ω, the geometric mean of ω and ω. ω i therefore at the center of the paband when viewed on a Bode plot. Let u analyze the effect of uch a tranformation on the ideal repone Note the following: H LPI (ω) = { ω ω c ω c < ω. 6
Low-frequencie of the band-pa are mapped to high-frequencie of the low-pa ( + ω ) lim = and therefore H BPI () = H LPI ( ) =. High-frequencie of the band-pa are mapped to high-frequencie of the low-pa ( + ω ) lim = and therefore H BPI ( ) = H LPI ( ) =. The frequency ω of the band-pa i mapped to a frequency of on the low-pa + ω = =jω and therefore H BPI (ω ) = H LPI () =. The corner frequencie of the band-pa are mapped to the corner frequency of the low-pa. For example, + ω = j ω + ω ω = j(ω ω ) = jω c. =jω ω It can be hown that the tranformation preerve tability. We can then conclude that, ( ω + ω ) H BPI (ω) = H LPI = ω ω < ω ω ω ω ω < ω. Example Conider a econd-order, low-pa Butterworth filter with tranfer function ω c H LP () = +, ω c + ωc where ω c = ω ω. By applying the frequency-domain tranformation, we obtain ( + ω ) H BP () = H LP, where ω = ω ω. The reulting tranfer function H BP () ha the deired magnitude repone, even if ω and ω are cloe together. For example, the magnitude repone of H BP () for ω = 8 and ω = i hown below. 7
HBP(jω) (db) 4 3 4 5 6 Low-pa to band-pa filter tranformation in DT Alternative frequency-domain tranformation alo exit in DT. One uch tranformation i which ha the following propertie: z z, z = map to z = and z = map to z =. Therefore z = j map to z =. Therefore H BPI (Ω = π) = H BPI (Ω = ) = H LPI (Ω = π) =. H BPI (Ω = π/) = H LPI (Ω = ) =. Thi tranformation reult in a band-pa filter centered at the DT frequency π/. More complicated tranformation mut be ued to center the filter at arbitrary frequencie..3 Band-Stop Filter Deign The ideal frequency repone of a CT band-top filter with corner frequencie ω and ω > ω i given by: ω ω H BSI (ω) = ω < ω ω ω < ω and can be achieved by adding an ideal low-pa repone with corner frequency ω to an ideal high-pa repone with corner frequency ω : H BSI (ω) = H LPI (ω) + H HPI (ω). One might therefore expect to obtain a band-top filter a follow: H BS () = H LP () + H HP (). A wa the cae for the band-pa filter, it turn out that thi way of deigning a band-top filter lead to the deired reult, provided that ω /ω. We illutrate thi with an example. 8
Example Conider the econd-order, low-pa Butterworth filter with corner frequency ω H LP () = ω + ω + ω and the econd-order, high-pa Butterworth filter with corner frequency ω H HP () = + ω + ω. Uing the propoed method, we write the tranfer function of the band-top filter a ω H BS () = + ω + ω + + ω + ω For ω /ω, we obtain the deired magnitude repone: HBS(jω) (db) 4 3 4 5 6 If, however, ω and ω are relatively cloe (e.g. ω = 8 and ω = ), the magnitude repone exhibit undeirable characteritic: relatively bad attenuation in the top band and unwanted attenuation in the pa band. HBS(jω) (db) 4 3 4 5 6 In thi ituation, i.e. if a tight top band i required, frequency-domain tranformation, imilar to thoe ued for band-pa deign, can be ued..4 Notch Filter Deign Notch filter are band-top filter with a very narrow top band. frequencie cloe to ω c ha a frequency repone given by: ω < ω c ε H NOI (ω) = ω c ε ω ω c + ε ω c + ε < ω where ε i mall and determine the width of the top band. An ideal filter to reject 9
Example (Second-order notch filter) A econd-order, Butterworth notch filter can be decribed by H NO () = + ωc +. ω c + ωc Thi tructure i motivated by the following requirement:. H NO (±jω c ) = : we therefore require the term ( + jω c )( jω c ) = + ω c in the numerator;. H NO () = and H NO (±j ) = : thu motivating the denominator term ω c and repectively; 3. Stability: we therefore damp the filter pole through the introduction of + ω c in the denominator to give the ame pole a a Butterworth filter. The magnitude repone of the filter, for ω c =, i given by: HNO(jω) (db) H NO () 3 3 4 5 6 Another obervation about thi filter tructure can be made: Let H BS () be the tranfer function of a band-top filter, given by the addition of a low-pa and high-pa filter with corner frequencie ω c ε and ω c + ε repectively: H BS () = Now let ε = and oberve that (ω c ε) + (ω c ε) + (ω c ε) + + (ω c + ε) + (ω c + ε). H BS () = H NO () = + ωc +. ω c + ωc A econd-order, Butterworth notch filter can therefore be thought of a a band-top filter of zero width. In practice, the width of the notch can be tuned by adjuting the damping factor..5 Frequency Warping and the Bilinear Tranform Let T be the underlying ampling period for a DT proce. A we aw in Lecture 9, we can convert a CT tranfer function to a DT tranfer function via the bilinear tranform by ubtituting: = ( ) z. T z +
In particular, frequencie in CT are mapped to the following DT frequencie: ( Ω = arctan ω T ), π < Ω π. However, a we aw in Lecture 3, a inuoid of DT frequency Ω correpond to a inuoid at CT frequency Ω/T. For mall frequencie, thi i not an iue, in fact: ( arctan ω T ) ω a ω. T For larger frequencie, thi can be a problem. We will illutrate thi with an example. Example Let T = 3 econd and let H LP () be a econd-order low-pa filter with corner frequency at ω c = rad/, or f c 38 Hz. Applying the bilinear tranform reult in a low-pa filter H LP (z) with DT corner frequency of Ω c = arctan ( T ω ) c = π/ rad. When actually implemented, the reulting corner frequency in CT i π rad/. T = 57 rad/, intead of the deired To avoid thi, we mut therefore pre-warp the frequency in quetion before doing CT filter deign. In particular,. Let ω c be the deired CT corner frequency of a DT filter (eg. the corner frequency for a low-pa or high-pa filter, or one of the corner frequencie for a band-pa, etc.). Let T be the underlying ampling period. Let ω c = T tan ( ωc T ). Note that if then ( ) T Ω c = arctan ω c, ( ( )) Ω c ωc T = arctan tan = ω c. T T 3. Deign CT filter with frequency ω c and obtain H(). 4. Apply the bilinear tranform to obtain the DT filter H(z). = ( ) z T z + Example Let T = 3 econd and let H LP () be a econd-order low-pa filter with deired corner frequency at ω c = rad/. Thi correpond to a deired DT corner frequency of Ω c = rad. Following the above procedure we have that ω c = 35 rad/. Below we how the magnitude repone of the reulting DT filter H LP (z) with and without frequency prewarping.
HLP(Ω).5 ideal no prewarping with prewarping Ω c π.6 IIR v FIR Filter Deign Thi i a huge topic well beyond the cope of thi cla. CAD tool are well etablihed, for example the Filter Deign Toolbox in MATLAB. There are two major choice: Property FIR IIR Stability Alway table Can be untable Numerical Error do not accumulate Error can accumulate Order Uually need to be high order Can be effective at low order Senitivity Can be very enitive to mall filter parameter deviation at higher order Shape Very flexible, arbitrary hape Not a flexible Can be very enitive to mall filter parameter deviation at higher order Cauality Doe not have to be caual Almot alway caual The choice of filter tructure depend on the problem at hand. Good advice i to tart imple: the firt-order IIR low-pa filter i a very good tarting point and urpriingly effective. Latly, if you are going to go through the trouble of uing a high-order FIR filter, do not ue a moving average filter. Significantly better deign exit.