1 Nyquist Filters Lth-Band Filters • Under certain conditions, a lowpass filter can be designed to have a number of zerovalued coefficients • When used as interpolation filters these filters preserve the nonzero samples of the up-sampler output at the interpolator output • Moreover, due to the presence of these zero-valued coefficients, these filters are computationally more efficient than other lowpass filters of same order • These filters, called the Nyquist filters or Lth-band filters, are often used in single-rate and multi-rate signal processing • Consider the factor-of-L interpolator shown below Copyright © 2010, S. K. Mitra x[n ] L xu [n] H (z ) y[n ] • The input-output relation of the interpolator in the z-domain is given by Y ( z) = H ( z) X ( z L ) 2 Copyright © 2010, S. K. Mitra Lth-Band Filters Lth-Band Filters • Then we can express Y(z) as • If H(z) is realized in the L-band polyphase form, then we have H ( z ) = ∑iL=−01z −i Ei ( z L ) • Assume that the k-th polyphase component of H(z) is a constant, i.e., Ek (z ) = α: Y ( z ) = α z −k X ( z L ) + • As a result, + αz − k + z −( k +1) Ek +1 ( z L ) + ... + z −( L −1) EL −1( z L ) Copyright © 2010, S. K. Mitra 5 Copyright © 2010, S. K. Mitra y[ Ln + k ] = α x[n] 4 Copyright © 2010, S. K. Mitra Lth-Band Filters • A filter with the above property is called a Nyquist filter or an Lth-band filter • Its impulse response has many zero-valued samples, making it computationally attractive • For example, the impulse response of an Lth-band filter for k = 0 satisfies the following condition α, n=0 h[Ln] = ⎧⎨ ⎩ 0, otherwise ∑ z −l El ( z L ) X ( z L ) l =0 l≠k • Thus, the input samples appear at the output without any distortion for all values of n, whereas, in-between ( L − 1) output samples are determined by interpolation H ( z ) = E0 ( z L ) + z −1E1 ( z L ) + ... + z −( k −1) Ek −1 ( z L ) 3 L −1 Lth-Band Filters • Figure below shows a typical impulse response of a third-band filter (L = 3) h[n] _6 _3 n 0 3 6 • Lth-band filters can be either FIR or IIR filters 6 Copyright © 2010, S. K. Mitra 1 Lth-Band Filters Half-Band Filters • If the 0-th polyphase component of H(z) is a constant, i.e., E0 ( z ) = α then it can be shown that L −1 ∑k =0 H ( zWLk ) = Lα = 1 (assuming α = 1/L) • Since the frequency response of H ( zWLk ) is the shifted version H (e j (ω− 2 πk / L ) ) of H (e jω) , the sum of all of these L uniformly shifted versions of H (e jω) add up to a constant 7 with its impulse response satisfying α, n=0 h[2n] = ⎧⎨ 0 , otherwise ⎩ _ H(zWL L 1) H(z) H(zWL) H(zWL2) H(z) • An Lth-band filter for L = 2 is called a halfband filter • The transfer function of a half-band filter is thus given by H ( z ) = α + z −1E1 ( z 2 ) 2π 0 ω Copyright © 2010, S. K. Mitra 8 Copyright © 2010, S. K. Mitra Half-Band Filters Half-Band Filters H (e j ( π / 2−θ) ) and H (e j ( π / 2+θ) ) add up to 1 for all θ • Or, in other words, H (e jω) exhibits a symmetry with respect to the half-band frequency π/2, hence the name “half-band filter” • The condition • H ( z ) = α + z −1E1 ( z 2 ) reduces to H ( z ) + H (− z ) = 1 (assuming α = 0.5) • If H(z) has real coefficients, then H (−e jω ) = H (e j ( π−ω) ) • Hence 9 H ( e j ω ) + H ( e j ( π − ω) ) = 1 Copyright © 2010, S. K. Mitra 10 Half-Band Filters Half-Band Filters • Figure below illustrates this symmetry for a half-band lowpass filter for which passband and stopband ripples are equal, i.e., δ p = δs and passband and stopband edges are symmetric with respect to π/2, i.e., ω p + ωs = π • Attractive property: About 50% of the coefficients of h[n] are zero • This reduces the number of multiplications required in its implementation significantly • For example, if N = 101, an arbitrary Type 1 FIR transfer function requires about 50 multipliers, whereas, a Type 1 half-band filter requires only about 25 multipliers H(e jω ) 1+ δ 1_ δ δ 11 ωp π/2 ωs π Copyright © 2010, S. K. Mitra ω Copyright © 2010, S. K. Mitra 12 Copyright © 2010, S. K. Mitra 2 Half-Band Filters Half-Band Filters • An FIR half-band filter can be designed with linear phase • However, there is a constraint on its length • Consider a zero-phase half-band FIR filter for which h[ n] = α * h[ − n] , with | α | = 1 • Let the highest nonzero coefficient be h[R] 13 15 17 Copyright © 2010, S. K. Mitra • Then R is odd as a result of the condition α, n=0 h[2n] = ⎧⎨ ⎩ 0, otherwise • Therefore R = 2K+1 for some integer K • Thus the length of h[n] is restricted to be of the form 2R+1 = 4K+3 [unless H(z) is a constant] 14 Copyright © 2010, S. K. Mitra Design of Linear-Phase Lth-Band Filters Design of Linear-Phase Lth-Band Filters • A lowpass linear-phase Lth-band FIR filter can be readily designed via the windowed Fourier series approach • In this approach, the impulse response coefficients of the lowpass filter are chosen as h[n] = hLP [n] ⋅ w[ n] where hLP [n] is the impulse response of an ideal lowpass filter with a cutoff at π/L and w[n] is a suitable window function • Now, the impulse response of an ideal Lthband lowpass filter with a cutoff at ωc = π / L is given by sin( πn / L) , −∞ ≤ n ≤∞ hLP [n] = πn Copyright © 2010, S. K. Mitra • It can be seen from the above that hLP [n] = 0 for n = ± L, ± 2 L, ... 16 Copyright © 2010, S. K. Mitra Design of Linear-Phase Lth-Band Filters Design of Linear-Phase Lth-Band Filters • Hence, the coefficient condition of the Lthband filter α, n=0 h[Ln] = ⎧⎨ ⎩ 0, otherwise • There are many other candidates for Lthband FIR filters • Program 13_8 can be used to design an Lthband FIR filter using the windowed Fourier series approach • The program employs the Hamming window • However, other windows can also be used is indeed satisfied • Hence, an Lth-band FIR filter can be designed by applying a suitable window w[n] to hLP [n] Copyright © 2010, S. K. Mitra 18 Copyright © 2010, S. K. Mitra 3 Design of Linear-Phase Lth-Band Filters Design of Linear-Phase Lth-Band Filters • Figure below shows the gain response of a half-band filter of length-23 designed using Program 13_8 • The filter coefficients are given by h[ −11] = h[11] = − 0.002315; h[ −10] = h[10] = 0; h[ −9] = h[9] = 0.005412; h[ −8] = h[8] = 0; h[ −7 ] = h[ 7 ] = − 0.001586; h[ −6] = h[ 6] = 0; 0 h[ −5] = h[5] = 0.003584; h[ −4] = h[ 4] = 0; Gain, dB -20 h[ −3] = h[3] = − 0.089258; h[ −2] = h[ 2] = 0; h[ −1] = h[1] = 0.3122379; h[ 0] = 0.5; -40 -60 -80 0 0.2 0.4 0.6 0.8 1 ω/π 19 Copyright © 2010, S. K. Mitra 20 Design of Linear-Phase Lth-Band Filters • The problem of designing a real-coefficient half-band FIR filter can be transformed into the design of a single passband FIR filter with no stopband which can be easily designed using the Parks-McClellan algorithm • An inverse transformation of the wideband filter then yields the half-band FIR filter Gain response of 4th-band FIR filter Gain, dB 0 R = 0.1→ ← R = 0.4 -40 -60 -80 0 0.2 0.4 0.6 0.8 Copyright © 2010, S. K. Mitra Design of Linear-Phase Half-Band Filters • We show below the gain response of a length 23 4th-band lowpass filter designed using the M-file firnyquist with 2 different roll-off factors -20 • As expected, h[n] = 0 for n = ± 2, ± 4, ± 6, ± 8, ±10 1 ω/π 21 23 Copyright © 2010, S. K. Mitra 22 Copyright © 2010, S. K. Mitra Design of Linear-Phase Half-Band Filters Design of Linear-Phase Half-Band Filters • Let the specifications of the real-coefficient half-band filter G(z) of order N be as follows: • Passband edge at ωp , stopband edge at ωs , passband ripple of δp , and stopband ripple of δ s • Now for a half-band filter δ p = δ s = δ , ω p + ωs = π and the order N is even with N/2 odd • Now, consider the design of a wide-band linear-phase FIR filter F(z) of degree N/2 with a passband from 0 to 2ωp , a transition band from 2ωp to π, and a passband ripple of 2δ • Since N/2 is odd, F(z) has a zero at z = −1 • Let f[n] denote the impulse response of F(z) Copyright © 2010, S. K. Mitra 24 Copyright © 2010, S. K. Mitra 4 Design of Linear-Phase Half-Band Filters Design of Linear-Phase Half-Band Filters • Define 25 • The plots below the magnitude response of an wide-band lowpass filter of degree 13 with a passband from 0 to 0.85π and a transition band from 0.9π to π and the magnitude response of the derived half-band filter Wide-Band Lowpass Filter 26 29 0.8 0.6 0.4 0.6 0.4 0.2 0 0.2 0.4 0.6 ω/π 0.8 1 0 0 0.2 0.4 0.6 0.8 1 ω/π Copyright © 2010, S. K. Mitra Design of Half-Band IIR Filters G ( z )G ( z −1 ) + G (− z )G (− z −1 ) = 1 can be decomposed in the form Copyright © 2010, S. K. Mitra 0.8 0 • Recall that an odd-order bounded real (BR) lowpass IIR transfer function G(z) = P(z)/D(z) with a symmetric numerator and satisfying the power-symmetry condition 27 1 0.2 Design of Half-Band IIR Filters G ( z ) = 1 [A0 ( z 2 ) + z −1A1 ( z 2 )] 2 where A0 (z ) and A1 (z ) are stable allpass functions Half-Band Lowpass Filter 1 Magnitude Magnitude G ( z ) = 1 [ z − N / 2 + F ( z 2 )] 2 • G(z) can be seen to be the transfer function of a causal half-band lowpass FIR filter with an impulse response ⎧1 f [n / 2], n even ⎪⎪2 g[n] = ⎨ 0, n odd , n ≠ N 2 ⎪ 1 N , n = ⎪⎩ 2 2 Copyright © 2010, S. K. Mitra 28 • It follows from the power-symmetry condition that G(z) is a half-band lowpass transfer function • A Butterworth half-band lowpass IIR filter G(z) can be designed by first designing an odd-order analog Butterworth lowpass filter with a 3-dB cutoff frequency at Ωc = 1 and then applying a bilinear transformation • We next consider the design of an elliptic IIR half-band filter Copyright © 2010, S. K. Mitra Design of Half-Band IIR Filters Design of Half-Band IIR Filters • It can be shown that any odd-order elliptic lowpass half-band filter G(z) with a frequency response specification given by 1 − 2δ p ≤ G (e jω ) ≤ 1, for 0 ≤ ω ≤ ω p • It can be shown that the poles of the elliptic lowpass half-band filter lie on the imaginary axis • Using the pole-interlacing property, we can readily identify the expressions for A0 ( z ) and A1 ( z ) G ( e jω ) ≤ δ s , for ωs ≤ ω ≤ π and satisfying the conditions ω p + ωs = π, δ2s = 4δ p (1 − δ p ) is a power-symmetric transfer function Copyright © 2010, S. K. Mitra 30 Copyright © 2010, S. K. Mitra 5 31 Design of Half-Band IIR Filters Design of Half-Band IIR Filters • Design Steps: • Since ω p + ωs = π, δ2s = 4δ p (1 − δ p ) , only one of the bandedges and one of the ripples can be specified • Let the specified stopband edge and stopband ripple be ωs and δs , respectively • Then ωp and δ p are determined using the equations at the top of the slide • Copyright © 2010, S. K. Mitra 32 35 r= tan(ω p / 2) tan(ωs / 2) r' = 1 − r2 (1 − r ') q0 = 2(1 + r ') and compute q = q0 + 2 q05 + 15q09 + 150 q13 0 2 ⎛ 1 − δ2s ⎞ D = ⎜⎜ 2 ⎟⎟ ⎝ δs ⎠ Copyright © 2010, S. K. Mitra Design of Half-Band IIR Filters Design of Half-Band IIR Filters • Next, the estimate of the order of G(z) is determined by choosing the smallest odd integer satisfying log (16 D) N ≥ 10 log10 (1 / q ) • As a result, the corresponding value of δs will be smaller than the original specified value • To determine the actual value of δs , the actual value of the parameter D is first computed from • Now the integer value of N is almost always higher than the quantity on the RHS of the above equation 33 Define Copyright © 2010, S. K. Mitra D= 10 N log10 (1 / q ) 16 34 Copyright © 2010, S. K. Mitra Design of Half-Band IIR Filters Design of Half-Band IIR Filters • From the actual value of D, the actual value of δs is computed by solving 2 ⎛ 1 − δ2 ⎞ D = ⎜⎜ 2 s ⎟⎟ ⎝ δs ⎠ • From the new value of δs , the actual value of δ p is obtained from δ2s = 4δ p (1 − δ p ) • Next, the poles of the two allpass filters are computed as follows: 2 q1 / 4 ∑i∞=0 (−1)i qi (i +1) sin((2i + 1)kπ / N ) λk = 2 1 + 2 ∑i∞=0 (−1)i qi cos(2πki / N ) λ2 bk = (1 − rλ2k )⎛⎜1 − k ⎞⎟ r ⎠ ⎝ 2 ck = 2bk /(1 + λ k ) Copyright © 2010, S. K. Mitra 36 α k −1 = (2 − ck ) /(2 + ck ) Copyright © 2010, S. K. Mitra 6 Design of Half-Band IIR Filters Design of Half-Band IIR Filters • In general, the two infinite sums in the expression for converge after the addition of 5 or 6 terms • The poles of the two allpass filters are on the imaginary axis at z = ± j α k and are inside the unit circle, as the parameters α k are distinct with magnitudes less than 1 • Using the pole-interlacing property, then poles of A0 (z ) and A1 (z ) are selected • Their corresponding zeros are at the mirrorimage locations • Example • We consider the design of an elliptic halfband lowpass filter 37 Copyright © 2010, S. K. Mitra Copyright © 2010, S. K. Mitra Design of Half-Band IIR Filters Design of Half-Band IIR Filters • The specifications are: ωs = 0.6 π δ s = 0.016 • The transfer functions of the two allpass sections of the half-band filter designed using Program 13_9 are given by • The pole-zero plot and the magnitude response of the designed elliptic lowpass half-band filter are shown below: 1 + 0.23647 z −1 , A1 ( z ) = 0.71454 + z −1 1 + 0.71454 z −1 Copyright © 2010, S. K. Mitra Half-Band IIR Lowpass Filter 1 0.5 Magnitude 0.23647 + z −1 The pole-zero plot 1 Imaginary Part A0 ( z ) = 39 38 0 -0.5 0.8 0.6 0.4 0.2 -1 -1.5 40 -1 -0.5 0 0.5 Real Part 1 1.5 0 0 0.2 0.4 0.6 0.8 1 ω/ π Copyright © 2010, S. K. Mitra 7