Chapter 6: Problem Solutions Multirate Digital Signal Processing: Fundamentals
Sampling, Upsampling and Downsampling
à Problem 6.1
Solution
From the definiton of downsampling, y n x 2n a) y n 2n n b) y n 2n 1 0 c) yn 1 2nu 2n u n d) yn ej0.2n e) yn ej0.2nu2n yn ej0.2nu n f) y n 2cos 0.4n g) yn 2cos 0.5 2n 2 cos n 1 n h) y n 2sin n 0 i) y n cos 2n 1 j) y n 2sin 2n 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 aliasing, 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 jn 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.05n 1 j 0.05 n c) yn 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.05n 1 ej 0.05 n u n 1 ej0.05n 1 ej 0.05 n u n 4 4 4 4 which becomes y n 1 cos 0.05n u n 1 cos 0.95n u n 2 2 1 1 f) similarly y n 2 cos 0.05n 2 cos 0.95n à 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 S2 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 modulation 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 0n . After upsampling by 2 the signal y n has DTFT
1 1 Y XM2 2 X 20 2 X 20 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 8kHz to Fs 12kHz, 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 4z3 6z6 z1 3 5z3 2z6 z2 2 2z3 b) H z 2 2z2 5z4 6z6 z1 3 4z2 2z4 2z6 c) H z 2z2 1 2z2 5z4 6z6 z1 z2 3 4z2 2z4 2z6 d) H z z3 4z3 6z6 z1 z3 2 5z3 2z6 z2 2z6 3z3 2z3 e) Hz 0.5nzn 0.52nz2n z10.5 2n1z2n whixh yields n0 n0 n0 1 1 0.5 H z 10.25z2 z 10.25z2 z f) H z which can be written as z 0.8 H z 0.8nzn 0.82nz2n z10.82n1z2n . This becomes n0 n0 n0 1 1 0.8 H z 10.64z2 z 10.64z2 The same result can be obtained by an alternative way: Solutions_Chapter6[1].nb 11
z z0.8 z2 1 0.8z2 H z z0.8 z0.8 z20.64 z z20.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 3nk n Hk z z for k 0, 1, 2 n 5 3 n k
Problem 6.12 à
Solution
a) From the transfer function of the filter H z 1 z1 2z2 z3 z4 z5 z6 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 H3 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 2z z z and H z 1 z1 z2 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 225 6000 120 radians, and the stopband is S 230 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 608 N 2.285 4, 261.1 and therefore the order is 4, 262. This yields a total number of 4, 2626, 000 25.572106 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 1052 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 25Hz, FS 600 30 570Hz, 2 570 25 6000 0.1817
H2 :Fp 25Hz, FS 120 30 90Hz, 2 90 25 600 0.2167
H3 :Fp 25Hz, FS 60 30 30Hz, 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 608 N1 2.285 40 608 N2 2.285 34 608 N3 2.285 87 Finally the total number of operations per second becomes: ops sec 406000 34 600 87 120 270, 840 0.28106 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 reconstruction filter, the passband is Fp 22kHz 222, 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.05kHz, that si to say S 44, 100 rad sec. From the passband ripple we determine the factor e from 1 2 2 12 1 0.01 0.9801 0.0203 and therefore 0.1425 We determine the order from the requirement 2 1 2 4 H S 44.12N 0.01 10 10.0203 44 Solving for N gives a very large number, and the analog filter cannot be implemented. Furthermore there will be a distortion 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 10.0203 44,000 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 10.0203 44,000 which yields 4 1 8 S 10 1 44,000 0.0203 5.1470
Therefore the stopband of this filter is at FS 5.147022kHz 113.24kHz. This has to coin- cide with half the sampling frequency, and therefore the new sampling frequency is Fs 2113.24kHz 226.5kHz. In other words we have to upsample at least by 226.5/44.1=5.1 times before the Digital to Analog conversion.