12.07.2015 Views

Filter design and equalization - MIT OpenCourseWare

Filter design and equalization - MIT OpenCourseWare

Filter design and equalization - MIT OpenCourseWare

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

FIR filtersfinite impulse response (FIR) filter:n−1y(t) = h τ u(t − τ),τ=0t ∈ Z• (sequence) u : Z →• (sequence) y : Z →R is input signalR is output signal• h i are called filter coefficients• n is filter order or length<strong>Filter</strong> <strong>design</strong> 2


example: (lowpass) FIR filter, order n = 21impulse response h:0.20.1h(t)0−0.1−0.20 2 4 6 8 10 12 14 16 18 20t<strong>Filter</strong> <strong>design</strong> 4


• h is optimization variableChebychev <strong>design</strong>minimize max | H(ω) − H des (ω) |ω∈[0,π]• H des : R → C is (given) desired transfer function• convex problem• can add constraints, e.g., |h i | ≤ 1sample (discretize) frequency:minimize max |H(ω k ) − H des (ω k )|k=1,...,m• sample points 0 ≤ ω 1 < · · · < ω m ≤ π are fixed (e.g., ω k = kπ/m)• m ≫ n (common rule-of-thumb: m = 15n)• yields approximation (relaxation) of problem above<strong>Filter</strong> <strong>design</strong> 6


Chebychev <strong>design</strong> via SOCP:minimizesubject tot A (k) h − b (k) ≤ t,k = 1,...,mwhere 1 cos ωk cos(n−1)ωA (k) · · ·=k0 −sin ω k · · · −sin(n−1)ω kRHdes (ω k ) b (k) =IH des (ω k )⎡ ⎤h 0h = ⎣ . ⎦h n−1<strong>Filter</strong> <strong>design</strong> 7


Linear phase filterssuppose• n = 2N + 1 is odd• impulse response is symmetric about midpoint:h t = h n−1−t , t = 0, ...,n − 1then−iωH(ω) = h 0 + h 1 e−i(n−1)ω+ · · · + h n−1 e−iNω= e (2h 0 cos Nω + 2h 1 cos(N −1)ω + · · · + h N )Δ−iNω= e H(ω)<strong>Filter</strong> <strong>design</strong> 8


• term e −iNω represents N-sample delay• H (ω) is real• |H(ω)| = |H(ω)|• called linear phase filter ( H(ω) is linear except for jumps of ±π)<strong>Filter</strong> <strong>design</strong> 9


Lowpass filter specificationsδ 11/δ 1δ 2ω p ω s πidea:ω• pass frequencies in passb<strong>and</strong> [0, ω p ]• block frequencies in stopb<strong>and</strong> [ω s , π]<strong>Filter</strong> <strong>design</strong> 10


specifications:• maximum passb<strong>and</strong> ripple (±20 log 10 δ 1 in dB):1/δ 1 ≤ |H(ω)| ≤ δ 1 , 0 ≤ ω ≤ ω p• minimum stopb<strong>and</strong> attenuation (−20 log 10 δ 2 in dB):|H(ω)| ≤ δ 2 ,ω s ≤ ω ≤ π<strong>Filter</strong> <strong>design</strong> 11


Linear phase lowpass filter <strong>design</strong>• sample frequency• can assume wlog H (0) > 0, so ripple spec is1/δ 1 ≤ H(ω k ) ≤ δ 1<strong>design</strong> for maximum stopb<strong>and</strong> attenuation:minimize δ 2subject to 1/δ 1 ≤ H(ω k ) ≤ δ 1 ,−δ 2 ≤ H(ω k ) ≤ δ 2 ,0 ≤ ω k ≤ ω pω s ≤ ω k ≤ π<strong>Filter</strong> <strong>design</strong> 12


• passb<strong>and</strong> ripple δ 1 is given• an LP in variables h, δ 2• known (<strong>and</strong> used) since 1960’s• can add other constraints, e.g., |h i | ≤ αvariations <strong>and</strong> extensions:• fix δ 2 , minimize δ 1 (convex, but not LP)• fix δ 1 <strong>and</strong> δ 2 , minimize ω s (quasiconvex)• fix δ 1 <strong>and</strong> δ 2 , minimize order n (quasiconvex)<strong>Filter</strong> <strong>design</strong> 13


example• linear phase filter, n = 21• passb<strong>and</strong> [0, 0.12π]; stopb<strong>and</strong> [0.24π,π]• max ripple δ 1 = 1.012 (±0.1dB)• <strong>design</strong> for maximum stopb<strong>and</strong> attenuationimpulse response h:0.20.1h(t)0−0.1−0.20 2 4 6 8 10 12 14 16 18 20t<strong>Filter</strong> <strong>design</strong> 14


frequency response magnitude (i.e., | H(ω) | ):110010|H(ω)|−110−21010−30 0.5 1 1.5 2 2.5 3ωfrequency response phase (i.e., H(ω)):321 H(ω)0−1−2−30 0.5 1 1.5 2 2.5 3ω<strong>Filter</strong> <strong>design</strong> 15


Equalizer <strong>design</strong>H(ω)G(ω)<strong>equalization</strong>: given• G (unequalized frequency response)• G des (desired frequency response)Δ<strong>design</strong> (FIR equalizer) H so that G = GH ≈ G des• common choice: G des (ω) = e −iDω (delay)i.e., <strong>equalization</strong> is deconvolution (up to delay)• can add constraints on H, e.g., limits on |h i | or max ω |H(ω)|<strong>Filter</strong> <strong>design</strong> 16


