Design of Digital Filters


 Gyles McKinney
 1 years ago
 Views:
Transcription
1 Chapter 8 Desig of Digital Filters Cotets Overview Geeral Cosideratios Desig of FIR Filters Desig of liearphase FIR filters usig widows Timedelay i desired respose Sidelobes Hilbert trasform (9 phase shift) Desig of FIR filters by frequecy samplig Optimum equiripple liearphase FIR filters Compariso of FIR methods Desig of IIR Filters from Aalog Filters IIR filter desig by biliear trasformatio Frequecy Trasformatios Desig of Digital Filters Based o LeastSquares Method Summary
2 8. c J. Fessler, May 7, 4, 3:8 (studet versio) So far our treatmet of DSP has focused primarily o the aalysis of discretetime systems. Now we fially have the aalytical tools to begi to desig discretetime systems. All LTI systems ca be thought of as filters, so, at least for LTI systems, to desig a system meas to desig a digital filter. (The desig of oliear or timevaryig systems is geerally more complicated, ad ofte more case specific.) Goal: give desired magitude respose H d () phase respose H d () tolerace specificatios (how far from ideal?), we wat to choose the filter parameters N, M, {a k }, {b k } such that the system fuctio H(z) = where a =, yields a frequecy respose H() H d (). M k= b kz N k= a kz = g i(z z i) j (z p j), Ratioal H(z), so LTI system described by a costatcoefficiet differece equatio, so ca be implemeted with fiite # of adds, multiplies, ad delays. I other words, filter desig meas choosig the umber ad locatios of the zeros ad poles, or equivaletly the umber ad values of the filter coefficiets, ad thus H(z), h[], H(). Overview N =, FIR or allzero. liear passbad phase. N >, IIR. lower sidelobes for same umber of coefficiets. 8. Geeral Cosideratios Ideally would like N ad M or N + M to be as small as possible for miimal computatio / storage. Causal (for ow) Poles iside uit circle for stability 8.. Causality We will focus o desigig causal digital filters, sice those ca be implemeted i real time. Nocausal filter desig (e.g., for offlie applicatios) is much easier ad may of the same priciples apply ayway. A LTI system is causal iff iput/output relatioship: y[] depeds oly o curret ad past iput sigal values. impulse respose: h[] = for < system fuctio: umber of fiite zeros umber of fiite poles frequecy respose: What ca we say about H()? Fact: if h[] is causal, the PaleyWieer Theorem: H() caot be exactly zero over ay bad of frequecies. (Except i the trivial case where h[] =.) Furthermore, H() caot be flat (costat) over ay fiite bad. H R () ad H I () are Hilbert trasform pairs. Therefore they are ot idepedet. Hece magitude ad phase respose are iterdepedet. Thus those ideal filters with fiite bads of zero respose caot be implemeted with a causal filter. Istead, we must desig filters that approximate the desired frequecy respose H d ().
3 c J. Fessler, May 7, 4, 3:8 (studet versio) Characteristics of practical frequecyselective filters No perfectly flat regios Fact: sice causal filters caot have a bad of frequecies with zero respose, or ca they have ay bad of frequecies over which the frequecy respose is a costat. Proof by cotradictio. Suppose H() = c for, with correspodig impulse respose h[]. Now defie a ew filter g[] = h[] c δ[]. The certaily g[] is also causal. But G() = H() c = for, which is impossible if g[] is causal. Causal filters caot have a bad of frequecies with zero respose. Nor ca they have a ifiitely sharp trasitio betwee the passbad ad the stopbad. Nor ca they have perfectly flat passbad. So a typical realistic magitude respose looks like the followig. H() + δ δ Passbad Ripple PSfrag replacemets Passbad Trasitio Bad δ Stopbad Ripple Stopbad p s π Practical filter desig meas choosig δ, δ, c ad s, ad the desigig N, M, {a k }, {b k } to satisfy those requiremets. Ofte oe must iterate. Ofte we plot H() usig db, i.e., log H(), ad express the ripple i db as well. Note that stopbad ripple is ot defied peaktopeak, sice the highest magitude respose i the stopbad is more importat tha how wiggly the respose is i the stopbad. Example applicatio: CD digital crossover Separate woofer ad tweeter sigals digitally iside CD player, rather i aalog at speaker. Why is passbad ripple tolerable i this cotext (distortio)? Room acoustics act as aother filter. Speaker respose is ot perfectly flat. Keep filter ripple below these other effects. Now imagie that we have specified δ, δ, c ad s, ad we wish to desig N, M, {a k }, {b k } to satisfy those requiremets. As metioed above, we have two broad choices: FIR ad IIR. We focus first o FIR.
4 8.4 c J. Fessler, May 7, 4, 3:8 (studet versio) 8. Desig of FIR Filters A FIR filter of legth M is a LTI system with the followig differece equatio : y[] = M k= b k x[ k]. Note that the book chages the role of M here. Earlier, whe discussig ratioal system fuctios, M was the umber of zeros. Now M is the umber of ozero elemets of h[], which correspods to at most M zeros. (More precisely, we assume b M ad b, but some of the coefficiets i betwee could be zero.) The problem: give δ, δ, c, ad s, we wish to choose M ad {b k } M k= to achieve that goal. We focus o liearphase FIR filters, because if liear phase is ot eeded, the IIR is probably preferable ayway. We focus o lowpass filters, sice trasformatios ca be made to form highpass, badpass from lowpass, as discussed previously. Impulse respose Clearly for a FIR filter h[] = { b, =,..., M, otherwise. So rather tha writig everythig i terms of b k s, we write it directly i terms of the impulse respose h[]. I fact, for FIR filter desig we usually desig h[] directly, rather tha startig from a polezero plot. (A exceptio would be otch filters.) 8.. Symmetric ad atisymmetric FIR filters I focus o the symmetric case. System fuctio: H(z) = M = h[] z. How do we make a filter have liear phase? We previously aswered this i the polezero domai. Now we examie it i the time domai. A FIR filter has liear phase if h[] = h[m ], =,,..., M. Example. For M = 5: h[] = {b, b, b, b, b }. Such a FIR filter is called symmetric. Cautio: this is ot eve symmetry though i the sese we discussed previously. This is related, but ot exactly the same as circular symmetry. { } Example. For M = 3 ad h[] = /,, /. Does this filter have liear phase? Is it lowpass or highpass? H() = + e j + e j = e j [ ej + + e j ] = e j ( + cos ), so sice + cos, H() =, which is liear phase. So it works for this particular example, but why does the symmetry coditio esure liear phase i geeral? Cautio. At this poit the book switches from M k= to M k= apparetly. This icosistet with MATLAB, so there are M factors that appear frequetly i the MATLAB calls. I thik that MATLAB is cosistet ad the book makes a udesirable switch of covetio here.
5 c J. Fessler, May 7, 4, 3:8 (studet versio) 8.5 Symmetric real FIR filters, h[] = h[m ], =,..., M, are liear phase. Proof. Suppose M is eve: H(z) = = = = = M = M/ = M/ = M/ = M/ = h[] z h[] z + h[] z + h[] z + M =M/ M/ = M/ = h[] z ] h[] [z + z (M ) M/ = z (M )/ = Thus the frequecy respose is H() = H(z) z=e j M/ = e j(m )/ h[m ] z (M ) h[] z (M ) ] h[] [z (M )/ + z ((M )/ ) = M/ = e j(m )/ = = e j(m )/ H r () M/ [ ( M H r () = h[] cos Phase respose: = (split sum) ( = M ) (symmetry of h[]) (combie) (split phase). ] h[] [e j((m )/ ) + e j((m )/ ) [ ( )] M h[] cos { M H() =, H r () > M + π, H r () <. )]. (Real sice h[] is real.) The case for M odd is similar, ad leads to the same phase respose but with a slightly differet H r ().
6 8.6 c J. Fessler, May 7, 4, 3:8 (studet versio) I fact, the odd M case is eve easier by otig that h[ + (M )/] is a eve fuctio, so its DTFT is real, so the DTFT of h[] is e j(m )/ times a real fuctio. This proof does ot work for M eve sice the (M )/ is ot a iteger so we caot use the shift property. What about polezero plot? (We wat to be able to recogize FIR liearphase filters from polezero plot.) From above, H(z) = z (M )/ M/ = h[] [ z (M )/ + z ((M )/ )] so H ( z ) = z (M )/ M/ = h[] [ z (M )/ + z ((M )/ )] = z M H(z). Thus H(z) = z (M ) H ( z ). So if q is a zero of H(z), the /q is also a zero of H(z). Furthermore, i the usual case where h[] is real, if q is a zero of H(z), the so is q. Example. Here are two polezero plots of such liearphase filters. Im(z) Im(z) r r Re(z) 4 Re(z) What is differece betwee this ad allpass filter? It was poles ad zeros i reciprocal relatioships for allpass filter. Now we kow coditios for FIR filters to be liear phase. How do we desig oe? Delays I cotiuous time, the delay property of the Laplace trasform is x a (t τ) L e sτ X a (s). How do we build a circuit that delays a sigal? Sice e sτ is ot a ratioal fuctio, so it caot be implemeted exactly usig RLC circuits. So eve though a time delay system is a LTI system, we caot build it usig RLC compoets! We ca make a approximatio, e.g., which is ratioal i s, so we ca desig such a RLC circuit. e sτ sτ + s τ Or, we ca use more mechaical approaches to delay like a tape loop. Picture. write, read, erase head. delay / tape velocity. Aother approach is to rely o sigal propagatio time dow a log wire, ad tap ito the wire at various places for various delays. What about i discrete time? We just eed a digital latch or buffer (flip flops) to hold the bits represetig a digital sigal value util the ext time poit.
7 c J. Fessler, May 7, 4, 3:8 (studet versio) Desig of liearphase FIR filters usig widows Perhaps the simplest approach to FIR filter desig is to take the ideal impulse respose h d [] ad trucate it, which meas multiplyig it by a rectagular widow, or more geerally, to multiply h d [] by some other widow fuctio, where h d [] = π H d () e j d. π π Typically h d [] will be ocausal or at least ofir. {, c, Example. As show previously, if H d () =, otherwise, We ca create a FIR filter by widowig the ideal respose: ( = rect ) c the h d [] = c π sic ( c π ). h[] = w[] h d [] = where the widow fuctio w[] is ozero oly for =,..., M. What is the effect o the frequecy respose? W() = { hd [] w[], =,..., M, otherwise, M = w[] e j ad by timedomai multiplicatio property of DTFT, aka the widowig theorem: where π deotes πperiodic covolutio. H() = W() π H d () = π π π H d (λ) W( λ) dλ, (8) I words, the ideal frequecy respose H d () is smeared out by the frequecy respose W() of the widow fuctio. What would the frequecy respose of the ideal widow be? W() = π δ() = impulse. Such a widow would cause o smearig of the ideal frequecy respose. However, the correspodig widow fuctio would be w[] =, which is ocausal ad ofir. So i practice we must make tradeoffs. Example. rectagular widow. w[] = {, =,...,, otherwise, So by the shift property of the DTFT: h d [] = sic ( ( ) ) ad h[] = So the resultig frequecy respose is H() = e j [ + 4 π cos()]. Picture This is oly a 3tap desig. Let us geeralize ext. k= with H d () = e j rect ( ) π, i.e., c = π/. { sic ( ( ),, sic π δ( πk), a Dirac ) } where sic ( ) = /π.64.
8 8.8 c J. Fessler, May 7, 4, 3:8 (studet versio) Example. rectagular widow. W() = M = w[] = {, =,..., M, otherwise, e j = = e j(m )/ W r (), where W r () = si(m/) si(/), M, =. I this case the ideal frequecy respose is smeared out by a siclike fuctio, because W r () M sic ( M π ). The fuctio si(m/) M si(/) is available i MATLAB as the diric fuctio: the Dirichlet or periodic sic fuctio. How much is the ideal frequecy respose smeared out? The width of the mai lobe of W() is 4π/M, because the first zeros of W r () are at = ±π/m. As M icreases, width of mai lobe W() decreases, so arrower trasitio bad. Example. Here is the case c = π/4 for various values of M. Rectagular Widow Widow Respose Magitude Respose.8 w[] W r () / M.6.4. H() π π. π π Rectagular Widow Widow Respose Magitude Respose.8 w[] W r () / M.6.4. H() π π. π π How did I make these figures? Usig H = freqz(h,, om) sice b = h for causal FIR filters.
9 c J. Fessler, May 7, 4, 3:8 (studet versio) 8.9 Timedelay i desired respose The term e j(m )/ i W() above comes from the fact that the rectagular widow is ot cetered aroud =, but rather is timeshifted to be cetered aroud = (M )/. This phase term will cause additioal distortio of H d (), uless H d () is also phaseshifted to compesate. For a lowpass filter with cutoff c, widowed by a legthm widow fuctio, the appropriate desired respose is: H d () = { e j(m )/, c,, otherwise, = H d () = {, c,, otherwise, so that This is illustrated below. Note that from (8), H() = π π π H d (λ) W( λ) dλ = π h d [] = ( [ c π sic c M ]). π c e jλ(m )/ j( λ)(m )/ si(( λ) M/) e dλ c si(( λ) /) = e j(m )/ c si(( λ) M/) dλ. π c si(( λ) /) Thus there is a overall delay of (M )/ samples from such a legthm causal FIR filter. Without the phase term, the covolutio itegral is severely affected Audio applicatio, F s = 44kHz ad say M = 45. The delay i samples is (M )/ =. The time delay is M T = /44kHz =.5msec. The speed of soud i air is about 33meters / secod, so 3.3 meters away takes about msec. Thus a.5msec delay is well withi the tolerable rage for audio. Ideal Frequecy Respose.3.5 Ideal Impulse Respose H d () h d [] π π. Magitude Respose.3 Causal FIR Filter H() π π h[] Magitude Respose.3 Causal FIR Filter Shifted by (M )/ H().6 h[] π π.
10 8. c J. Fessler, May 7, 4, 3:8 (studet versio) Sidelobes The rectagular widow has high sidelobes i W(), ad the sidelobe amplitude is relatively uaffected by M. Sidelobes cause large passbad ripple, related to Gibbs pheomea. Sidelobes caused by abrupt discotiuity at edge of widow. Solutio: use some other widow fuctio. Examples: Bartlett, Blackma, Haig, Hammig, Kaiser, Laczos, Tukey. MATLAB s widow fuctio has 6 choices! All have lower sidelobes tha rectagular, hece less passbad ripple. Tradeoff? Wider trasitio bad for the same M compared to rectagular widow. Example. Haig widow: w[] = ( ) π cos. M What is the frequecy respose W()? Somewhat messy. How do we plot W()? W = freqz(w,, om) which i tur uses the DFT/FFT with N M via zero paddig. Cautio: this is the ha fuctio i MATLAB, ot the haig fuctio! Rectagular Widow 3 Norm. Widow Respose w[] M=9 W() / W() (db) π π Haig Widow 3 Norm. Widow Respose w[] M=9 W() / W() (db) π π Hammig Widow 3 Norm. Widow Respose w[] M=7 W() / W() (db) π π As M icreases, mai lobe width decreases. As M icreases, some of the sidelobe amplitudes decrease, but peak sidelobe amplitude remais approximately costat. Agai, the price is eed larger M tha for rectagular widow for same trasitio width. The various widows tradeoff mai lobe width with peak sidelobe amplitude. Haig mai lobe width is 8π/M, but peak sidelobe is 3dB compared with 3dB for rectagular.
11 c J. Fessler, May 7, 4, 3:8 (studet versio) 8. Example. Suppose we wat a FIR filter desig of a lowpass filter with H d () = widow with M = 5. The the desired impulse respose is: h d [] = 4 sic ( 4 ( (M )/) ). {, < π/4, otherwise, desiged usig the Haig I MATLAB, here is how we compute ad display the impulse respose ad the frequecy respose. % fig_wi_example.m M = 5; = [:(M)]; om = lispace(pi, pi, ); % for displayig frequecy respose oc = pi/4; % cutoff frequecy % desired impulse respose: hd = ilie( oc/pi * sic(oc/pi*((m)/)),, oc, M ); Hd = ilie( *(abs(om) < oc), om, oc ); h = hd(, oc, M).* ha(m) ; % Haig widow applied to ideal impulse resp. clf, subplot(3) stem(, h, filled ), stem_fix axis([ M .,.3]), xlabel, ylabel h[] title(spritf( Haig Lowpass, M=%d, M)) subplot(3) H = freqz(h,, om); plot(om, *log(abs(h)), , om, *log(max(hd(om,oc),eps)),  ) xlabel \omega, ylabel H(\omega) (db) title Magitude Respose axisy(8, ), xaxis_pi p p/4 p % savefig fig_wi_example.3 Haig Lowpass, M=5 Magitude Respose.5. h[].5..5 H() (db) π π/4 π If we are usatisfied with the width of the trasitio bad, or the sidelobe amplitude, or the passbad ripple, the what could we do? Icrease M, try other widow fuctios, ad/or try other filter desig methods. Filter desig by widowig i MATLAB The fir commad i MATLAB is its tool for widowbased FIR filter desig. I the precedig example, we could have simply typed h = fir(4,.5, ha(5), oscale ) to get exactly the same desig.
12 8. c J. Fessler, May 7, 4, 3:8 (studet versio) Example. Digital phaser or flage. Time varyig pole locatios i cascade of st ad dorder allpass filters, Sum output of allpass cascade with origial sigal, creatig timevaryig otches FIR differetiator H d () = j skim 8..6 Hilbert trasform (9 phase shift) H d () = j sg() skip 8..3 Desig of FIR filters by frequecy samplig For the frequecy samplig method of FIR filter desig, to desig a Mpoit FIR filter we specify the desired frequecy respose at a set of equallyspaced frequecy locatios: H d (), k =,..., M. = π M k I other words, we provide equally spaced samples over [, π). Picture Recall from the DTFT formula that if h d [] is ozero oly for =,..., M, the Thus, at the give frequecy locatios, we have H d () = M = h d [] e j. ( ) M π H d M k = h d [] e j π M k, k =,..., M. = This is the formula for the Mpoit DFT discussed i Ch. 5 (ad i EECS 6). So we ca determie h d [] from { ( H π d M k)} M by usig the iverse DFT formula (or h = ifft(h) i MATLAB): k= h d [] = M M k= ( ) π H d M k e j π M k. This will be the impulse respose of the FIR filter as desiged by the frequecy samplig method. If we wat( h d [] to be real, the H d () must be Hermitia symmetric, i.e., Hd () = H d( ) = H d (π ). So if we specify H π d M k) to be some value, we kow that Hd( π M k) ( = H d π π M k) ( = H π d M (M k)) (, so H π d M (M k)) is also specified. Thus, software such as MATLAB s fir commad oly requires ( H d () oly o the iterval [, π]. If h d [] is to be real, the it also follows that H d (π) = H π ) M d M must be real valued whe M is eve. If you choose H d () to be liear phase, the the desiged h[] will be liear phase. But you are ot required to choose H d () to be liear phase! The book discusses may further details, but the above big picture is sufficiet for this class.
13 c J. Fessler, May 7, 4, 3:8 (studet versio) 8.3 Example. The treble boost revisited. Double the amplitude of all frequecy compoets above c = π/. % fig_freq_sample.m Hd = ilie( exp(i*om*(m)/).* ( + (abs(om) > pi/)), om, M ); M = 9; ok = [:(M)]/M * *pi; Hk = Hd(mod(ok+pi,*pi)pi, M); % trick: [pi,pi] specificatio of H(\omega) h = ifft(hk); h = reale(h, war ); % h = fir(m, [.5.5 ], [ ], boxcar(m) ); om = lispace(pi,pi,); clf, pl = 3; subplot(pl+), plot(om, abs(hd(om,m))) hold o, stem(ok(ok >= ), abs(hk(ok >= )), filled ), stem_fix, hold off xlabel \omega, ylabel H_d(\omega) axisy([.5]), xaxis_pi p p/ p subplot(pl+), stem(:(m), h, filled ), stem_fix, title(spritf( M=%d,M)) xlabel, ylabel h[], axis([ M ]) H = freqz(h,, om); subplot(pl+3), plot(om, abs(h), , om, abs(hd(om,m)), , ok, abs(hk), o ) xlabel \omega, ylabel H(\omega), axisy([.5]), xaxis_pi p p/ p % savefig fig_freq_sample.5.5 M=9.5 H d ().5 h[].5 H() π π/ π π π/ π I MATLAB, use h = fir(m, [.5.5 ], [ ], boxcar(m) ) to desig (almost) the above filter.
14 8.4 c J. Fessler, May 7, 4, 3:8 (studet versio) 8..4 Optimum equiripple liearphase FIR filters The widow method has a mior disadvatage, that it is difficult to precisely specify p ad s, sice these two result from the smearig. All we really specify is c, the cutoff. A ideal liearphase desig procedure would be as follows. Specify p, s, δ, δ, ad ru a algorithm that returs the miimum M that achieves that desig goal, as well as the impulse respose h[], =,..., M, where, for liear phase, h[] = h[m ]. To my kowledge, there is o such procedure that is guarateed to do this perfectly. However, we ca come close usig the followig iterative procedure. Choose M, ad fid the liearphase h[] whose frequecy respose is as close to H d () as possible. If it is ot close eough, the icrease M ad repeat. How ca we measure closeess of two frequecy respose fuctios? Pictures of H d () ad H(). Possible optios iclude the followig. π π π H d() H() d, average absolute error π π π H d() H() d, average squared error π π π H d() H() W() d, average weighted squared error [ ] π /p, π H d() H() p W() d weighted Lp error, p π max H d () H(), maximum error (p = ) max W(H d () H()), maximum weighted error (p = ) I this sectio, we focus o the last choice, the maximum weighted error betwee the desired respose ad the actual frequecy respose of a FIR filter. We wat to fid the FIR filter that miimizes this error. How to fid this? Not by brute force search or trial ad error, but by aalysis! If W() the Cosider the case of a lowpass filter. Note that H d () = E() = W(H d () H()) = W() H d () H(). { e j(m )/, c,, > c = e j(m )/ H dr () where H dr () = Also recall that for M eve ad h[] liear phase ad symmetric, So H r () is the sum of M/ cosies. The error ca be simplified as follows: H() = e j(m )/ H r (), where H r () = M/ = {, c,, > c. ( ( )) M h[] cos. E() = W() H d () H() = W() e j(m )/ H dr () e j(m )/ H r () = W() H dr () H r (). Thus we oly eed to cosider the real parts of the desired vs actual frequecy respose.
15 c J. Fessler, May 7, 4, 3:8 (studet versio) 8.5 The logical approach to specifyig the error weightig fuctio W() is as follows: /δ, c pass bad W() =, c < < s trasitio bad /δ, s < < π stop bad. However, the effect of the weightig will be the same if we multiply W() by a costat, such as δ. So the followig weightig fuctio has the same effect: δ /δ, c W() =, c < < s, s < < π. A small δ value meas we wat very low sidelobes, ad are willig to sacrifice uiformity over the passbad, so less weight is give to the errors i the passbad. As a desiger you choose H dr (), the filter legth M, the ratio δ /δ, ad the passbad ad stopbads, i.e., c ad s. The procedure fids the impulse respose that miimizes the maximum weighted error betwee the desired respose ad the actual respose. Mathematically, the mimax or Chebyshev desig uses the followig criterio: mi {h[]} M/ = max E(). Usig the alteratio theorem, from the theory of Chebyshev approximatio, Parks ad McClella i 97 showed that a ecessary ad sufficiet coditio for a Mtap filter to be optimal (i the maximum weighted error sese) is that the error E() must reach its maximum at least M/ + poit over the itervals where W(). This theorem guaratees that there is a uique optimal filter. It also tells us that the error will alterate back ad forth, i.e., there will be ripples i passbad ad stopbad. The resultig filters are called equiripple because all ripples i passbad have the same peaktopeak amplitude, ad likewise for the stop bad. The actual procedure for fidig the best filter is iterative, ad it called the Remez exchage algorithm. It is implemeted by the remez fuctio i Matlab. The algorithm first guesses where the extremal frequecies are, ad the computes H r () from that, the fids ew estimates of the extremal frequecies ad iterates. Icreasig M reduces passbad ripple ad icreases stopbad atteuatio MATLAB s remezord commad gives approximatio to required M, based o (8..95): ˆM = D (δ, δ ) f f(δ, δ ) f +, where f = ( s p )/(π) ad D ad f(δ, δ ) are defied i text ( ). Aother formula is also give i text: log 3 (δ ˆM = δ ) f As trasitio bad f decreases, M icreases As ripples δ j decrease, M icreases This ca be explored graphically usig MATLAB s fdatool or filtdes.
16 8.6 c J. Fessler, May 7, 4, 3:8 (studet versio) Example. digital crossover for audio F s = 44kHz F pass = 4.4kHz p = πf pass /F s =.π F stop = 6.6kHz s = πf stop /F s =.3π 3 bads: pass, trasitio, stop M = 6 for ow; revisit shortly. % fig_remez_example.m M = 6; f = [..3 ]; Hdr = [ ]; W = [ ]; h = remez(m, f, Hdr, W); stem(:m, h, filled ) freqz(h,, ) Equiripple (zoom).5. M=6 h[].5..5 H() (db) H() π π.4. π.4 π Haig widow (zoom).5. h[].5..5 H() (db) H() π π.4. π.4 π
17 c J. Fessler, May 7, 4, 3:8 (studet versio) 8.7 Further illustratios of the tradeoffs. The error has to go somewhere: passbad(s), stopbad(s), ad/or trasitio bad(s). 3 W() 3 W() 3 W() /π.4.5 /π.4.5 /π.374 H(), M=3.6 H(), M=3.78 H(), M= /π /π /π 3 W() 3 W() 3 W() /π.4.5 /π.4.55 /π H(), M=3 H(), M=7 H(), M= /π /π /π 8..7 Compariso of FIR methods skim
18 8.8 c J. Fessler, May 7, 4, 3:8 (studet versio) 8.3 Desig of IIR Filters from Aalog Filters Why IIR? With IIR desigs we ca get the same approximatio accuracy (of the magitude respose) as FIR but with a lower order filter. The tradeoff is oliear phase. Aalog filter desig is a mature field. There are well kow methods for selectig RLC combiatios to approximate some desired frequecy respose H d (F ). Geerally, the more (passive) compoets used, the closer oe ca approximate H d (F ), (to withi compoet toleraces). Essetially all aalog filters are IIR, sice the solutios to liear differetial equatios ivolve ifiiteduratio terms of the form t m e λt u(t). Oe way to desig IIR digital filters is to piggyback o this wealth of desig experiece for aalog filters. What do aalog filters look like? Ay RLC etwork is describe by a liear costat coefficiet differetial equatio of the form N k= α k d k dt k y a(t) = M k= β k d k dt k x a(t) with correspodig system fuctio (Laplace trasform of the impulse respose) M k= H a (s) = β ks k N k= α ks. k Each combiatio of N, M, {α k }, {β k } correspods to some arragemet of RLCs. Those implemetatio details are uimportat to us here. The frequecy respose of a geeral aalog filter is H a (F ) = H a (s). s=jπf Overview Desig N, M, {α k }, {β k } usig existig methods. Map from s plae to zplae somehow to get a k s ad b k s, i.e., a ratioal system fuctio correspodig to a discretetime liear costat coefficiet differece equatio. Ca we achieve liear phase with a IIR filter? We should be able to use our aalysis tools to aswer this. Recall that liear phase implies that H(z) = z N H ( z ), so if z is a pole of the system fuctio H(z), the z is also a pole. So ay fiite poles (i.e., other tha or ) would lead to istability. There are o causal stable IIR filters with liear phase. Thus we desig for the magitude respose, ad see what phase respose we get IIR by approximatio of derivatives skim s = z T 8.3. IIR by impulse ivariace skim h[] = h a (T ) z = e st
19 c J. Fessler, May 7, 4, 3:8 (studet versio) IIR filter desig by biliear trasformatio Suppose we have used existig aalog filter desig methods to desig a IIR aalog filter with system fuctio M k= H a (s) = β ks k N k= α ks. k For a samplig period T s, we ow make the biliear trasformatio s = T s z + z. This trasformatio ca be motivated by the trapezoidal formula for umerical itegratio. See text for the derivatio. Defie the discretetime system fuctio H(z) = H a (s) s= z. T s + z This trasformatio yields a ratioal system fuctio, i.e., a ratio of polyomials i z. This H(z) is a system fuctio whose frequecy respose is related to the frequecy respose of the aalog IIR filter. Example. Cosider a storder aalog filter with a sigle pole at s = α Picture where α >, with system fuctio H a (s) = α + s. How would you build this? Usig the followig RL voltage divider, where V out (s) = i(t) R R+sL V i(s) = H a (s) = R/L R/L+s. vi(t) + R vout(t) L Applyig the biliear trasformatio to the above (Laplace domai) system fuctio yields: + z H(z) = H a (s) s= z = = T s + z α( + z ) + = ( z ) T s = α + z T s + z α + /T s + z /T s α /T s + α z = α + /T s + z (α + /T s ) + (α /T s )z + z [ pz = α + /T s p + + /p ] pz, where p = αt ) s (, ). What is h[]? h[] = + αt α+/t s ( p δ[] +( + /p)p u[]. s Im(z) p Re(z) Where did zero at z = come from?
20 8. c J. Fessler, May 7, 4, 3:8 (studet versio) Solvig biliear trasformatio for z i terms of s yields: z = + st s st s, so zero at s = maps to z =. Note also that pole at s = α maps to z = p. I geeral, the (fiite) poles ad zeros follow the mappig. Poles (or zeros) at s = map to z =. Real poles ad zeros remai real, complexcojugate pairs remai pairs. What type of filters are H a (s) ad H(z)? Both are poor lowpass filters. This illustrates the method, but ot the power! The utility is for more sophisticated aalog IIR desigs. Picture : more sdomai poles ad correspodig zdomai poles The biliear trasformatio More geerally, if the system fuctio H a (s) is ratioal, i.e., H a (s) = g s p T s z + z p =... = T s so we will have oe root at z = +pts pt s ad aother oe at z =. See plot o ext page. real(s) > maps to z outside uit circle real(s) < maps to z iside uit circle s = jπf maps to z o uit circle i(s si) j (s pj), the for each term of the form s p we have ( pt s z = + st s st s, s = T s z + z. z = + jπf T s = r ejφ jπf T s r e jφ = ejφ, where r = + jπf T s ad φ = ( + jπf T s ) = arcta ( πf T s ). ( ) πf Thus z = e j, where = φ, so = ta Ts. Coversely, if z = e j the ) z +pt s pt s, z + s = e j T s + e j = e j/ e j/ T s e j/ + e = j si / j/ T s cos / = j ) ta( = F = ) ta(. T s πt s This is a oliear relatioship betwee the aalog frequecy ad the digital frequecy. It is called frequecy warpig. See plot o ext page. Because of this oliearity, a typical desig procedure goes as follows. Determie desired frequecy respose i terms of aalog frequecies, e.g., Hz. Covert the desired frequecies ito digital frequecies usig = πf/f s, yieldig p, s, etc. Map those digital frequecies ito aalog frequecies F = πt s ta(/). We ca use ay coveiet T s for this, e.g., T s =. Desig a aalog filter for those frequecies. Trasform aalog filter ito digital filter usig the biliear trasformatio with that same T s. This is all built ito commads such as MATLAB s cheby routie. Use MATLAB s filtdemo to experimet with various filter types. The Chebyshev Type I filters are allpole aalog filters with equiripple behavior i the passbad ad mootoic i the stopbad. { ( H a (F ) = + ε TN (F/F where T N (x) = cos N cos x ), x pass) cosh(n cosh x), x > is the Nth order Chebyshev polyomial. There is ripple i the passbad of amplitude /( + ε ) that is usercotrolled.
SOME GEOMETRY IN HIGHDIMENSIONAL SPACES
SOME GEOMETRY IN HIGHDIMENSIONAL SPACES MATH 57A. Itroductio Our geometric ituitio is derived from threedimesioal space. Three coordiates suffice. May objects of iterest i aalysis, however, require far
More informationMAXIMUM LIKELIHOODESTIMATION OF DISCRETELY SAMPLED DIFFUSIONS: A CLOSEDFORM APPROXIMATION APPROACH. By Yacine AïtSahalia 1
Ecoometrica, Vol. 7, No. 1 (Jauary, 22), 223 262 MAXIMUM LIKELIHOODESTIMATION OF DISCRETEL SAMPLED DIFFUSIONS: A CLOSEDFORM APPROXIMATION APPROACH By acie AïtSahalia 1 Whe a cotiuoustime diffusio is
More informationGCE Further Mathematics (6360) Further Pure Unit 2 (MFP2) Textbook. Version: 1.4
GCE Further Mathematics (660) Further Pure Uit (MFP) Tetbook Versio: 4 MFP Tetbook Alevel Further Mathematics 660 Further Pure : Cotets Chapter : Comple umbers 4 Itroductio 5 The geeral comple umber 5
More informationHOW MANY TIMES SHOULD YOU SHUFFLE A DECK OF CARDS? 1
1 HOW MANY TIMES SHOULD YOU SHUFFLE A DECK OF CARDS? 1 Brad Ma Departmet of Mathematics Harvard Uiversity ABSTRACT I this paper a mathematical model of card shufflig is costructed, ad used to determie
More informationCahier technique no. 194
Collectio Techique... Cahier techique o. 194 Curret trasformers: how to specify them P. Foti "Cahiers Techiques" is a collectio of documets iteded for egieers ad techicias, people i the idustry who are
More informationCounterfactual Reasoning and Learning Systems: The Example of Computational Advertising
Joural of Machie Learig Research 14 (2013) 32073260 Submitted 9/12; Revised 3/13; Published 11/13 Couterfactual Reasoig ad Learig Systems: The Example of Computatioal Advertisig Léo Bottou Microsoft 1
More informationEverything You Always Wanted to Know about Copula Modeling but Were Afraid to Ask
Everythig You Always Wated to Kow about Copula Modelig but Were Afraid to Ask Christia Geest ad AeCatherie Favre 2 Abstract: This paper presets a itroductio to iferece for copula models, based o rak methods.
More informationSUPPORT UNION RECOVERY IN HIGHDIMENSIONAL MULTIVARIATE REGRESSION 1
The Aals of Statistics 2011, Vol. 39, No. 1, 1 47 DOI: 10.1214/09AOS776 Istitute of Mathematical Statistics, 2011 SUPPORT UNION RECOVERY IN HIGHDIMENSIONAL MULTIVARIATE REGRESSION 1 BY GUILLAUME OBOZINSKI,
More informationStéphane Boucheron 1, Olivier Bousquet 2 and Gábor Lugosi 3
ESAIM: Probability ad Statistics URL: http://wwwemathfr/ps/ Will be set by the publisher THEORY OF CLASSIFICATION: A SURVEY OF SOME RECENT ADVANCES Stéphae Bouchero 1, Olivier Bousquet 2 ad Gábor Lugosi
More informationConsistency of Random Forests and Other Averaging Classifiers
Joural of Machie Learig Research 9 (2008) 20152033 Submitted 1/08; Revised 5/08; Published 9/08 Cosistecy of Radom Forests ad Other Averagig Classifiers Gérard Biau LSTA & LPMA Uiversité Pierre et Marie
More informationG r a d e. 5 M a t h e M a t i c s. Number
G r a d e 5 M a t h e M a t i c s Number Grade 5: Number (5.N.1) edurig uderstadigs: the positio of a digit i a umber determies its value. each place value positio is 10 times greater tha the place value
More informationType Less, Find More: Fast Autocompletion Search with a Succinct Index
Type Less, Fid More: Fast Autocompletio Search with a Succict Idex Holger Bast MaxPlackIstitut für Iformatik Saarbrücke, Germay bast@mpiif.mpg.de Igmar Weber MaxPlackIstitut für Iformatik Saarbrücke,
More informationCrowds: Anonymity for Web Transactions
Crowds: Aoymity for Web Trasactios Michael K. Reiter ad Aviel D. Rubi AT&T Labs Research I this paper we itroduce a system called Crowds for protectig users aoymity o the worldwideweb. Crowds, amed for
More informationSoftware Reliability via RuTime ResultCheckig Hal Wasserma Uiversity of Califoria, Berkeley ad Mauel Blum City Uiversity of Hog Kog ad Uiversity of Califoria, Berkeley We review the eld of resultcheckig,
More informationHow Has the Literature on Gini s Index Evolved in the Past 80 Years?
How Has the Literature o Gii s Idex Evolved i the Past 80 Years? Kua Xu Departmet of Ecoomics Dalhousie Uiversity Halifax, Nova Scotia Caada B3H 3J5 Jauary 2004 The author started this survey paper whe
More informationPresent Values, Investment Returns and Discount Rates
Preset Values, Ivestmet Returs ad Discout Rates Dimitry Midli, ASA, MAAA, PhD Presidet CDI Advisors LLC dmidli@cdiadvisors.com May 2, 203 Copyright 20, CDI Advisors LLC The cocept of preset value lies
More informationThe Nonparanormal: Semiparametric Estimation of High Dimensional Undirected Graphs
Joural of Machie Learig Research 0 2009 22952328 Submitted 3/09; Revised 5/09; ublished 0/09 The Noparaormal: Semiparametric Estimatio of High Dimesioal Udirected Graphs Ha Liu Joh Lafferty Larry Wasserma
More informationSystemic Risk and Stability in Financial Networks
America Ecoomic Review 2015, 105(2): 564 608 http://dx.doi.org/10.1257/aer.20130456 Systemic Risk ad Stability i Fiacial Networks By Daro Acemoglu, Asuma Ozdaglar, ad Alireza TahbazSalehi * This paper
More informationBOUNDED GAPS BETWEEN PRIMES
BOUNDED GAPS BETWEEN PRIMES ANDREW GRANVILLE Abstract. Recetly, Yitag Zhag proved the existece of a fiite boud B such that there are ifiitely may pairs p, p of cosecutive primes for which p p B. This ca
More informationTeaching Bayesian Reasoning in Less Than Two Hours
Joural of Experimetal Psychology: Geeral 21, Vol., No. 3, 4 Copyright 21 by the America Psychological Associatio, Ic. 963445/1/S5. DOI: 1.7//963445..3. Teachig Bayesia Reasoig i Less Tha Two Hours Peter
More informationDryad: Distributed DataParallel Programs from Sequential Building Blocks
Dryad: Distributed DataParallel Programs from Sequetial uildig locks Michael Isard Microsoft esearch, Silico Valley drew irrell Microsoft esearch, Silico Valley Mihai udiu Microsoft esearch, Silico Valley
More informationAsymptotic Growth of Functions
CMPS Itroductio to Aalysis of Algorithms Fall 3 Asymptotic Growth of Fuctios We itroduce several types of asymptotic otatio which are used to compare the performace ad efficiecy of algorithms As we ll
More informationTesting for Welfare Comparisons when Populations Differ in Size
Cahier de recherche/workig Paper 039 Testig for Welfare Comparisos whe Populatios Differ i Size JeaYves Duclos Agès Zabsoré Septembre/September 200 Duclos: Départemet d écoomique, PEP ad CIRPÉE, Uiversité
More information4. Trees. 4.1 Basics. Definition: A graph having no cycles is said to be acyclic. A forest is an acyclic graph.
4. Trees Oe of the importat classes of graphs is the trees. The importace of trees is evidet from their applicatios i various areas, especially theoretical computer sciece ad molecular evolutio. 4.1 Basics
More informationMEP Pupil Text 9. The mean, median and mode are three different ways of describing the average.
9 Data Aalysis 9. Mea, Media, Mode ad Rage I Uit 8, you were lookig at ways of collectig ad represetig data. I this uit, you will go oe step further ad fid out how to calculate statistical quatities which
More informationJ. J. Kennedy, 1 N. A. Rayner, 1 R. O. Smith, 2 D. E. Parker, 1 and M. Saunby 1. 1. Introduction
Reassessig biases ad other ucertaities i seasurface temperature observatios measured i situ sice 85, part : measuremet ad samplig ucertaities J. J. Keedy, N. A. Rayer, R. O. Smith, D. E. Parker, ad M.
More informationOn the Number of CrossingFree Matchings, (Cycles, and Partitions)
O the Number of CrossigFree Matchigs, (Cycles, ad Partitios Micha Sharir Emo Welzl Abstract We show that a set of poits i the plae has at most O(1005 perfect matchigs with crossigfree straightlie embeddig
More informationON THE EVOLUTION OF RANDOM GRAPHS by P. ERDŐS and A. RÉNYI. Introduction
ON THE EVOLUTION OF RANDOM GRAPHS by P. ERDŐS ad A. RÉNYI Itroductio Dedicated to Professor P. Turá at his 50th birthday. Our aim is to study the probable structure of a radom graph r N which has give
More informationRamseytype theorems with forbidden subgraphs
Ramseytype theorems with forbidde subgraphs Noga Alo Jáos Pach József Solymosi Abstract A graph is called Hfree if it cotais o iduced copy of H. We discuss the followig questio raised by Erdős ad Hajal.
More informationWhich Extreme Values Are Really Extreme?
Which Extreme Values Are Really Extreme? JESÚS GONZALO Uiversidad Carlos III de Madrid JOSÉ OLMO Uiversidad Carlos III de Madrid abstract We defie the extreme values of ay radom sample of size from a distributio
More information