Chapter 7: DFT Filter Bank Solutions

à Problem 7.1

Problem

An FIR Filter has H z  2  z1  z2  0.5z3 and response H  . a) Determine the Impulse Response of the filter F z with frequency response   F   H 0.2 . Is the impulse response going to be real?   b) Determine the impulse response of the filter G z with frequency response   H 0.2  H 0.2 . How do you relate the two impulse responses f n and g n ?     Solution           a) The transfer function F z is determined as F z  H zej0.2 . In fact you can verify that j j0.2 F   F z zej  H e e  H 0.2 . Substituing for the z-Transform we obtain       F z  2  ej0.2z1  ej0.4z2  0.5ej0.6z3         This yields an impulse response f n  2 n  ej0.2 n  1  ej0.4 n  2  0.5ej0.6 n  3 Notice that it is computed as f n  h n ej0.2n , with h n the impulse response of H z . b) By the same  argument  the transfer function  can be determined as   G z  H zej0.2  H zej0.2 . Therefore the transfer function becomes         G z  4  2cos 0.2 z1  2cos 0.4 z2  cos 0.6 z3  4  1.61803z1  0.6180z2  0.3090z3       and the impulse response        

g n  4 n  1.61803 n  1  0.6180 n  2  0.3090 n  3 It is computed as g n  ej0.2n  ej0.2n h n  2cos 0.2n h n . Therefore g n  2Real f n .                          2 Solutions_Chapter_7[1].nb

à Problem 7.2

Problem

You want to determine the low frequency and high frequency components of a signal x n . Design an efficient filter bank where the prototype filter has at least 50dB attenuation in the stopband and a transition region of   0.1. Use the window method.   Solution

The prototype filter is a low pass filter with bandwidth  2, with impulse response  sin 2 n h0 n  n w n

with w n the non causal window sequence. Since we need 50dB attenuation in the stopband we use a Blackman window, which has a transition region   12 N. Therefore we determine the filter     length N from the transition band as   12  0.1 N  This yields N  121. The Low Pass Filter H0 z has the polyphase decomposition 2 1 2 H0 z  E0 z  z E1 z where   n E0 z h0 2n z  w 0  1 n

since h0 2n  0 for n  0. Similarly    n  sin n2  n E1 n h0 2n  1 z   w 2n  1 z n n  2n1

    Problem 7.3   à      

Solution

  The prototype filter has frequency response H  with bandwith M  8 . Therefore the non causal impulse response of the prototype filter is given by    h n  sin 8 n w n   n

with w n being a window of length N  1  21. For example let w n be a hamming window, which has the expression     w n  N  0.54  0.46 cos 2 n for 0  n  N   2 N  

    Solutions_Chapter_7[1].nb 3

where we listed the causal expression generally found in most tables. From this expression it is easy to see that

2 w n  0.54  0.46cos 20 n for 10  n  10 Finally the expression of the impulse response h n becomes  sin 8 n  h n  n  0.54  0.46cos 10 n for 10  n  10

and zero otherwise.     The transfer function  of the prototype  filter is then given by  H z 0.0018z10  0.0014z9  0.0000z8  0.0047z7  0.0149z6  0.0318z5  0.0543z4  0.0794z3  0.1027z2  0.1191z  0.1250  0.1191 z1  0.1027z2  0.0794z3  0.0543z4  0.0318z5  0.0149z6  0.0047z7  0.0000z8  0.0014z9  0.0018z10 The eight polyphase components of the prototype filter then become as follows:  8 8n Ek z h 8n  k z , for k  0, 1, ..., 7 n which yields

8 8  0  8 E0 z  h 8 z  h 0 z  h 8 z  0.1250 8 8 0 8 8 8 E1 z  h 9 z  h 1 z  h 7 z 0.0014z  0.1191  0.0047z 8 8 0 8 8 8 E2 z  h 10 z  h 2 z  h 6 z 0.0018z  0.1027  0.0149z 8 0 8 8 E3 z  h 3 z  h 5 z 0.0794  0.0318z 8 0 8 8 E4z   h4z  h4 z  0.0543   0.0543z 8 0 8 8 E5z   h5 z  h 3 z  0.0318   0.0794z 8 0 8 16 8 16 E6z   h6z  h2z  h 10 z  0.0149  0.1027z  0.0018z 8 0 8 16 8 16 E7z   h7z  h1z  h 9 z  0.0047  0.1191z  0.0014z       The implementation is shown below.                 4 Solutions_Chapter_7[1].nb

x[n] v [n] 8 0 E0 (z ) z