Chebychev equalizer <strong>design</strong>:minimize maxω∈[0,π]convex; SOCP after sampling frequencyG(ω) − G des (ω) <strong>Filter</strong> <strong>design</strong> 17


time-domain <strong>equalization</strong>: optimize impulse response g˜ of equalizedsysteme.g., with G des (ω) = e −iDω ,g des (t) =1 t = D0 t = Dsample <strong>design</strong>:minimize max t =D | g˜(t) |subject to g˜(D) = 1• an LP• can useg˜(t) 2 ort=D t =D|g˜(t)|<strong>Filter</strong> <strong>design</strong> 18


extensions:• can impose (convex) constraints• can mix time- <strong>and</strong> frequency-domain specifications• can equalize multiple systems, i.e., choose H soG (k) H ≈ G des ,k = 1, ...,K• can equalize multi-input multi-output systems(i.e., G <strong>and</strong> H are matrices)• extends to multidimensional systems, e.g., image processing<strong>Filter</strong> <strong>design</strong> 19


Equalizer <strong>design</strong> exampleunequalized system G is 10th order FIR:10.80.6g(t)0.40.20−0.2−0.40 1 2 3 4 5 6 7 8 9t<strong>Filter</strong> <strong>design</strong> 20


110 G(ω) |G(ω)|010−1100 0.5 1 1.5 2 2.5 3ω3210−1−2−30 0.5 1 1.5 2 2.5 3ω<strong>design</strong> 30th order FIR equalizer with G(ω) ≈ e −i10ω<strong>Filter</strong> <strong>design</strong> 21


Chebychev equalizer <strong>design</strong>:minimize max G(ω) ˜ − eequalized system impulse response g˜ω−i10ω10.8g˜(t)0.60.40.20−0.20 5 10 15 20 25 30 35t<strong>Filter</strong> <strong>design</strong> 22


equalized frequency response magnitude |G |110|Ge(ω)|010−1100 0.5 1 1.5 2 2.5 3ωequalized frequency response phase G 32 Ge(ω)10−1−2−30 0.5 1 1.5 2 2.5 3ω<strong>Filter</strong> <strong>design</strong> 23


time-domain equalizer <strong>design</strong>:equalized system impulse response g˜minimize max | g˜(t) |t=1010.80.6g˜(t)0.40.20−0.20 5 10 15 20 25 30 35t<strong>Filter</strong> <strong>design</strong> 24


equalized frequency response magnitude |G |110|Ge(ω)|010−1100 0.5 1 1.5 2 2.5 3ωequalized frequency response phase G 321Ge(ω)0−1−2−30 0.5 1 1.5 2 2.5 3ω<strong>Filter</strong> <strong>design</strong> 25


<strong>Filter</strong> magnitude specificationstransfer function magnitude spec has formL(ω) ≤ |H(ω)| ≤ U(ω),ω ∈ [0,π]where L, U : R→R + are given• lower bound is not convex in filter coefficients h• arises in many applications, e.g., audio, spectrum shaping• can change variables to solve via convex optimization<strong>Filter</strong> <strong>design</strong> 26


Autocorrelation coefficientsautocorrelation coefficients associated with impulse responseh = (h 0 ,...,h n−1 ) ∈ R n arer t = h τ h τ+tτ(we take h k = 0 for k < 0 or k ≥ n)• r t = r −t ; r t = 0 for |t| ≥ n• hence suffices to specify r = (r 0 , . ..,r n−1 ) ∈ R n<strong>Filter</strong> <strong>design</strong> 27


Fourier transform of autocorrelation coefficients isn−1−iωτR(ω) = e r τ = r 0 + 2r t cos ωt = | H(ω)|τ t=12• always have R(ω)≥0 for all ω• can express magnitude specification asL(ω) 2 ≤ R(ω) ≤ U(ω) 2 ,ω ∈ [0,π]. . . convex in r<strong>Filter</strong> <strong>design</strong> 28


Spectral factorizationquestion: when is r ∈ R n the autocorrelation coefficients of some h ∈ R n ?answer: (spectral factorization theorem) if <strong>and</strong> only if R(ω) ≥ 0 for all ω• spectral factorization condition is convex in r• many algorithms for spectral factorization, i.e., finding an h s.t.R(ω) = |H(ω)| 2magnitude <strong>design</strong> via autocorrelation coefficients:• use r as variable (instead of h)• add spectral factorization condition R(ω) ≥ 0 for all ω• optimize over r• use spectral factorization to recover h<strong>Filter</strong> <strong>design</strong> 29


choose h to minimizelog-Chebychev magnitude <strong>design</strong>max | 20 log 10 | H(ω) | − 20 log 10 D(ω) |ω• D is desired transfer function magnitude(D(ω) > 0 for all ω)• find minimax logarithmic (dB) fitreformulate asminimize tsubject to D(ω) 2 /t ≤ R(ω) ≤ tD(ω) 2 ,0 ≤ ω ≤ π• convex in variables r, t• constraint includes spectral factorization condition<strong>Filter</strong> <strong>design</strong> 30


example: 1/f (pink noise) filter (i.e., D(ω) = 1/ √ ω), n = 50,log-Chebychev <strong>design</strong> over 0.01π ≤ ω ≤ π1100102|H(ω)|−110−210−1 010 10ωoptimal fit: ±0.5dB<strong>Filter</strong> <strong>design</strong> 31


<strong>MIT</strong> <strong>OpenCourseWare</strong>http://ocw.mit.edu6.079 / 6.975 Introduction to Convex OptimizationFall 2009For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!