SECTION FOR DIGITAL SIGNAL PROCESSING DEPARTMENT OF MATHEMATICAL MODELLING TECHNICAL UNIVERSITY OF DENMARK Course 04362 Digital Signal Processing: Solutions to Problems in Proakis and Manolakis, Digital Signal Processing, 3rd Edition Jan Larsen 3rd Edition c September 1998 by Jan Larsen
Preface This note is a supplement to the textbook used in the DTU Course 04362 Digital Signal: J.G. Proakis & D.G. Manolakis: Digital Signal Processing: Principles, Algorithms and Applications, 3rd edition, Upper Saddle River, New Jersey: Prentice-Hall, Inc., 1996. Unless anything else is mentioned, all page and equation references are with respect to the course textbook. The note is partially based on material by Simon Boel Pedersen used in the former DTU course 4232 Digital Signal Processing. Jan Larsen Lyngby, September 1998 The manuscript was typeset in 12 points Times Roman and Pandora using L A TE2" i
SOLUTION TO PROBLEM 9.1 The center frequency is F c = 50 and the bandwidth is B = 20. According to Ch. 9.1. the minimum sampling frequency is given by F s min = 1=T 0 = 2Br 0 =r where r 0 = F c =B +1=2 =50=20 + 1=2 =3and r = br 0 c =3. That is, F s min = 2B = 40. In general, we require that the p'th and the (p + 1)'th replication of the spectrum in the sampled signal does not interfere with the original signal spectrum as shown in Fig 9.1. 6 j(f )j B- 6 F c j(f ; pf s )j - F pf s ; F c pf s j(f ; (p +1)F s )j 6 - F (p +1)F s ; F c (p +1)F s - F Fig. 9.1 This gives the inequalities: F c ; B=2 > pf s ; F c + B=2 F c + B=2 < (p +1)F s ; F c ; B=2 Here we assume F c >B=2 and p is an integer. Rewriting yields: p < 2F c ; B F s p +1 > 2F c + B F s Thus B F s ; 1 <p; 2F C F s < ; B F s 1
which implies the natural condition: F s > 2B The minimum sampling frequency is achieved when p is maximized. natural condition, the rst inequality gives p< B F s 2Fc B ; 1 < F c B ; 1 2 Using the and the second gives m p +1> F c B + 1 2 > B F s 2Fc B +1 p> F c B ; 1 2 : Choosing p as the integer, p max = b Fc ; 1 c, ensures that the replicated parts of the B 2 sampled signal are distributed equally along the frequency axis. Applying p max in the inequalities results in: 2B r0 r <F s < 2B s0 s where r 0 = F c =B +1=2, r = br 0 c, s 0 = F c =B ; 1=2, and s = bs 0 c. SOLUTION TO PROBLEM 9.4 Solution to Question (a): Using the sampling frequency F s = 2B, (f) will be a periodic replication of the original spectrum a (F ) with period F s cf. Eq. (4.2.85) (f) = F s P 1 k=;1 a ((f ; k)f s ). The spectrum of y(n), say Y (f) is obtained by using the fact that multiplication in the time-domain corresponds to convolution in the frequency domain. Finally, y 1 (t) is found by low-pass ltering y(n) using a passband F 2 [0 B]. a (F ) has ideal low-pass lter characteristic, say a (f) =1jF jb, and zero otherwise. The spectrum (f) =F s, 8jfj 1=2, i.e., constant. Thus x(n) =F s (n). y(n) = x 2 (n) = F 2 s (n) with spectrum Y (f) = F 2 s, 8jfj 1=2. Consequently, by Eq. (4.2.87) Y 1 (F )=F s for jf jb, and zero otherwise. That is, y 1 (t) =F s x 1 (t). The spectrum of s a (t) =x 2 a(t) is found using convolution in the frequency domain, i.e., Z 1 ( 2B ;jfj ;2B F 2B S a (F )= a(s) a (F ; S)dS = ;1 0 otherwise The sketch of the spectra is shown in Fig. 9.4.1. 2
S a (F ) 6 2B ;2B ;B B - F 2B Fig. 9.4.1(a) S(f) 6 2BF s......... - f = F=2B ;1 ;1=2 1=2 1 Fig. 9.4.1(b) Y 1 (F )=Y 2 (F ) 6 2B ;2B ;B B 2B - F Fig. 9.4.1(c) 3
Thus y 2 (t) =2Bx(t) =2By 1 (t)=f s = y 1 (t). Solution to Question (b): x a (t) =cos(2f 0 t) with spectrum a (F )=0:5(F F 0 ), where F 0 =20Hz. Using F s =50Hz> 2F 0 the sampling theorem is fullled. (F=F s ) has components of amplitude F s =2 for F = (20 + p50) Hz, p = 0 1 2. By using the rule of convolution in the frequency domain Y (F=F s ) has components for F = 10 Hz with amplitude F s =4 and a DC component (F =0)with amplitude F s =2. By ideal D/A we have y 1 (t) = 1=2 +1=2 cos(2(10 Hz)t). s a (t) = x 2 a(t) = cos 2 (2F 0 t) = 1=2 +1=2 cos(22f 0 t), i.e., a (F ) has a DC component with amplitude 1=2 and two components at F = 40 Hz with amplitude 1=4. Sampling with F s = 50 Hz will now cause aliasing. S(F=F s ) will have components at F = 0 with amplitude F s =2 and two components at F = 10 Hz with amplitude F s =4. Ideal D/A gives y 2 (t) =y 1 (t). When sampling with F s = 30 Hz the sampling theorem is not fullled. x(n) will have components at F = 10 Hz with amplitudes F s =2. y(n) consequently have components at F 10 Hz with amplitudes F s =4 at a DC component with amplitude 1=2. Reconstruction gives y 1 (t) =1=2+1=2 cos(2(10 Hz)t). Sampling s a (t) with F s = 30 Hz results in s(n) with a DC component with amplitude F s =2 and two components F = 10 Hz with amplitudes F s =4. Reconstruction gives y 2 (t) =y 1 (t). SOLUTION TO PROBLEM 4.83 Solution to Question (a): From Fig. P4.83 we notice that frequency-inversion scrambling is done by shifting the spectrum by f =1=2 (! = ), thus Y (f) =(f ;1=2). The corresponding time domain operation is found by using the frequency shift property { or modulation theorem Ch. 4.3.2: y(n) =(;1) n x(n). Solution to Question (b): The unscrambler is a similar frequency shift of f = 1=2, thus x(n) =(;1) n y(n) =(;1) 2n x(n) =x(n). SOLUTION TO PROBLEM 9.5 A analog TV signal x a (t) is corrupted by an echo signal. The received signal is: s a (t) =x a (t)+x a (t ; ) jj < 1 > 0 By using the time shifting property, the spectrum of s a (t) is given by: S a (F ) = a (F )+ a (F )e ;j2f = a (F ) 1+e ;j2f 4
Since the bandwidth of x a (t) isb, clearly the bandwidth of s a (t) isalsob. Choosing the sampling frequency in accordance with the sampling theorem F s > 2B and such that = n 0 =F s = n 0 T, where n 0 is a positive integer, and T is the sampling interval, the digital equivalent becomes: s(n) =x(n)+x(n ; n 0 ) with spectrum S(f) =(f) 1+e ;j2fn 0 In order to get y(n) = x(n) and consequently y a (t) = x a (t) when using an ideal reconstruction, i.e., a BL interpolator with cut-o frequency B, we need a lter H(f) which is the inverse of 1 + e ;j2fn 0, thus: H(f) = 1 1+e ;j2fn 0 The corresponding transfer function is H(z) = 1=(1 + z ;n 0 ), i.e., the lter is an all-pole lter with poles found by solving the binomial equation of degree n 0 : The n 0 poles is therefore given by: z p = 8 >< >: q z n 0 = ; n 0 jje j(2p=n 0) ;1 <<0 p =0 1 n 0 ; 1 q jje j(=n 0 +2p=n 0 ) 0 <1 p =0 1 n 0 ; 1 n 0 The poles are inside the unit circle, i.e., jz p j < 1forjj < 1, thus the lter is (BIBO) stable and causal. If n 0 =1the lter is a low-pass lter for <0cf.Ch. 4.5.2. For >0 the lter is the corresponding high-pass lter found by using the modulation theorem (frequency shifting) Ch. 4.3.2. This is easily seen as h(n)(;1) n corresponds to H(f ;1=2). Thus shifting H(f) gives: H(f ; 1=2) = 1 1+e ;j2(f;1=2) = 1 1+e j e ;j2f = 1 1 ; e ;j2f Denote by H n0 (f) the lter using n 0. The lters of n 0 is easily found from H 1 (f). Since H 1 (z) =1=(1 ; z ;1 ), then H n0 (z) =H 1 (z n 0 ), see Ch. 4.5.5 and 10.3. That is, the spectrum H n0 (f) =H n0 (z)j jzj=e j2f is found by H n0 (f) =H 1 (n 0 f) That is, H n0 (f) is a comb lter cf. Ch. 4.4.5. spectra. Fig. 9.5.1 and 9.5.2 show typical 5
25 n 0 =1 20 15 α=0.1 α=0.5 α=0.9 H(f) (db) 10 5 0 5 10 0.5 0.4 0.3 0.2 0.1 0 0.1 0.2 0.3 0.4 0.5 f Fig. 9.5.1 25 n 0 =3 20 15 α=0.1 α=0.5 α=0.9 H(f) (db) 10 5 0 5 10 0.5 0.4 0.3 0.2 0.1 0 0.1 0.2 0.3 0.4 0.5 f Fig. 9.5.2 6
SOLUTION TO PROBLEM 9.7 x(n) is a stationary random signal with mean E[x(n)] = 0, variance V [x(n)] = 2 x and autocorrelation function, xx (m). We consider using a delta modulator. Solution to Question (a): Since d(n) = x(n) ; ax(n ; 1) and E[x(n)] = 0 also E[d(n)] = 0, i.e., the variance d 2 of d(n) is found by evaluating 2 d = E[d 2 (n)] = E h (x(n) ; ax(n ; 1)) 2i = E[x 2 (n)] ; 2aE[x(n)x(n ; 1)] + a 2 E[x 2 (n ; 1)] = 2 x ; 2a xx (1) + a 2 2 x = 2 x 1+a 2 ; 2a xx (1) where we used that the normalized autocorrelation function (Ch. 2.6.2) xx (m) = xx = xx (0) = xx = 2 x. Solution to Question (b): An extremum of 2 d is found by solving That is, the optimal value a is given by @ 2 d @a =0 @ 2 d @a =22 x (a ; xx (1)) = 0, a = xx (1) Since @ 2 2 x=@a 2 =2 2 x > 0 the extremum is a minimum. By substituting a we get: 2 d = 2 x 1+ 2 xx(1) ; 2 xx (1) xx (1) = 2 x 1 ; 2 xx(1) Solution to Question (c): 2 d < 2 x is obtained when 1 ; 2 xx(1) < 1, i.e., 2 xx(1) > 0 which always is the case except when x(n) is a white noise signal for which xx (m) = 2 x(m). Solution to Question (d): In order to study the second order prediction error d(n) =x(n) ; a 1 x(n ; 1) ; a 2 x(n ; 2) we dene two column vectors: a =(a 1 a 2 ) > x =(x(n ; 1) x(n ; 2)) > Then we express d(n) =x(n);x > a. The variance of d(n) is found by rst evaluating d 2 (n): d 2 (n) = x(n) ; x > 2 a = x 2 (n) ; 2x(n)x > a + a > xx > a 7
Performing the expectation E[] where E[d 2 (n)] = E[x 2 (n)] ; 2E[x(n)x > ]a + a > E[xx > ]a E[x(n)x > ] = (E[x(n)x(n ; 1)] E[x(n)x(n ; 2)]) = ( xx (1) xx (2)) " # " E[xx > E[x(n ; 1)x(n ; 1)] E[x(n ; 1)x(n ; 2)] xx (0) ] = = xx (1) E[x(n ; 1)x(n ; 2)] E[x(n ; 2)x(n ; 2)] xx (1) xx (0) Since xx (0) = 2 x we dene P > = E[x(n)x> ] 2 x R = E[xx> ] 2 x = =( xx (1) xx (2)) " 1 xx (1) xx (1) 1 Notice that R is positive denite, i.e., q > Rq > 0 for all q 6= 0 since q Rq > = E[q > xx > q]=e[(q > x) 2 ] > 0 q 6= 0 2 x Now we have the expression 2 d = 2 x 1 ; 2P > a + a > Ra Extremum is found by solving @ 2 d=@a = 0, i.e., # # That is the optimal a, say a,is @ 2 d @a = 2 x (;2P +2Ra) =0 a = R ;1 P Note that R ;1 exists since it is positive denite. Moreover, the optimum is a minimum since the second order derivative matrix @ 2 2 d=@a@a > = R is positive denite. By substituting the optimal value a into the expression for 2 d we get 2 d = 2 x 1 ; 2P > R ;1 P + P > R ;1 RR ;1 P = 2 x 1 ; P > R ;1 P P > R ;1 P 0 since R is positive denite and equals zero if P = 0, i.e., when xx (m) =0form>1 (white noise). Thus, except for the white noise case, 2 d < 2 x is always fullled. Further note it is possible to show P > R ;1 P 1 since 2 d 0. 8
SOLUTION TO PROBLEM 9.11 Solution to Question (a): in Fig. 9.11.1 Consider the rewritten second order SDM model shown e(n) x(n) - - H(z) - ; 6 ; 6 + + - H(z) - z ;1 - + -? d q (n) Fig. 9.11.1 where H(z) cf. Fig. P9.11 is dened by H(z) =1=(1;z ;1 ). Using the superposition principle we can write: That is, D q (z) = D q (z) =;D q (z)h(z)z ;1 (1 + H(z)) + H 2 (z)z ;1 (z)+e(z) H 2 (z)z ;1 1+H(z)z ;1 (1 + H(z)) (z)+ 1 1+H(z)z ;1 (1 + H(z)) E(Z) By using the expression for H(z), the noise transfer function is H n (z) = and the signal transfer function is H s (z) = 1 1+H(z)z ;1 (1 + H(z)) =(1; z;1 ) 2 H 2 (z)z ;1 1+H(z)z ;1 (1 + H(z)) = z;1 Solution to Question (b): The magnitude frequency response is found by evaluating at jh n (z)j at z = e j!, i.e., jh n (!)j = 2 1 ; e ;j! = 1 ; 2e ;j! + e ;j2! = e ;j! e j! ; 2+e ;j! = j;2 + 2 cos(!)j 9
The noise magnitude responses of a rst and a second order SDM is shown in Fig. 9.11.2 4 Noise Frequency Responses 3.5 3 2.5 H n2 (f) 2 1.5 H n1 (f) 1 0.5 0 0.5 0.4 0.3 0.2 0.1 0 0.1 0.2 0.3 0.4 0.5 f Fig. 9.11.2 The 6 db dierence is due to an extra zero for the 2nd order system. Solution to Question (c): Using the fact that the quantization noise is white, it has the power spectral density S e (F )=e=f 2 s where F s is the sampling frequency and e 2 is the noise power. Using Eq. (9.2.19) where B is the bandwidth of the signal x a (t), we get 2 n = Z B ;B jh n (F=F s )j 2 S e (F ) df Z = 4 2 B e (;1 + cos(2f=f s )) 2 df F s ;B Z 2B=Fs = 22 e (;1 + cos(!)) 2 d! ;2B=F s = 2 " 3! 2 e 2 + sin(2!) # 2B=Fs ; 2sin(!) 4 ;2B=F s = 2 " 6B 2 e + sin(4b=f s) ; 4 sin(2b=f s ) F s 2 Taylor series expansion of sin(x) = x ; x 3 =3! + x 5 =5! for x 1 corresponding to F s B gives: 2 n 4 e 2 2B 5 5 F s A doubling of F s gives a reduction of n 2 by a factor of 32 which corresponds to approx. 15 db. # 10
SOLUTION TO PROBLEM 9.12 Given x(n) = cos(2n=n), n =0 1 N; 1. The signal is reconstructed through an ideal D/A converter with sampling interval T corresponding to a sampling frequency F s =1=T. Solution to Question (a): In general, cf. Ch. 4.2, a periodic digital signal has normalized frequency components at f = k=n, k =0 1 N;1, and consequently frequency components at F = kf s =N. A cosine has spectral components for k =1 and k = N ; 1only. Thus, F 0 = F s =N. Solution to Question (b): If F s is xed and we only use the given lookup table, the only possibility isto sample x(n). Downsampling a discrete-time signal with a factor of D is equivalent to x sam (n) =x(n) 1 q=;1 (n ; qd) The spectrum is found by (see e.g., Ch. 10 or the textbooks in signal analysis) sam (f) = 1 D D;1 q=0 (f ; q=d) The spectrum of the signal x(n) considered as a aperiodic signal of length N can be interpreted as the corresponding period signal multiplied with a square wave signal of length N. Thus the spectrum is the convolution of the spectrum of the square wave signal and the cosine signal: (f) = sin nfn sin f e;jf(n;1) ((f ; 1=N)=2+(f +1=N)=2) The spectrum is (1=N) = (;1=N) = 1=2 and has zeros at f = k=n k 6= 1. The sampled signals spectrum is a replication of (f) with q=d. Thus if D is a divisor in N, say N = KD, sam (f) =1=D for f =1=N + q=d =(1+qK)=N, q = 0 1 D;1 and zero for all other multiples of 1=N. The innitely replicated signal is forming a periodic signal with frequencies at k =1 1+K 1+2K 1+(D;1)K and k = ;1+K ;1+2K ;1+DK. Changing to the new sampling frequency 1=D gives components at D=N corresponding to F 0 = DF s =N. The number of possible frequencies is thus the number of all possible products of prime factors in N. If e.g., N =12=2 2 3thepossible D 2f2 3 4 6g. If D is not a divisor in N then sam (f) willhave non-zero values for most multiples of 1=N thus the replicated signal is not a cosine. This is shown in the following Figures 9.12.1{4. 11
0.6 Original Signal, N=14 0.5 0.4 (k) 0.3 0.2 0.1 0 0 2 4 6 8 10 12 k Fig. 9.12.1 0.3 Sampled Signal (zeros incl.), N=14, D=2 0.25 0.2 (k) 0.15 0.1 0.05 0 0 2 4 6 8 10 12 k Fig. 9.12.2 12
0.6 Sampled Signal, N=14, D=2 0.5 0.4 (k) 0.3 0.2 0.1 0 0 1 2 3 4 5 6 k Fig. 9.12.3 0.6 Sampled Signal, N=14, D=4 0.5 0.4 (k) 0.3 0.2 0.1 0 0 0.5 1 1.5 2 2.5 3 k Fig. 9.12.4 13
SOLUTION TO PROBLEM 5.20 Solution to Question (a): (k) DFT! N x(n) where N is an even number and x(n) fulll the symmetry property: x(n + N=2) = ;x(n) n =0 1 N=2 ; 1 Recall that W N = e ;j2=n. By evaluating (k) we get: (k) = = = = = N;1 N=2;1 N=2;1 N=2;1 N=2;1 x(n)w kn N x(n)w kn N + N;1 n=n=2 N=2;1 x(n)w kn N + N=2;1 x(n)w kn N + x(n)w kn N x(n + N=2)W k(n+n=2) N ;x(n)w kn=2 N W kn N h x(n)+(;1) k+1 x(n) i W kn N Here we used the fact that W kn=2 N = e ;jk = (;1) k. Now for k = 2k 0, k 0 = 0 1 N=2 ; 1 we have: x(n)+(;1) k+1 x(n) 0, thus (2k 0 )=0. Solution to Question (b): Evaluating the odd harmonics we get: (2k 0 +1) = = = N=2;1 N=2;1 N=2;1 h x(n)+(;1) 2k 0 +2 x(n) i W (2k0 +1)n N [2x(n)W n N] W 2k0 N [2x(n)W n N] W k0 N=2 That is, (2k 0 +1) DFT! N=2 y(n) where y(n) =2x(n)W n N, n =0 1 N=2 ; 1. 14