8 E1(z ) v1[n] z DFT  

z

8 E7 (z ) v7[n]

à Problem 7.4

Solution

a) , b), c) H z is M Band, since h 4n  0 for n  0; d) H z is not M Band since H k  is not a constant for all , as shown below. k 2    

      H   k 2  k  

   4 2

e) H z is M  Band since H k  is a constant as shown below. k 2

    Solutions_Chapter_7[1].nb 5

  H   k 2  k  

  2

à Problem 7.5

Solution

   Let 1  5  and 2  5  for any 0  5 . Then H z is an M Band filter with 1 A  5 as shown below. H   k 2   5    k

 2  5 5

 

à Problem 7.6

Solution

With M  16 the prototype filters for both Analysis and Synthesis have a bandwidth c  16. From what we have seen about maximally decimated DFT Filter banks, if we want to use FIR filters, the only possibility for perfect reconstruction is that both filters h n and g n in the analysis and synthesis network have length M = 16. In this way we would have 

    6 Solutions_Chapter_7[1].nb

H z = h 0 + h -1 z + ... + h -15 z15 G z = g 0 + g 1 z-1 + ... + g 15 z-15 with the Perfect Reconstruction condition         1     h n g n = Å1ÅÅ6ÅÅÅÅ   What makes this problem a bit different from the standard FIR window based design problem is the fact the filter order is odd, ie the total filter length is 16, which is even. In Chapter 4 we have consid-     ered only the case where the total filter length is odd as N = 2 L + 1. Although most of the time this is not a major restriction, in this case we have to design a filter with the precise length, and none of the filter coefficients can be zero. In other words we cant use (say) a filter with length 14, and assume h -15 = 0, since this would require g 15 =¶, clearly not feasable.

In order to design a filter with even length, we can call Hd w the frequency response of an ideal Low Pass Filter with bandwidth wc , and compute     +wc w w - j ÅÅÅÅÅ2 1 - j ÅÅÅÅÅ2 jwn hd n = IDTFT H w e = ÅÅÅÅÅÅÅÅ2 p  e e dw -wc This leads to the impulse response

      1  sin wc n- ÅÅÅÅ2 hd n = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ1 p n- ÅÅÅÅ2 Now the goal is to find a linear phase approximation with  a finite number of coefficients. In particular   let   L ` -jwn HL w =S hd n e n=-L+1 which can be written as L-1   L ` jwn -jwn HL w =S hd -n e +S hd n e n=0 n=1

