EEO 4 Digital Signal Prcessing Pr. ar Fwler DT Filters te Set #2 Reading Assignment: Sect. 5.4 Prais & anlais /29
Ideal LP Filter Put in the signal we want passed. Suppse that ( ) [, ] X π xn [ ] y[ n] Cx[ n n ] () Want t get ut the signal we want passed but we can accept a small delay (n > ) and an amplitude scaling actr (C > ) Frm the time-shit prperty the DTFT then we need: j n Y X Ce ( ) ( ) Taing C is typical Thus we shuld treat this as (), s we have: jn ( ) Ce C jn ( ) Ce n Fr in the pass band the ilter [, ] Line slpe n Linear Phase 2/29
S r an ideal lw-pass ilter (LPF) we have: π ( ) π jt Ce d, < < ( ), therwise π Slpe n ( ) Summary Ideal Filters. agnitude Respnse: a. Cnstant in Passband b. Zer in Stpband 2. Phase Respnse a. Linear in Passband (negative slpe delay) b. Undeined in Stpband π Phase is undeined in stp band: e? jθ i.e. phase is undeined r requencies utside the ideal passband 3/29
Remember that r DT the requency respnse is a DTFT s is peridic: Ideal Lwpass Filter (LPF) ( ) Cut- requency rad/sample C 4π 3π 2π π π 2π 3π 4π ( ) Linear Phase 4π 3π 2π π - π 2π 3π 4π As always with DT nly need t l here 4/29
Why can t an ideal ilter exist in practice?? T answer this we will ind the ilter s impulse respnse, which is the IDTFT the requency respnse. The requency respnse the ideal LPF is ( ) jt Ce d, < <, therwise Using the IDTFT a rectangle tgether with the time-shit prperty gives S the impulse respnse is: hn [ ] ( / π)sinc [( / π)( n n) ] x[n] δ[n] Ideal LPF hn [ ] n Starts bere input starts Thus, system is nn-causal! n d n 5/29
Ideal Filter Types S ar we ve limited discussin t ideal lwpass ilters. These ideas can be extended t ther ilter types. T be ideal they need t have cnstant magnitude linear phase in their passband(s). te: Althugh it is nt shwn here, all these repeat peridically utside [ π, π]. 6/29
Ple-Zer Placement t Yield Filter Types Althugh there are high-pwered methds ilter design it is useul t understand hw t achieve sme simple ilters via prper placement ples and ers. b b ( ) ( ) + a ( p ) b sets verall gain ilter The lcatins the ples p annd ers impact the shape the requency respnse Lwpass: ples near e j ighpass: ples near e ±jπ ±π 7/29
Eect Ples & Zers n Frequency Respnse DT ilters Im{ } te: Including a ple r er at the rigin Im{ } R{ } R{ } Ω Ω desn t change the magnitude but des change the phase Placing a er at ±π Im{ } R{ } Ω maes (π) Im{ } Placing mre ers/ples Im{ } R{ } Ω gives sharper transitins. R{ } Ω Figure rm B.P. Lathi, Signal Prcessing and Linear Systems 8/29
Simple Lwpass Filters Case #: Im{} a ( ) a Fr a.9 Re{} Case #2: 2 ( ) a + 2 a Im{} Re{} ATLAB r Case # w/ a.9 >> wlinspace(-pi,pi,2); >> b.; >> b [ -.9]; >> req(b,a,w); 9/29
Simple ighpass Filters Ling bac at ple-er plts r PF and LPF we see that each LPF can be cnverted int a PF by lipping: LPF: 2 ( ) a + 2 a PF: 3( ) 2( ) a 2 + a Im{} Re{} /29
Simple Bandpass Filters We can get a simple BPF i we put ples at p,2 j /2 re ± π and ers at ± ( )( + ) ( ) G ( jr )( + jr ) Im{} x x Re{} 2 G 2 r 2 + /29
Simple LPF-t-PF Transrmatin I we have a lwpass ilter but want t use it as a way t create a highpass ilter that is easily dne as llws. We ll illustrate the idea using an ideal LPF (even thugh thse dn t really exist!): ( ) lp 4π 3π 2π π Shit this requency respnse by π rad/sample: lp( π) hp( ) π Gives PF!!! 2π 3π 4π 4π 3π 2π π π 2π 3π 4π π π hp ( ) lp( π) 2/29
S this gives us what we want but hw d we actually *d* it??? I the requency respnse the LPF is given by lp( ) + + be hp( ) j ae be j jπ ae e jπ j e j e jπ hp lp ( ) ( π) + b hp( ) ( ) ( ) + a e j e be j j ae ( π) j ( π) Ceicients PF Ceicients PF 3/29
w changing cus t the transer unctin: lp( ) + b a hp b ( ) b( ) ( ) lp( ) + a( ) + a ( ) Flips ples & eres wrt hp ( ) lp( ) the Im and Re axes LPF PZ-Plt Im{} PF PZ-Plt Im{} x x Re{} x x Re{} Filters with real ceicients have ple-er symmetry acrss the real axis 4/29
And these results then impact the Dierence Equatin view: yn [ ] ayn [ ] + bxn [ ] yn [ ] ( ) ayn [ ] + ( ) bxn [ ] Given D.E. r LPF Derived D.E. r PF Suppse yu dn t have the TF, FR r DE. But have the impulse respnse r a LPF Applying the mdulatin (requency shit) prperty DTFT gives hp ( ) lp( π) jπ n h [ n] e h [ n] hp ( ) lp h [ n] h [ n] hp n lp 5/29
Summary: LPF-t-PF Transrmatin hp ( ) lp( ) hp ( ) lp( π) Flips ples/ers Shits FR by π ( ) h [ n] h [ n] hp n lp Alternating sign change lp ( ) + be j ae j hp ( ) b e ( ) + a e ( ) j j lp ( ) + b a hp ( ) b ( ) + a ( ) yn [ ] ayn [ ] + bxn [ ] yn [ ] ( ) ayn [ ] + ( ) bxn [ ] 6/29
Sme Useul Filters Design by Ple-Zer Placement Digital Resnatrs as tw cmplex-cnjugate ples placed near the UC t create a resnate pea at a desired requency. Their lcatin determines characteristics: Angle will be apprximately at the resnant pea Radius determines hw prnunced the pea is as tw ers that can be placed where desried usually either Bth at the rigin One at ( ) and ne at ( ±π) Zers at Origin ( ) j j ( re )( re ) b 2rcs( ) + r b ( ) 2 2 ( ) G Zers at ± ( )( + ) j j ( re )( re ) 2 ( ) G 2rcs( ) + r ( ) 2 2 7/29
Resnatr w/ Zers at the rigin b b ( ) j j re re 2rcs( ) + r 2 2 ( )( ) ( ) B shws that: r cs ( ) ( 2 r ) 2r cs + ( ) 3 db 2 r 8/29
Resnatr w/ Zers at ± ( )( ) j j ( re )( re ) ( ) 2 + ( ) G G 2rcs( ) + r ( ) 2 2 9/29
Oscillatr ( ) j j ( re )( re ) b 2rcs( ) + r b ( ) 2 2 br hn n un n [ ] sin ( ( + ) ) [ ] sin( ) I we put the ple n the unit circle (r ) then this impulse respnse des nt decay and the system can be used as an scillatr. Fr mre details see Sect. 5.4.7 the text b. 2/29
tch Filters This simple versin has tw cmplex-cnjugate ers placed n the UC t create a null at a desired requency. Their angle will be at the null requency as tw ples that can be placed where desried usually either Bth at the rigin (this results in an FIR ilter) j Tw cmplex-cnjugate ples at p,2 re ± Ples at Origin Ples at p,2 j j ( )( ) ( ) b e e 2 ( 2cs( ) ) b + 2 ( 2cs( ) + ) b 2 ( ) j re ± j j b ( e )( e ) j j ( re )( re ) 2 b( 2cs( ) + ) 2 2 ( 2rcs( ) + r ) 2 b( 2cs( ) + ) 2 2 ( 2rcs( ) + r ) 2/29
Ples at Origin Ples at p,2 j re ± 22/29
Cmb Filters These have a variety uses. When yu have harmnics that either need t be passed and/r stpped. The name cmes rm the act that these ilters have a FR magnitude that ls lie a cmb many teeth. Simplest rm is an FIR ilter with unirm weights : yn [ ] xn [ ] + Even Transer Functin: ( ) + + ( + ) ers @ e j2π/(+),,,, Ple @ (cancelled by er @ ) Impulse Respnse: Frequency Respnse: hn [ ] + ( ( + ) ) ( ) j/2 sin 2 e ( ) + sin 2 Fund by taing DTFT rectangle starting at (use time-shit prperty) Rectangle starting @ n 23/29
Taing a l at the requency respnse ver the [-π, π ] range: ( ( + ) ) ( ) j/2 sin 2 e ( ) + sin 2 ( ( + ) ) sin 2 π π π sin ( 2) π umeratr is er when ( ) + 2 π ( ) 2π + 24/29
re General Apprach Start with sme FIR ilter ( ) h [ ] Replace by L where L is a psitive integer: L( ) h [ ] L The resulting requency respnse is L jl ( ) [ ] ( ) he L Scrunches by actr L e.g., when π/l we get the riginal FR s pint at π Illustrate with triangle FR nt a real FIR s shape! Just easy t see! L 5 25/29
Let s see what L des rm an impulse respnse and blc diagram viewpint. L( ) [ ] L [] + [] L + 2L [2] + + [ L ] h h h h h h + + + h + + + h + + h L ( ) ( ) (2 ) 2 [] L L L L L L [] + [2] [ ] L s inserted between h[] & h[] L s inserted between h[] & h[2] [ ] h [ n] h[] h[] h[2] h[3] h[] L s L s L s L s etc. 3 L 3 26/29
Applying this idea t the unirm weight FIR ilter we get Transer Functin: Frequency Respnse: L( + ) ( ) L + ( L( + ) ) ( L ) jl /2 sin 2 e ( ) + sin 2 L 3 See b s discussin the use such a cmb ilter t separate slar harmnics rm lunar harmnics in inspheric measurements! 27/29
All-Pass Filters These have cnstant magnitude respnse everywhere! S what is their purpse??!! They are used t mdiy the phase respnse an existing system withut changing its magnitude respnse (i.e., Phase Equaliatin ) Fr sme given real-valued ceicients { } a Deine the plynmial A ( ) a, a Then an all-pass ilter can be rmed as ( ) ap A A ( ) ( ) We can easily veriy that this is indeed all-pass: ) 2 A ( A ( ) ap( ) ap( ) ap( ) j e A ( ) A ( ) j e S as lng as the ilter is rmer lie this, the ilter is all-pass regardless the values the ceicients {a } s the ceicients can be chsen t try t achieve a desired phase respnse! 28/29
All-Pass Ple-Zer Reciprcal Lcatins Because A() is in the denminatr and A( - ) is in numeratr, i there is a ple at p then there is a er at / p. In ther wrds, ples and ers ccur in reciprcal pairs General rm r All-Pass Filter ap * ( β)( β) ( )( ) R α C ( ) * α β β R Real ple/er Reciprcal Pairs R Real ple/er Cnjugate/Reciprcal Quads 29/29