<<

Chapter 6: Problem Solutions Multirate Digital Processing: Fundamentals

Sampling, and Downsampling

à Problem 6.1

Solution

From the definiton of downsampling, y n  x 2n a) y n  2n  n b) y n  2n  1  0     c) yn  1 2nu 2n  u n d) yn  ej0.2n  e) yn  ej0.2nu2n  yn  ej0.2nu n f) y n  2cos 0.4n g) yn  2cos 0.5  2n  2 cos n  1 n h) y n  2sin n  0 i) y n  cos 2n  1      j) y n  2sin 2n  0        

4 Solutions_Chapter6[1].nb

à Problem 6.3

Solution

X () 1 x[n] y[n] 2

B 

In all cases

1  1  Y   2 X 2  2 X 2  for all   Whene there is no , ie X   0 for 2    then this relation simpilfies to 1    Y   2 X 2    a) B  5  2 . Then there is no aliasing after downsampling  and therefore Y  is as shown below X ()    Y() 1   x[n] y[n] 1 2 2       2  5 5

 b) B  2 . Then again there is no aliasing after downsampling and therefore Y  is as shown below X () Y () 1   x[n] y[n] 1 2 2        2

3 c) B  4 . In this cases there is aliasing and we have to account for it. Best way to do it is proceed in two steps: sampling and then downsampling. Solutions_Chapter6[1].nb 5

The sampling operation yields

 1 1 Y   2 X   2 X  1 1 The figure below shows both 2 X  and 2 X  . 1       2       2  3  2 4 1 X (  ) 2 1 2   2    2 4

  Then downsampling yields Y   Y 2 , just a rescaling of the frequency axis. The final results is shown below.

    Y ()     3   4 4

Y () 1/ 2 1/ 3     2 6 Solutions_Chapter6[1].nb

d) B . Same reasoning as in c). This time it is easy to see that

 1 1 1 Y   2 X   2 X   2 for all    1 and therefore Y   Y 2  2 for all .       à Problem 6.4    

Solution

n 1 n n 1 n jn Recall that y n  x 2 2 n  2 x 2  1  1  2 x 2  1  e a) y n  n ;

1 n b) y n  2   1  1 u n           1 j0.05n 1 j 0.05 n c) yn  2 e  2 e d)    1 j0.05 n 1  j 0.05 n  y n 2 e 2 e  u n e)     y n  1 ej0.05n  1 ej 0.05 n u n  1 ej0.05n  1 ej 0.05 n u n   4 4    4 4 which becomes     y n  1 cos 0.05n u n  1 cos 0.95n u n   2 2        1 1 f) similarly y n  2 cos 0.05n  2 cos 0.95n           à Problem 6.5      

Solution x[n] s[n] y[n] 2 2

Using the DTFT. For upsampling S   X 2 and downsampling

1  1  Y   2 S2  2 S 2  Substitute for S  to obtain         Solutions_Chapter6[1].nb 7

  S 2  X 2 2  X    S 2   X 2 2   X 2

      Therefore        1 1 Y   2 X   2 X 2  X  from the periodicity of the DTFT.         à Problem 6.6

Solution

From the diagram it is easy to verify that x n if n even y n  0 if n odd 1 Therefore y n  x n 2 n , and Y z  2  X z  X z , or equivalently, 1   Y   2  X   X  .    One way we can verify this is the following: call v n the output of the downsampler. Then              1         V   2  X 2  X 2  1 Since y n is the output of the upsampler then Y V 2  2  X   X  as we expect.       

à Problem  6.7         

Solution X () x [n] x[n] M y[n] 1 2

  4 s[n]

The effect of on the frequency spectrum is as follows

1 1 DTFT xM n  2 X 0  2 X 0

       8 Solutions_Chapter6[1].nb

where xM n  x n cos 0n . After upsampling by 2 the signal y n has DTFT

1 1     Y   XM2  2 X 20  2 X 20  a) 0  4 . Then XM  and Y  are shown below.         X M ()     1/ 2

    2  4 2  2 Y () 1/ 2

   8 

 b) 0  2 . Then XM  and Y  are shown below.

X M ()     1/ 2  

    2  4 2  2 Y() 1/ 2

   4 

c) 0 . Then XM  and Y  are shown below.

    Solutions_Chapter6[1].nb 9

X M () 1   3   2  4  2  2 Y () 1

   2 

In this case notice the maximum amplitude of the DTFT being "one" (rather then 1/2 as in the previous cases). This is due to the fact that X   X  .

à Problem 6.8    

Solution

In this problem we need to increase the sampling frequency from Fs  8kHz to Fs  12kHz, ie by 12 3 a factor 8  2 . Therefore with ideal filters the scheme is as shown below. x[n] s[n] y[n] 3 H () 2

H ()

  3 10 Solutions_Chapter6[1].nb

à Problem 6.9

Solution

In this case the Low Pass Filter H  is a non ideal FIR filter. The whole problem is to choose the correct specifications for the filter.

 The stopband has to be S  3 , since the purpose of this filter is to stop the frequency artifacts generated by the upsampling operation.  The passband has to be decided on the basis of the bandwirdth of the signal we want to pass and the desired complexity of the filter. For a window based, recall that we need a hamming window (from the desired attenuation) with transition region   8 N.  8 Therefore an FIR filter of length N will have a passband p  3  N .

à Problem 6.10 

Solution

The digital signal has frequencies at 1 2 6  3 rad and 2  2 2 6 2 3 rad. Therefore the output signal has frequencies at  3, 2 3 and also at  3 2 3,  3 2 3, 2 3  3 and 2 3  3. All components at  3 and  2 3 are going to sum with each other.     àProblem 6.11        

Solution

