Last week lecture Today s lecture: Chapter 8.1-8.3, 8.4.2, 8.5.3 INF3440/INF4440. Design of digital filters October 2004
Last week lecture Today s lecture: Chapter 8.1-8.3, 8.4.2, 8.5.3 Last lectures: Structures of filters Direct-form realizations Why considering rearrangements? Structures for FIR systems Structures for IIR systems
Last week lecture Today s lecture: Chapter 8.1-8.3, 8.4.2, 8.5.3 Outline 1 General considerations General considerations 2 Symmetric and antisymmetric FIR filters Window design methods Frequency-sampling methods Equalrippel filters Differentiators Hilbert transformers 3 Approaches From s-plane to z-plane Bilinear transform Frequency transformation Least-square approaches
General considerations General considerations FIR filters: linear-phase characteristics (possible). IIR filters: lower sidelobes in stopband than equal-length FIR filter. Causuality and its implications. Ideal filters are non-causual and physically unrealizable. What is the necessary and sufficient condition that garantees H(w) to be causual? 1 H(w) cannot be zero (except for a finite set of points). 2 H(w) cannot be constant in any finite range of freqs. 3 H(w) cannot be infinitely sharp. 4 H R (w) and H I (w) are independent and related by the discrete Hilbert transform, i.e. H(w) and phase Θ(w) cannot be choosen abritary.
General considerations Specification of a low-pass filter Possible to approximate the ideal filters as closely as desired. Allow rippel in passband and stopband Allow finite-size transition band Low-pass filter: Passband given by 0 w w p. Stopband given by w s w w p. Transition band given by w p w w s. Rippel: passband: 1 δ 1 H(w) 1 + δ 1 for w w p stopband: H(w) δ 2 for w s w π. Bandwidth: Width of passband.
Symmetric and antisymmetric FIR filters Window design methods Frequency-sampling methods Equalrippel filters Differentiators Hilbert transformers Symmetric vs. antisymmetric A FIR filter of length M can be described by: 1 Differance equation: y(n) = M 1 k=0 b kx(n k). 2 Output from convolution with h(n): y(n) = M 1 k=0 h (k)x(n k). Clearly: b k = h(k), k = 0, 1,..., M 1. 3 System function: H(z) = M 1 k=0 h kz 1. FIR filter has linear phase iff h(n) = ±h(m 1 n) n = 0, 1,..., M 1 or z (M 1) H(z 1 ) = ±H(z). Furthermore, if h(n) is real and z 1 a pole or a zero, then 1/z 1, z1 and 1/z 1 are pole or zeros.
Symmetric and antisymmetric FIR filters Window design methods Frequency-sampling methods Equalrippel filters Differentiators Hilbert transformers Four different FIR-filters to consider h(n) = h(m 1 n) H(w) = H r (w)e jw(m 1)/2 1, M odd: H r (w) = h( M 1 2 )+2 (M 3)/2 n=0 h(n) cos w ( M 1 2 n ) 2, M even: H r (w) = 2 (M/2) 1 n=0 h(n) cos w ( M 1 2 n ) { ( w M 1 ) Θ(w) = 2, Hr (w) > 0 w ( ) M 1 2 + π, Hr (w) < 0 h(n) = h(m 1 n) H(w) = H r (w)e j[ w(m 1)/2+π/2] 3, M odd: H r (w) = 2 (M 3)/2 n=0 h(n) sin w ( M 1 2 n ) 4, M even: H r (w) = 2 (M/2) 1 n=0 h(n) sin w ( M 1 2 n ) { π Θ(w) = 2 w ( ) M 1 2, Hr (w) > 0 3π 2 w ( ) M 1 2 + π, Hr (w) < 0
Symmetric and antisymmetric FIR filters Window design methods Frequency-sampling methods Equalrippel filters Differentiators Hilbert transformers Linear phase FIR filters using windows Select an ideal filter, h d (n), and truncate it with a window, w(n). h(n) = h d (n)w(n). w(n) finite-length window, symmetric about midpoint. H(w) = H d (w) W (w) = 1 π 2π π H d(ν)w (w ν)dν. How well H(w) approximates H d (w) is determined by 1 The width of the main love of W (w). 2 The peak side-lobe amplitude of W (w). Pro: Simple Con: Lack of precise control of w p and w s.
Symmetric and antisymmetric FIR filters Window design methods Frequency-sampling methods Equalrippel filters Differentiators Hilbert transformers Linear phase FIR filters using the frequency-sampling method The desired response, H d (w) is sampled uniformmly at w k = 2π M (k + α), M/2 points (symmetry) between 0 and π. From H d (w) = M 1 n=0 h d(n)e jwn we obtain 1 0 H d(w k )e jw y(n) kn, = b 0 x(n) + b 1 x(n 1) + + b M 1 x(n M + 1) = M 1 OK at the frequency samples, but no control inbetween. Introduction of transition samples (from tables) improves the solution. k=0 b k
Symmetric and antisymmetric FIR filters Window design methods Frequency-sampling methods Equalrippel filters Differentiators Hilbert transformers Equalripple linear phase filters Motivation: Include different constraints on δ 1 (passband) and δ 2 (stopband). Introduce uniform rippel. Rewrite the frequency response function: H r (w) = Q(w)P(w) for all types filter (Type 1, 2, 3 and 4). Desired amp. resp.: H dr. Weighted error: E(w) W (w)[h dr H r (w)], w S [0, w p ] [w s, π]. { δ2 /δ Weighting function W (w) = 1 in the passband 1 in the stopband.
Symmetric and antisymmetric FIR filters Window design methods Frequency-sampling methods Equalrippel filters Differentiators Hilbert transformers Equalripple linear phase filters... E(w) = W (w)[h [ dr Q(w)P(w)] ] = W (w)q(w) Hdr Q(w) P(w), w S Define Ŵ (w) W (w)q(w) and Hˆ dr (w) H dr (w) Q(w) we obtain E(w) = Ŵ (w)[ Hˆ dr (w) P(w)], w S. Minimax optimization (minimize the maximum absolut value) min coeff [max w S E(w) ]. Efficient algorithm: Parks-McClellan algorithm (uses the Remez-exchange routine)
Symmetric and antisymmetric FIR filters Window design methods Frequency-sampling methods Equalrippel filters Differentiators Hilbert transformers Design of FIR Differentiators Used for taking the derivative of a signal. Ideal digital differentiator: H d (w) = jw, π w π Antisymmetric unit sample response, i.e. Type 3 or 4. Fullband diff. (rarely required) impossible with Type 3. Even-length diff. slightly better, but does not have integer delay.
Symmetric and antisymmetric FIR filters Window design methods Frequency-sampling methods Equalrippel filters Differentiators Hilbert transformers Design of Hilbert Transformers Ideal Hilbert transformer is an all-pass filter that imparts a 90 phase shift on the{ signal at its input; j, 0 < w π H d (w) = j, pi < w < 0 { 2 sin 2 (πn/2 and h d (n) = π n, n 0 0, n = 0. Antisymmetric, i.e. Type 3 or 4. h d (w) is zero for n even. Same is the case when using Type 3 filters.
Approaches From s-plane to z-plane Bilinear transform Frequency transformation Least-square approaches IIR-filters: Different approaches Two general approaches: 1 Transform analog filters into digital ones. 2 Use an optimization algorithm (e.g. least-square method) Causual and stable IIR filters cannot have linear phase (due to H(z) = ±z N H(z 1 )). Analog filter design is highly advanced Several classes of good filters: Butterworth filters Chebyshev filters (Type 1 and 2) Elliptic filters Bessel filters
Approaches From s-plane to z-plane Bilinear transform Frequency transformation Least-square approaches Mapping from s-plane to z-plane An analog prototype filter described by H a (s). Mapping from s-plane to z-plane; H(z) = H a (s) s=m(z) where s = m(z) is the mapping function with the following properties jω-axis should be mapped to the unit circle, z = 1 (one-to-one and onto). Points in the left-half s-plane should ve mapped inside the unit circle. m(z) should be rational so that a rational H a (s) is mapped to a rational H(z).
Approaches From s-plane to z-plane Bilinear transform Frequency transformation Least-square approaches Bilinear transform The mapping from s-plane to z-plane defined by s = 2 T s 1 z 1 1 z 1. I.e. H(z) = H a ( 1 z 1 1 z 1 ). Rational, one-to-one and onto, but nonlinear relation between the jω-axis and the unit circle (warping): w = 2 arctan( ΩTs 2 ). Result of warping: Bilinear trans. will only preserve the magn. resp. of analog filters that have an ideal response that is piecewise constant. Steps to follow: 1 Prewarp w p and w s. With T s = 2, Ω = tan(w/2). 2 Design an analog lowpass filter 3 Apply bilinear transf.
Approaches From s-plane to z-plane Bilinear transform Frequency transformation Least-square approaches Frequency transformation Possible to transform a analog lowpass filter to bandpass, bandstop and highpass filter. Possible to transform a digital lowpass filter to bandpass, bandstop and highpass filter. Bilinear transform gives the same result.
Approaches From s-plane to z-plane Bilinear transform Frequency transformation Least-square approaches Filter design based on a least squares approach The Padé approximation Prony s method FIR Least-Square Inverse (Wiener) Filters The inverse of a LTI system described by g(n) or G(z) is the system described by h(n) or H(z) such that h(n) g(n) = δ(n) or H(z)G(z) = 1. In most applications, H(z) = 1/G(z) is not a viable solution. The goal: Find h(n) of length N such that h(n) g(n) δ(n).
Approaches From s-plane to z-plane Bilinear transform Frequency transformation Least-square approaches FIR Least-Square Inverse (Wiener) Filters... The filter that minimizes E = n=0 e(n) 2 may be found by solving the{ linear equations N 1 g(0), k = 0 l=0 h(l)r g (k l) = 0, k = 1, 2,..., N 1 where r g (k) = g(n)g(n k). If a delay is tolerated, better solutions can be found by considering h(n) g(n) = δ(n n 0 ).