It is easy to see that hd -n = hd n + 1 and therefore we can write   L   L   ` -jw jwn -jwn HL w = e S hd n e +S hd n e n=1 n=1     j ÅwÅÅÅÅ ` This shows that e 2 H L w is real, since   L   L j ÅÅÅÅÅw ` - j ÅÅÅÅÅw jwn - j ÅÅÅÅÅw -jwn e 2 HL w = e 2 S hd n e + e 2 S hd n e n=1 n=1 `   and therefore H L w has linear phase. As a consequence a causal translation has linear phase too, which leads to the linear phase FIR  filter with frequency  response   2 L-1 ` -jw L-1 -jwn HL w e =S hd n - L + 1 e   n=0

      Solutions_Chapter_7[1].nb 7

p In our case, the bandwidth is wc = ÅÅÅ16ÅÅÅÅ , the filter order is 15 = 2 L - 1, which yields L = 8, and the FIR filter bacomes

p 1 sin ÅÅÅÅÅÅÅ16 n-7- ÅÅÅÅ2 hd n = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ1 ÅÅÅÅÅ , for n = 0, ..., 15 p n-7- ÅÅÅÅ2 without including the window. Finally the filters h n and g n of the analysis and synthesis networks   become   p 1 sin ÅÅÅÅÅÅÅ16 n-7- ÅÅÅÅ2 2 p h -n = hd n w n = ÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅÅ1 ÅÅÅÅÅ 0.54 - 0.46 cos ÅÅÅÅÅÅÅÅ15 n for 0  n  N p n-7- ÅÅÅÅ2     and            16    g n = ÅhÅÅÅÅÅÅ-ÅÅnÅÅÅÅ , for 0  n  N In terms of the polyphase decomposition, every term is a constant, as     E-k z = h -k Fk z = g k for k = 0, ..., 15. It is just a matter of computing the coefficients to determine the final result shown in     the figure below for the analysis network.    

0.0034 v0[n] 0.0056 0.0119 0.0218 0.0339 0.0462  x[n] 0.0562 S / P 0.0618 DFT 0.0618 0.0562 0.0462 0.0339  0.0218 0.0119 0.0056 0.0034 v15 [n] 8 Solutions_Chapter_7[1].nb

à Problem 7.7

Solution

First we can verify that, in the the system below v n if n even w n = 0ifn odd

v[n]   w[n] 2   2

1 n which yields w n = v n d2 n = Å2ÅÅÅ v n + -1 v n . Therefore, as you recall, 1 1 W w = ÅÅ2ÅÅ V w + ÅÅ2ÅÅÅ V w-p and therefore              1 1 W z = ÅÅ2ÅÅ V z + ÅÅ2ÅÅ V -z  Applying this result it is easy to see that 1 1 Y z = G z  ÅÅ2ÅÅ H z X z + ÅÅ2ÅÅ H -z X -z 1 1 = ÅÅÅÅ2 G z H z X z + ÅÅÅÅ2 G z H -z X -z              à Problem 7.8            

Solution

In this case we have a filter bank with two filters. Therefore M = 2 and forperfect reconstruction the filters have to be H z = h 0 + h -1 z G z = g 0 + g 1 z-1 with the condition       1  h 0 g 0 = ÅÅ2ÅÅ 1 h -1 g 1 = ÅÅÅÅ2 Then Let us see how to relate X z = Z x n with  Y z = Z y n . Applying the result from the previ- ous problem we have               Solutions_Chapter_7[1].nb 9

1 1 Y z = G z ÅÅ2ÅÅ H z X z + ÅÅ2ÅÅ H -z X -z + 1 1 + G -z ÅÅÅÅ2 H -z X z + ÅÅÅÅ2 H z X -z which becomes              1 1 Y z = Å2ÅÅÅ G z H z + G -z H -z X z + ÅÅ2ÅÅ G z H -z +G -z H z X -z Now let's see the two transfer functions X z Ø Y z and X -z Ø Y z with the perfect reconstruc- tion conditions above:                         Å1ÅÅÅ G z H z + G -z H -z = 2         1 -1 -1 ÅÅÅÅ2 g 0 + g 1 z h 0 + h -1 z + g 0 - g 1 z h 0 - h -1 z = =          ÅÅÅÅ1 2 g 0 h 0 + g 1 h -1 + g 0 h -1 - g 0 h -1 z + g 1 h 0 - g 1 h 0 z-1 2                         = 1 for all z 1 Å2ÅÅÅ G z H -z + G -z H z =   1      -1           -1           ÅÅÅÅ2 g 0 + g 1 z h 0 - h -1 z + g 0 - g 1 z h 0 + h -1 z = =          ÅÅÅÅ1 2 g 0 h 0 - g 1 h -1 + -g 0 h -1 + g 0 h -1 z + g 1 h 0 - g 1 h 0 z-1 2                         = 0 for all z

Therefore. as expected,                           Y z = X z and the filter bank perfectly reconstructs the input signal.     à Problem 7.9

Solution

a) From the Problem 7.8, we can write Y z in terms of the input signal X z and its alias X -z . The aliasing comes from the downsampling operation. In terms of the DTFT we can write       Y w = A w X w + B w X w-p where 1 1 A w = Å2ÅÅÅ G w H w + ÅÅ2ÅÅ G w-p  H w-p 1 1 B w = ÅÅÅÅ2 G w H w-p + ÅÅÅÅ2 G w-p H w In our case the two prototype filters  have frequency   response H w = G w as shown below.               10 Solutions_Chapter_7[1].nb

H() 10 1   (  0.55 )

0.45  0.55

Therefore:

2 2 ÅÅÅÅÅÅÅ10 w-0.55 p 2 + ÅÅÅÅÅÅÅ10 w-0.45 p 2 if 0.45 p < w < 0.55 p A w = p p 1 otherwise

      A ()       1

 0.45   0.55

Analogously: - ÅÅÅ10ÅÅÅÅ 2 w -0.55 p w -0.45 p if 0.45 p< w < 0.55 p B w = p 0 otherwise and the maximum value is at w=≤ÅpÅÅÅ where the maxixmum is B ≤ ÅÅpÅÅ = 0.25, as shown below.    2      2      B()  

   0.45 0.55

b) For the given signal X w = 20 pd w + 2 pd w-0.2 p + 2 pd w+0.2 p - 3 pd w-0.7 p - 3 pd w+0.7 p , for -p § w < p Therefore the reconstructed signal becomes             Solutions_Chapter_7[1].nb 11

Y w = A w X w + B w X w-p with A w , B w as above, and X w-p = 20 pd w-p + 2 pdw+ 0.8 p + 2 pd w- 0.8 p - 3 pd w+0.3 p - 3 pd w-0.3 p From the plot of A w and B w we can verify that     A 0 = A ≤0.2 p = A ≤0.7 p = 1     B ≤p = B ≤0.8 p = A ≤0.3 p = 0     and therefore, for the given signal, y n = x n .             à Problem 7.10    

Solution

First let's see what is the transfer function (or the frequency response) of the system shown below. x[n] v[n] y[n] 2 Q(z) 2

Applying standard considerations we can see that 1 w w 1 w w Y w = Å2ÅÅÅ Q ÅÅ2ÅÅÅ V ÅÅ2ÅÅÅ + ÅÅ2ÅÅ Q ÅÅ2ÅÅÅ -p V ÅÅ2ÅÅÅ -p Also, from the upsampler, V w = X 2 w , which implies w     V ÅÅ2ÅÅÅ = X w    V w X 2 w X 2 X  ÅÅÅÅÅ2 -p =  ÅÅÅÅÅ2 -p = w- p = w using the periodicity of the DTFT. Therefore, subsituting   into the expression for Y w we obtain 1 w w  Y w = ÅÅ2ÅÅ Q ÅÅ2ÅÅÅ +Q ÅÅ2ÅÅÅ -p X w   = Q0 w X w   Therefore the impulse response q0 n = IDTFT  Q0 w is the impulse   response q n downsampled by two, ie     q0 n = q 2 n        In other words from the polyphase decomposition

2 -1 2 Q z = Q0 z +z  Q1 z where       12 Solutions_Chapter_7[1].nb

Qk z = Z q 2 n + k

we can determine the transfer function Q0 z .

a) We want to determine the four transfer functions  Yi z X j z for i, j = 0, 1. See each one separately: ÅÅÅÅÅÅÅÅÅÅÅÅÅY0 z = 0 : since, in this case   X1 z 1 -1  -2 -3 1 1 2 3   Q z = G1 z H0 z = ÅÅ4ÅÅ 1 - z + z - z ÅÅ4ÅÅ 1 + z + z + z   1 -3 -1 3 = ÅÅÅÅÅÅÅ16 -z - z + z + z

and therefore Q0 z =0 since there  are  no even powers of z in Q z .  ÅÅÅÅÅÅÅÅÅÅÅÅÅY1 z = 0 : since, in this case   X0 z   1 -1 -2 -3 1 1 2 3   Q z = G0 z H1 z = ÅÅ4ÅÅ 1 + z + z + z ÅÅ4ÅÅ 1 - z + z - z   1 -3 -1 3 = ÅÅÅÅÅÅÅ16 z + z - z - z

and therefore Q0 z =0 since there  are  no even powers of z in Q z         ÅÅÅÅÅÅÅÅÅÅÅÅÅY0 z = ÅÅÅÅÅÅÅ1 2 z-1 + 4 + 2 z : since, in this case X0 z 16 1 -1 -2 -3 1 1 2 3   Q z = G0 z H0 z = ÅÅ4ÅÅ 1 + z + z + z ÅÅ4ÅÅ 1 + z + z + z   1 -3 -2 -1 2 3   = ÅÅÅÅÅÅÅ16 z + 2 z + 3 z + 4 + 3 z + 2 z + z and the polyphase decomposition          1 -2 2 -1 1 -2 2 4 Q z = ÅÅÅ16ÅÅÅÅ 2 z + 4 + 2 z + z Å1ÅÅ6ÅÅÅÅ z + 3 + 3 z  + z which yields

1 -1    Q0 z = Å1ÅÅ6ÅÅÅÅ 2 z + 4 +2 z .  ÅÅÅÅÅÅÅÅÅÅÅÅÅY1 z = ÅÅÅÅÅÅÅ1 2 z-1 + 4 + 2 z : since, in this case X1 z 16  1 -1 -2 -3 1 1 2 3   Q z = G1 z H1 z = ÅÅ4ÅÅ 1 - z + z - z ÅÅ4ÅÅ 1 - z + z - z   1 -3 -2 -1 2 3   = ÅÅÅÅÅÅÅ16 -z + 2 z - 3 z + 4 - 3 z + 2 z - z and the polyphase decomposition          1 -2 2 -1 1 -2 2 4 Q z = ÅÅÅ16ÅÅÅÅ 2 z + 4 + 2 z + z Å1ÅÅ6ÅÅÅÅ -z - 3 - 3 z - z which yields

1 -1    Q0 z = Å1ÅÅ6ÅÅÅÅ  2 z + 4 + 2 z .  b)    