a) H z  2  4z3  6z6  z1 3  5z3  2z6  z2 2  2z3 b) H z  2  2z2  5z4  6z6  z1 3  4z2  2z4  2z6 c) H z  2z2  1  2z2 5z4 6z6  z1 z2  3  4z2  2z4 2z6 d) H z  z3  4z3  6z6  z1 z3 2  5z3  2z6  z2 2z6  3z3  2z3    e) Hz  0.5nzn 0.52nz2n  z10.5 2n1z2n whixh yields  n0 n0 n0      1 1 0.5    H z  10.25z2  z  10.25z2   z f) H z    which can be written as  z 0.8   H z 0.8nzn 0.82nz2n  z10.82n1z2n . This becomes n0 n0   n0 1 1 0.8   H z  10.64z2  z  10.64z2 The same result can be obtained by an alternative way:   Solutions_Chapter6[1].nb 11

z z0.8 z2 1 0.8z2 H z  z0.8  z0.8  z20.64  z  z20.64 amd you can verify that the two answers are the same. g) You can verify that the general  exprezzion for the polyphase terms is  n Hk z h nM  k z n for k  0, ..., M  1. Applying this formula we obtain

  sin 5  3nk n  Hk z      z for k  0, 1, 2 n 5 3 n k

   Problem 6.12   à  

Solution

a) From the of the filter H z  1  z1  2z2  z3  z4  z5  z6 and M  4 we obtain the decomposition

4 1 4 2 4 3 4 H z  H0 z  z H1 z  z H2 z  z H3 z with

1     H0 z 1  z     1 H1 z  1  z 1 H2 z  2  z H3 z 1   The block diagram of the system is shown below:     x[n] y[n]  4 H 0 (z) z 1

 4 H1(z) z 1

 4 H 2 (z) z 1

 4 H 3 (z)

b) Using the same filters, the realization is as follows: 12 Solutions_Chapter6[1].nb

x[n] y[n]

H 0 (z)  4 z 1

H1 (z)  4 z 1

H 2 (z)  4 z 1

H 3 (z)  4

1 2 3 c) When M  2 the polyphase decomposition becomes H0 z  1  2z  z  z and H z  1  z1  z2 Therefore the system becomes as shown below:     x[n] y[n]  2  2 H 0 (z) z 1

 2 H1(z)

Now notice that the cascade upsampler - downsampler (both by 2) is just an identity. Also the cascede upsampler - time delay - downsampler as shown gives an output of zero, no matter what the input is (easy to verify). This is shown below:  2  2 

 2 z 1  2  0

Therefore the overall system looks like this one: Solutions_Chapter6[1].nb 13

x[n] y[n] H 0 (z)

Applications of MultiRate

à Problem 6.13

Solution

a) In digital frequency, the passband is P  225 6000  120 radians, and the stopband is S  230 6000  100 radians. As a consequence the transition region is   S P  0.0017. For a 60 dB attenuation we can use (say) a Kaiser window with parame- ters     0.1102 60  8.7  5.6533 608 N  2.285  4, 261.1 and therefore the order is 4, 262. This yields a total number of   4, 2626, 000  25.572106 multiplications and additions per second b) Since we want to reject all frequencies above 30Hz, we can downsample from the orginal sampling frequency (6kHz) down to 60Hz, ie by a factor D  6, 000 60  100. As seen in class, this can be done in three stages by factoring D  100 as (say) 100  1052  as shown below

F  600Hz F 120Hz F1  Fx  6kHz 2 3 Fy 

H1 10 H2 5 H3 2 x[n]

Now the specifications of the filters become as follows: 14 Solutions_Chapter6[1].nb

H1 :Fp  25Hz, FS  600  30  570Hz,   2 570  25 6000  0.1817

H2 :Fp  25Hz, FS  120  30  90Hz,   2 90  25 600  0.2167

H3 :Fp  25Hz, FS  60  30  30Hz,   2 30  25 120  0.0833 From the transition bands we can determine the orders of the filters. using the Kaiser window again we have the orders N ,N,N of the threee filters to be. respectively, 1 2 3   608 N1  2.285  40 608 N2  2.285  34 608 N3  2.285  87 Finally the total number of operations per second becomes: ops sec  406000  34  600  87  120  270, 840  0.28106 which is reduction of a factor of more than 90. Also notice that we are not even attempting to save even more in computation using the polyphase decomposition! 

à Problem 6.14

Solution

Q1) Recall the Butterworth filter frequency response:

2 1 1 H         2 N 2  2 N 1 c 1 p

Then for the , the passband is Fp  22kHz  222, 000, that is to say     p  44, 000 rad sec. The stopband  has to be at half the sampling frequency, ie FS  44.1 2  22.05kHz, that si to say S  44, 100 rad sec. From the passband we determine the factor e from  1 2 2 12  1  0.01  0.9801  0.0203 and therefore 0.1425 We determine the order from the requirement 2 1 2 4  H S  44.12N  0.01  10 10.0203 44 Solving for N gives a very large number, and the analog filter cannot be implemented. Furthermore there will be a in phase from the reconstruction  filter itself. Q2) Now the filter has still the same expression, but with N  4, since we are restricted to a 4 pole filer. Therefore the filter is given by

2 1 H    8 10.0203 44,000 Since we want the attenuation to be 40dB in the stopband, we can solve for the stopband, as      Solutions_Chapter6[1].nb 15

1 2 4  8  0.01  10 10.0203 44,000 which yields   4 1 8 S 10 1 44,000  0.0203  5.1470

Therefore the stopband of this filter is at FS  5.147022kHz  113.24kHz. This has to coin- cide with half the sampling frequency, and therefore the new sampling frequency is   Fs  2113.24kHz  226.5kHz. In other words we have to upsample at least by 226.5/44.1=5.1 times before the Digital to Analog conversion.