to accompany Digital Signal Processing: A …...Digital Signal Processing: A Computer-Based Approach...

35
Not for sale. 1 SOLUTIONS MANUAL to accompany Digital Signal Processing: A Computer-Based Approach Fourth Edition Sanjit K. Mitra Prepared by Chowdary Adsumilli, John Berger, Marco Carli, Hsin-Han Ho, Rajeev Gandhi, Martin Gawecki, Chin Kaye Koh, Luca Lucchese, Mylene Queiroz de Farias, and Travis Smith Copyright © 2011 by Sanjit K. Mitra. No part of this publication may be reproduced or distributed in any form or by any means, or stored in a database or retrieval system, without the prior written consent of Sanjit K. Mitra, including, but not limited to, in any network or other electronic Storage or transmission, or broadcast for distance learning.

Transcript of to accompany Digital Signal Processing: A …...Digital Signal Processing: A Computer-Based Approach...

Page 1: to accompany Digital Signal Processing: A …...Digital Signal Processing: A Computer-Based Approach Fourth Edition Sanjit K. Mitra Prepared by Chowdary Adsumilli, John Berger, Marco

Not for sale. 1

SOLUTIONS MANUAL to accompany

Digital Signal Processing: A Computer-Based Approach

Fourth Edition

Sanjit K. Mitra

Prepared by

Chowdary Adsumilli, John Berger, Marco Carli, Hsin-Han Ho, Rajeev Gandhi, Martin Gawecki, Chin Kaye Koh,

Luca Lucchese, Mylene Queiroz de Farias, and Travis Smith

Copyright © 2011 by Sanjit K. Mitra. No part of this publication may be reproduced or distributed in any form or by any means, or stored in a database or retrieval system, without the prior written consent of Sanjit K. Mitra, including, but not limited to, in any network or other electronic Storage or transmission, or broadcast for distance learning.

Page 2: to accompany Digital Signal Processing: A …...Digital Signal Processing: A Computer-Based Approach Fourth Edition Sanjit K. Mitra Prepared by Chowdary Adsumilli, John Berger, Marco

Not for sale. 2

Chapter 2 2.1 Using Eq. (2.9), we get: (a)

x1 1 = 4.2, x1 2 =13.1495, x1 ∞ =10.1 (b)

x2 1 = 4.8, x2 2 =18.2557, x2 ∞ =12.01 2.2 To show this, we start with the definitions from Eq. (2.9) and square them:

x 22 = x[n] 2

n=−∞

∑ ≤ x[n]n=−∞

∑⎛

⎝ ⎜ ⎜

⎠ ⎟ ⎟

2

= x 12.

The middle inequality is a generalization of the triangle inequality. We can take square roots of both sides of this result, because everything within the equations is positive, getting:

x 2 ≤ x 1. 2.3 (a)

c[n] = x[n + 3] = {2 0 −1 6 −3 2 0}, − 6 ≤ n ≤ 0. (b)

d[n] = y[n − 2] = {8 2 −7 −3 0 1 1}, − 3 ≤ n ≤ 3. (c)

e[n] = x[−n] = {0 2 −3 6 −1 0 2}, − 3 ≤ n ≤ 3. (d)

u[n] = {8, 2, −7, −3, 0, 1, 1, 0, 2, 0, −1, 6, −3, 2, 0}, − 8 ≤ n ≤ 6. (e)

v[n] = {−8, 4, −42, −18}, − 2 ≤ n ≤1. (f)

s[n] = y[n + 4] − w[n − 3] = {−3 −6 1 2 2 −4 −8 −3 0 1 1}, − 5 ≤ n ≤ 5. (g)

r[n] = 3.9 × y[n] = {−7.8 −3.9 0 3.9 7.8 11.7 15.6}, − 5 ≤ n ≤1. 2.4 (a) The structure of Figure P2.1(a) is a cascade connection of two second-order structures.

Reversing their order we arrive at the equivalent representation shown below:

y[n]x[n] +

+d_ 1

d_ 2

z 1_

z 1_

+

+

p0

p1

p2

z 1_

z 1_

v[n]

Page 3: to accompany Digital Signal Processing: A …...Digital Signal Processing: A Computer-Based Approach Fourth Edition Sanjit K. Mitra Prepared by Chowdary Adsumilli, John Berger, Marco

Not for sale. 3

Analyzing the first section we obtain

v[n] = p0x[n]+ p1x[n −1]+ p0x[n − 2]. Analyzing the second section we arrive at

y[n] = v[n] − d1y[n −1] − d2y[n − 2], or equivalently

v[n] = y[n]+ d1y[n −1]+ d2y[n − 2]. Substituting the expression for v[n] derived from the analysis of the first section we arrive at the input-output relation of the structure of Figure 2.1(a):

y[n]+ d1y[n −1]+ d2y[n − 2] = p0x[n]+ p1x[n −1]+ p2x[n − 2]. (b) The structure of Figure 2.1(b) is precisely the figure shown in the solution of Part (a)

given above. Hence, the input-output relation of the structure of Figure 2.1(b) is also:

y[n]+ d1y[n −1]+ d2y[n − 2] = p0x[n]+ p1x[n −1]+ p2x[n − 2]. (c) Figure 2.1(c) with internal variables labeled is shown below:

Analyzing the above figure we arrive at

u[n] = h[0](x[n]+ β11x[n −1]+ β21x[n − 2]),

v[n] = u[n]+ β12u[n −1]+ β22u[n − 2],

y[n] = v[n]+ β13v[n −1]+ β23v[n − 2]. Substituting the expression for v[n] in the last equation we arrive at

y[n] = (u[n]+ β12u[n −1]+ β22u[n − 2])+ β12(u[n −1]+ β12u[n − 2]+ β22u[n − 3])

+ β23(u[n − 2] + β12u[n − 3] + β22u[n − 4])

= u[n]+ (β12 + β13)u[n −1]+ (β22 + β12β13 + β23)u[n − 2]

+ (β13β22 + β23β12)u[n − 3] + β23β22u[n − 4]. Finally, substituting the expression for u[n] from the first equation in the above equation and after some algebra we arrive at the input-output relation of the structure of Figure 2.1(c):

y[n] = h[0] x[n]+ (β12 + β11 + β13)x[n −1]( )

+ h[0] β22 + β11β12 + β21 + β12β13 + β11β13 + β23( )x[n − 2]

+ h[0] β11β22 + β21β12 + β22β13 + β11β12β13 + β21β13 + β12β23 + β11β23( )x[n − 3]

+ h[0] β21β22 + β11β22β13 + β11β22β13 + β21β12β13 + β22β23 + β11β12β23 + β21β23( )x[n − 4]

+ h[0] β21β22β13 + β11β22β23 + β21β12β23( )x[n − 5]

+ h[0] β21β22β23( )x[n − 6].

(d) Figure 2.1(d) with internal variables labeled is shown below:

h[0]

z 1_

z 1_+

+z 1_

z 1_+

+z 1_

z 1_+

+

11!

23!

13!12!

22!21!

x[n] y[n]u[n] v[n]

Page 4: to accompany Digital Signal Processing: A …...Digital Signal Processing: A Computer-Based Approach Fourth Edition Sanjit K. Mitra Prepared by Chowdary Adsumilli, John Berger, Marco

Not for sale. 4

Analyzing the above figure we arrive at

a[n] = h[0](x[n]+ x[n − 6]),

b[n] = h[1](x[n −1]+ x[n − 5]),

c[n] = h[2](x[n − 2]+ x[n − 4]),

d[n] = h[3]x[n − 3]. We thus have

y[n] = a[n]+ b[n]+ c[n]+ d[n]

= h[0](x[n]+ x[n − 6]) + h[1](x[n −1]+ x[n − 5])

= h[2](x[n − 2]+ x[n − 4]) + h[3]x[n − 3]. 2.5 Let x[n] and h[n] represent a length-M and a length-N sequence, respectively. From Eq.

(2.20a) we thus have

y[n] = x[n]O* h[n] = x[k]h[n − k]k=0

M −1∑ . The first non-zero term of the

convolution sum is

y[0] = x[0]h[0] and the last non-zero term is

y[M + N − 2] = x[M −1]h[N −1]. Thus the length of y[n] is

M + N −1. 2.6 The length of

x[n]O* y[n] = u[n] is

M + N −1. Thus the length of

u[n]O* w[n] = (x[n]O* y[n])O* w[n] is

(M + N −1) + L −1 = M + N + L − 2.

2.7 (a) Let s[n] be the signal in the middle of the structure. Then:

s[n] = x[n] − d1x[n −1] − d2x[n − 2]. We can see that:

y[n] = p0s[n]+ p1s[n −1]+ p2s[n − 2] . Putting these together, we get:

y[n] = p0 x[n] − d1x[n −1] − d2x[n − 2]( ) + p1 x[n −1] − d1x[n − 2] − d2x[n − 3]( ) + p2 x[n − 2] − d1x[n − 3] − d2x[n − 4]( ) = p0x[n] + (p1 − d1)x[n −1] + (p2 − d1 − d2)x[n − 2] − (d1 + d2)x[n − 3] − d2x[n − 4].

(b) Again, if we let s[n] be the signal in the middle of the structure, then:

s[n] = p0x[n]+ p1x[n −1]+ p2x[n − 2].

z 1_

+

h[0] h[1] h[2] h[3]

z 1_ z 1_ z 1_

z 1_z 1_

+

+ ++

+x[n]

y[n]b[n]a[n] c[n] d[n]

Page 5: to accompany Digital Signal Processing: A …...Digital Signal Processing: A Computer-Based Approach Fourth Edition Sanjit K. Mitra Prepared by Chowdary Adsumilli, John Berger, Marco

Not for sale. 5

We can see that:

y[n] = s[n] − d1y[n −1] − d2y[n − 2]. Combining the above two equations we get:

y[n] = p0x[n]+ p1x[n −1]+ p2x[n − 2] − d1y[n −1] − d2y[n − 2]. (c) If we let s[n] and t[n] represent the signals past each feed-forward component, then:

s[n] = h[0] x[n]+ β11x[n −1]+ β21x[n − 2]( ),

t[n] = s[n]+ β12s[n −1]+ β22s[n − 2],

y[n] = t[n]+ β13t[n −1]+ β23t[n − 2]. Substituting the top two equations into the last equation, we get:

y[n] = s[n]+ β12s[n −1]+ β22s[n − 2]( ) + β13 s[n −1]+ β12s[n − 2]+ β22s[n − 3]( )

+β23 s[n − 2]+ β12s[n − 3]+ β22s[n − 4]( )

= h[0] x[n]+ β11x[n −1]+ β21x[n − 2]( ) + β12h[0] x[n −1]+ β11x[n − 2]+ β21x[n − 3]( )+β22h[0] x[n − 2]+ β11x[n − 3]+ β21x[n − 4]( ) + β13h[0] x[n −1]+ β11x[n − 2]+ β21x[n − 3]( )+β13β12h[0] x[n − 2]+ β11x[n − 3]+ β21x[n − 4]( ) + β13β22h[0] x[n − 3]+ β11x[n − 4]+ β21x[n − 5]( )+β23h[0] x[n − 2]+ β11x[n − 3]+ β21x[n − 4]( ) + β23β12h[0] x[n − 3]+ β11x[n − 4]+ β21x[n − 5]( )+β23β22h[0] x[n − 4]+ β11x[n − 5]+ β21x[n − 6]( ),

which leads to:

y[n] = h[0]x[n] + h[0] β11 + β12 + β13( )x[n −1] + h[0] β21 + β12β11 + β22 + β11β13 + β12β13( )x[n − 2]

+ h[0] β12β21 + β11β22 + β13β21 + β11β12β13 + β13β22 + β11β23 + β12β23( )x[n − 3]

+ h[0] β22β21 + β12β13β21 + β11β13β22 + β11β12β23 + β22β23( )x[n − 4]

+ h[0] β21β13β22 + β21β12β23 + β22β23β11( )x[n − 5] + h[0]β21β22β23x[n − 6]

(d) Let

s0[n], s1[n], and

s2[n] denote the outputs of the three adders:

y[n] = h[0]s0[n]+ h[1]s1[n]+ h[2]s2[n]+ h[3]x[n − 3],

s0[n] = x[n]+ x[n − 6],s1[n] = x[n −1]+ x[n − 5],s2[n] = x[n − 2]+ x[n − 4].

Combining the above, we get

y[n] = h[0] x[n]+ x[n − 6]( ) + h[1] x[n −1]+ x[n − 5]( ) + h[2] x[n − 2]+ x[n − 4]( ) + h[3]x[n − 3]

Page 6: to accompany Digital Signal Processing: A …...Digital Signal Processing: A Computer-Based Approach Fourth Edition Sanjit K. Mitra Prepared by Chowdary Adsumilli, John Berger, Marco

Not for sale. 6

= h[0]x[n]+ h[1]x[n −1]+ h[2]x[n − 2]+ h[3]x[n − 3]+ h[2]x[n − 4]+ h[1]x[n − 5]+ h[0]x[n].

2.5

y[n] = x[n − k]h[k]k=−∞

∞∑ . Since

h[k] is of length and defined for

0 ≤ k ≤ M −1, the

convolution sum reduces to

y[n] = x[n − k]h[k]k=0(M −1)∑ . Thus,

y[n] will be nonzero for all those values of and for which

n − k satisfies

0 ≤ n − k ≤ N −1. The minimum value of

n − k is 0, and occurs for the lowest at

n = 0 and

k = 0. The maximum value of

n − k = N −1 and occurs for maximum value of at

M −1. Thus

n − k = M −1and

n = N + M − 2. Hence the total number of nonzero samples

= N + M −1. 2.6 Let X be the length of the convolution sum of x[n] and y[n], which are of length N and M,

respectively. From Problem 2.5, we know that X

= N + M −1.The length of the convolution of x[n] with w[n], is thus

X + L −1 or

N + M + L − 2. 2.7 To show that the two convolutions are equal, we simply evaluate both convolution sums:

x1[k]x2[n − k]k=−∞

∞∑ = 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1{ }, 0 ≤ n ≤15,

x3[k]x4[n − k]k=−∞

∞∑ = 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1{ }, 0 ≤ n ≤15.

2.8 (a)

x1[k]x1[n − k]k=−∞

∞∑ = 1, −2, 3, −2, 1{ }, − 2 ≤ n ≤ 2.

(b)

x2[k]x2[n − k]k=−∞

∞∑ = 1, −2, 1, 2, −4, 2, 1, −2, 1{ }, 0 ≤ n ≤ 8.

(c)

x3[k]x3[n − k]k=−∞

∞∑ = 1, −4, 4, 4, −10, 4, 4, −4, 1{ }, − 6 ≤ n ≤ 2.

2.9 (a) Given x[n] and y[n] from Problem 2.3, their convolution sum u[n] is given by:

u[n] = x[k]y[n − k]k=−∞

= 16 4 −22 40 −5 −27 9 −6 −1 3 −1 2 0{ }, − 8 ≤ n ≤ 4.

(b) Given x[n] and w[n] from Problem 2.3, their convolution sum v[n] is given by:

v[n] = x[k]w[n − k]k=−∞

∑ = 6 12 −5 16 40 −8 23 22 21 0 9 2 0{ }, − 5 ≤ n ≤ 7.

(c) Given w[n] and y[n] from Problem 2.3, their convolution sum g[n] is given by:

g[n] = w[k]y[n − k]k=−∞

= 24 54 −17 −37 41 52 −19 −53 −24 5 12 7 1{ }, − 7 ≤ n ≤ 5.

Page 7: to accompany Digital Signal Processing: A …...Digital Signal Processing: A Computer-Based Approach Fourth Edition Sanjit K. Mitra Prepared by Chowdary Adsumilli, John Berger, Marco

Not for sale. 7

2.10 First, express y[n] as a convolution and then rewrite the convolution of v[n] as a function

of x:

y[n] =x1[n]O* x2[n] = x1[n − k]x2[k].k=−∞

Now:

v[n] =x1[n − N1]O* x2[n − N2] = x1[n − N1 − k]x2[k − N2].k=−∞

Let

k − N2 = m. Then:

v[n] = x1[n − N1 − N2 −m]x2[m]m=−∞

∑ = y[n − N1 − N2].

2.11 Using the same steps as in the solution of Problem 2.10, we first express g[n] as a

convolution and then reevaluate h[n] in terms of these convolution sums:

g[n] = x1[n]O* x2[n]O* x3[n] = y[n]O* x3[n] where

y[n] = x1[n]O* x2[n].

Now:

v[n] = x1[n − N1]O* x2[n − N2].

Define

h[n] = v[n]O* x3[n − N3]. Then from the solution of Problem 2.10,

v[n] = y[n − N1 − N2]. Hence:

h[n] = y[n − N1 − N2]O* x3[n − N3].

Therefore, making use of the solution of Problem 2.10 again we get:

h[n] = y[n − N1 − N2 − N3]. 2.12 Two results are needed for this problem:

Length of Sequence = Max – Min + 1 Length of Convolution =

L1 +L2−1. (a) The sequence

y1[n], formed from the convolution of h[n] with itself, will have a length

(N + M +1) + (N + M +1) −1, or

2N + 2M +1. To find the range of indices over which the convolution will have nonzero values, it is necessary to think about the nature of the convolved signals. Both of them, since they are the same, have nonzero values on either side of the origin, which will still be true after one of them is time reversed within the convolution sum formula. Thus, if the original has values in the range

[−M,N], then the time reversed version will have values in the range

[−N,M]. The first left-shift at which point these two overlap will occur at (–2M), since the time-reversed version must be shifted left M points to have the negative portions overlap, and then again by M points to be outside of the range of overlap. A similar principle applies to the right-most region of overlap. The time-reversed signal must be shifted by N twice to the right to be just outside of the region of overlap, so that the right-most boundary of the resulting convolution is (2N). Therefore the convolution is nonzero in the range [–2M, 2N]. Note that these boundaries also give the correct length of the resulting signal: (2N) – (–2M) + 1 = 2N + 2M + 1.

Page 8: to accompany Digital Signal Processing: A …...Digital Signal Processing: A Computer-Based Approach Fourth Edition Sanjit K. Mitra Prepared by Chowdary Adsumilli, John Berger, Marco

Not for sale. 8

(b) The sequence y2[n], formed from the convolution of g[n] with itself, will have length

Although the signal is no longer on both sides of the origin, when the time-reversed version is generated, there will be one copy whose values are in the range [K,N] and another whose values are in the range [–N, –K]. In order to get the first point of overlap, the time-reversed version must be shifted to the right by 2K points, giving the left-most boundary of the convolution sum. The right-most boundary is similarly calculated by noting that the signal must be shifted by 2N points. Thus, the convolution will be nonzero in the range [2K, 2N].

Note, again, that these boundaries also give the correct length: 2N – ( –2K) + 1 = 2N – 2K + 1. (c) The sequence y3[n], formed from the convolution of w[n] with itself, will have length

(L – R) + (L – R) + 1, or 2L – 2R + 1. This situation is similar to that in part (b), except that we are dealing with the mirror image of the signal – so that the time reversed part will be in the range [R,L]. Because of the symmetry of the convolution operation, we will end up with inverted boundaries but the same length computation – the convolution will be nonzero in the range [– 2L, – 2R].

Also, these boundaries will give the correct length: (– 2R) – ( – 2L) + 1 = 2L – 2R + 1. (d) The sequence y4[n], formed from the convolution of h[n] with g[n], will have length

(N + M + 1) + (N – K + 1) – 1, or 2N + M – K + 1. To find the range of indexes, it is again instructive to think of the time-reversed version of g[n], and the points at which it stops and starts overlapping with h[n]. The left-most boundary will occur at – (M – K), while the right-most boundary will occur at 2N, so that the convolution will be nonzero in the range [– M + K, 2N].

Again, these boundaries can be used to confirm the length: 2N – (–M + K) + 1 = 2N + M – K + 1. (e) The sequence y5[n], formed from the convolution of h[n] with w[n], will have length

(N + M + 1) + (L – R + 1) – 1, or N + M + L – R + 1. The range of nonzero indexes can be found similarly to that in (d), by checking the left-most and right-most points of overlap. The resulting convolution will be nonzero in the range [–L – M, N – R].

And again, this confirms the length calculation: N – R – (–L – M) + 1 = N + M + L – R + 1. 2.13

{x[n]} = 2, −3, 4, 1[ ], −1≤ n ≤ 2 and

{h[n]} = −3, 5, −6, 4[ ], − 2 ≤ n ≤1.

Page 9: to accompany Digital Signal Processing: A …...Digital Signal Processing: A Computer-Based Approach Fourth Edition Sanjit K. Mitra Prepared by Chowdary Adsumilli, John Berger, Marco

Not for sale. 9

Thus,

y[−1] = x[−1]h[0]+ x[0]h[−1]+ x[1]h[−2]

= 2 × (−6) + (−3) × 5 + 4 × (−3) = −39. 2.14 Tthe maximum value will occur with the largest overlap during the convolution operation.

Since one sequence is 2 samples shorter than the other, there will be three possible points where all terms of the shorter sequence overlap with terms of the longer sequence. Thus, the maximum of y[n] will be at the locations

n = N − 3,N − 2,N −1 and the maximum value is

N − 2. 2.15 The convolution of a sequence of length N and a sequence of length M will produce a sequence

of length L = N + M – 1. Thus, the length of x[n] can be computed by rearranging the equation and evaluating for N = L – M + 1. Rearranging the terms of the convolution formula, we can recursively compute x[n] because successive samples of y[n] are based purely on successive coefficients of x[n]. For example, since y[0] = x[0]h[0], we can find x[0] = y[0]/h[0]. From here, we can use the following formula to compute all other terms within x[n]:

x[n] =1h[0]

y[n] − h[k]x[n − k]k=0

n−1∑

⎣ ⎢ ⎢

⎦ ⎥ ⎥ .

(a) Using the formula for the length of x[n], we get N = 8 – 4 + 1 = 4. Using the above

recursive formula for deconvolution, we arrive at

x[n] = {1 4 3 1}, 0 ≤ n ≤ 3. (b) Using the formula for the length of x[n], we get N = 5 – 3 + 1 = 3. The length of y[n] in

this problem is effectively 5, because the first term is 0. Using the above recursive formula for deconvolution, we arrive at

x[n] = {0 −3 2 2}, 0 ≤ n ≤ 3.

(c) Using the formula for the length of x[n], we get N = 9 – 5 + 1 = 5. Using the above recursive formula for deconvolution, we arrive at

x[n] = {−2 −4 0 1 −6}, 0 ≤ n ≤ 4 . The above results can be derived using the function deconv in MATLAB. 2.16 We make use of the circular shifting operation given by Eqn. (2.25). The length of {x[n]}

is 9.

(a) Thus,

{y[n]} = {〈x[n +12]〉9}. Therefore,

y[−3] = x[〈−3+12〉9] = x[〈9〉9] = x[0]. Therefore, y[–3] = – 4

(b) Thus,

{z[n]} = {〈x[n −15]〉9}. Therefore,

z[2] = x[〈2 −15〉9] = x[〈-13〉9] = x[−4]. Therefore, z[2] = – 5.

2.17 We make use of the circular shifting operation given by Eqn. (2.25). Now,

{g[n]} = −3, 0, 4, 9, 2, 0, −2, 5{ }, − 4 ≤ n ≤ 3. The length of {g[n]} is 8.

(a)

{h[n]} = {g[〈n − 5〉8]} = 2, 0, −2, 5, −3, 0, 4, 9{ }, − 4 ≤ n ≤ 3.

Page 10: to accompany Digital Signal Processing: A …...Digital Signal Processing: A Computer-Based Approach Fourth Edition Sanjit K. Mitra Prepared by Chowdary Adsumilli, John Berger, Marco

Not for sale. 10

(b)

{w[n]} = {g[〈n + 4〉8]} = 9, 2, 0, −2, 5, −3, 0, 4{ }, − 4 ≤ n ≤ 3. 2.18 Using the definition of average power (Eqn. (2.37)), the average power of the odd and

even portions of x[n] are thus given by:

P

x,even= limK→∞

12K +1

12x[n]+ 1

2x[−n]

2

n=−K

K∑ and

P

x,odd = limK→∞

12K +1

12x[n] − 1

2x[−n]

2

n=−K

K∑ . Combining the two, we get:

P P

= limK→∞

12K +1

12x[n]+ 1

2x[−n]

2+

n=−K

K∑ lim

K→∞

12K +1

12x[n] − 1

2x[−n]

2

n=−K

K∑

= limK→∞

12K +1

12x[n]+ 1

2x[−n]

2+

n=−K

K∑

12x[n] − 1

2x[−n]

2

n=−K

K∑

⎝ ⎜ ⎜

⎠ ⎟ ⎟ .

The quantity inside the parentheses is given by

12x[n]+ 1

2x[−n]

2+

n=−K

K∑

12x[n] − 1

2x[−n]

2

n=−K

K∑

=

14x2[n]+ 1

4x2[−n]+ 1

2x[n]x[−n]+ 1

2x[−n]x[n]

⎝ ⎜

⎠ ⎟

n=−K

K∑

+

14x2[n]+ 1

4x2[−n] − 1

2x[n]x[−n] − 1

2x[−n]x[n]

⎝ ⎜

⎠ ⎟

n=−K

K∑

=

14x2[n]+ 1

4x2[−n]+ 1

4x2[n]+ 1

4x2[−n]

⎝ ⎜

⎠ ⎟

n=−K

K∑ =

12x2[n]+ 1

2x2[−n]

⎝ ⎜

⎠ ⎟

n=−K

K∑

= x2[n]( )n=−K

K∑ = P

x .

2.19 The given signal is

x[n] = sin(2πkn /N), 0 ≤ n ≤ N −1.The formula for energy is given by Eqn. (2.34):

E

x= x[n] 2

n=0

N−1∑ = sin2

n=0

N−1∑ (2πkn /N)

=12 1− cos(4πkn /N)( )n=0

N−1∑ =

N2 −

12 cos(4πkn /N)n=0

N−1∑ .

Let

C = cos(4πkn /N)n=0

N−1∑ and

S = sin(4πkn /N)n=0

N−1∑ .

Then

C + jS = e− j4πkn /N

n=0

N−1∑ =

1− e− j4πkn

1− e− j4πk /N= 0. This implies C = 0

Hence E

x=N2 .

Page 11: to accompany Digital Signal Processing: A …...Digital Signal Processing: A Computer-Based Approach Fourth Edition Sanjit K. Mitra Prepared by Chowdary Adsumilli, John Berger, Marco

Not for sale. 11

2.20 Using Eqn. (2.30), the odd and even parts are determined as follows:

xev[n] =12x[n]+ x[−n][ ] and

xod [n] =12x[n] − x[−n][ ].

(a)

xev[n] = 1 1 −2 6 −2 1 1{ }, − 3 ≤ n ≤ 3,

xod [n] = 1 −1 1 0 −1 1 −1{ }, − 3 ≤ n ≤ 3.

(b)

yev[n] = 4 1 −4 −2 1 1 1 −2 −4 1 4{ }, − 5 ≤ n ≤ 5,

yod [n] = 4 1 −4 −2 −1 0 1 2 4 −1 −4{ }, − 5 ≤ n ≤ 5.

(c)

wev[n] = 1 3 5 4 −1 4 5 3 1{ }, − 4 ≤ n ≤ 4,

wod [n] = −1 −3 −2 2 0 −2 2 3 1{ }, − 4 ≤ n ≤ 4. 2.21 Using the formula for conjugate symmetric and conjugate anti-symmetric parts from Eqn.

(2.28), we determine the components as follows:

xcs[n] =12x[n]+ x *[−n][ ] and

xca[n] =12x[n] − x *[−n][ ].

(a)

x1,cs[n] = −2 + 2 j 3 − 6 j 4 3+ 6 j −2 − 2 j{ }, − 2 ≤ n ≤ 2,

x1,ca[n] = 1+ k −1− j −5 j 1− j −1+ j{ }, − 2 ≤ n ≤ 2.

(b) From the formulas for sine and cosine, we have:

x2,cs[n] =12

e j2πn / 5 + e jπn / 3( ) + e j2πn / 5 − e jπn / 3( )⎡ ⎣ ⎢

⎤ ⎦ ⎥ = cos

2πn5

⎝ ⎜

⎠ ⎟ + cos

πn3

⎝ ⎜

⎠ ⎟ ,

x2,ca[n] =12

e j2πn / 5 + e jπn / 3( ) − e j2πn / 5 − e jπn / 3( )⎡ ⎣ ⎢

⎤ ⎦ ⎥ = j sin 2πn

5⎛

⎝ ⎜

⎠ ⎟ + j sin πn

3⎛

⎝ ⎜

⎠ ⎟ .

(c) From the properties and formulas for sine and cosine:

x3,cs[n] =12

j cos 2πn7

⎝ ⎜

⎠ ⎟ − sin

2πn4

⎝ ⎜

⎠ ⎟

⎝ ⎜

⎠ ⎟ + − j cos 2πn

7⎛

⎝ ⎜

⎠ ⎟ + sin

2πn4

⎝ ⎜

⎠ ⎟

⎝ ⎜

⎠ ⎟

⎣ ⎢

⎦ ⎥ = 0,

x3,ca[n] =12

j cos 2πn7

⎝ ⎜

⎠ ⎟ − sin 2πn

4⎛

⎝ ⎜

⎠ ⎟

⎝ ⎜

⎠ ⎟ − − j cos 2πn

7⎛

⎝ ⎜

⎠ ⎟ + sin 2πn

4⎛

⎝ ⎜

⎠ ⎟

⎝ ⎜

⎠ ⎟

⎣ ⎢

⎦ ⎥

=12

j cos 2πn7

⎝ ⎜

⎠ ⎟ − sin 2πn

4⎛

⎝ ⎜

⎠ ⎟ + j cos 2πn

7⎛

⎝ ⎜

⎠ ⎟ − sin 2πn

4⎛

⎝ ⎜

⎠ ⎟

⎣ ⎢

⎦ ⎥ = j cos 2πn

7⎛

⎝ ⎜

⎠ ⎟ − sin 2πn

4⎛

⎝ ⎜

⎠ ⎟ .

2.22 Since x[n] is conjugate symmetric it satisfies the condition

x[n] = x *[−n] and since y[n] is conjugate antisymmetric it satisfies the condition

y[n] = −y *[−n].

(a)

g*[−n] = x *[−n]x *[−n] = x[n]x[n] = g[n]. Thus, g[n] is conjugate symmetric. (b)

u*[−n] = x *[−n]y *[−n] = x[n](−y[n]) = −u[n]. Thus, u[n] is conjugate antisymmetric.

Page 12: to accompany Digital Signal Processing: A …...Digital Signal Processing: A Computer-Based Approach Fourth Edition Sanjit K. Mitra Prepared by Chowdary Adsumilli, John Berger, Marco

Not for sale. 12

(c)

v *[−n] = y *[−n]y *[−n] = (−y[n])(−y[n]) = v[n]. Thus, u[n] is conjugate symmetric.

2.23 An absolutely summable sequence {x[n]} satisfies the condition

| x[n] |n=−∞

∑ < ∞ .

This implies that for each value of the index n, the sample value x[n] is a finite number. Hence, the absolute value of each sample is bounded by a finite positive number, which means that the sequence is bounded.

2.24 (a) Since is causal,

x[n] = 0, n < 0. Also,

x[−n] = 0, n > 0. From the definition of

an even sequence, we can see that xev[0] = x[0] and

xev[n] =12 x[n], n > 0.

Therefore,

Likewise, from the definition for the odd sequence, we have x[0] = 0 and

xod [n] =12 x[n], n > 0. Therefore,

x[n] =2xev[n], n > 0,0, n ≤ 0.

⎧ ⎨ ⎩

(b) Since is causal,

y[n] = 0, n < 0. Also,

y[−n] = 0, n > 0. We can express y[n] in terms of its real and imaginary parts and , which are and causal sequences, as follows:

y[n] = yre[n]+ jyim[n],

From the definition of an conjugate anti-symmetric sequence:

yca[n] =12 (y[n] − y

∗[−n]).

Hence,

yca[0] =12 (y[0] − y

∗[0]) = jyim[0] and

yca[n] =12 y[n], n > 0.

Since

yre[0] is not known,

y[n] cannot be fully recovered from

yca[n].

Likewise, from the definition of a conjugate symmetric sequence:

ycs[n] =12 (y[n]+ y

∗[−n]).

Hence:

ycs[0] =12 (y[0]+ y

∗[0]) = yre[0] and

ycs[n] =12 y[n], n > 0.

Since is not known, cannot be fully recovered from . 2.25 From Eqn. (2.44), an N-periodic extension of a signal x[n] is obtained as follows:

Therefore:

˜ y [n + N] = x[n + kN + N]k=−∞

∞∑ .

Substituting we get:

˜ y [n + N] = x[n + rN]r=−∞

∞∑ = ˜ y [n]. Hence, is a periodic

sequence with a period

2.26 (a) Consider the sequence defined by

Page 13: to accompany Digital Signal Processing: A …...Digital Signal Processing: A Computer-Based Approach Fourth Edition Sanjit K. Mitra Prepared by Chowdary Adsumilli, John Berger, Marco

Not for sale. 13

If n < 0, then k = 0 is not included in the sum and hence, x[n] = 0 for n < 0. On the other hand, for k = 0 is included in the sum, and as a result, x[n] =1 for Thus:

x[n] = δ[k]k=−∞

n∑ = 1, n ≥ 0,

0, n < 0,⎧ ⎨ ⎩

= µ[n].

(b) Since it follows that

Hence,

µ[n] − µ[n −1] = 1, n = 0,0, n ≠ 0,⎧ ⎨ ⎩

= δ[n].

2.27 (a)

x1[n] = µ[n − 3]. Hence,

x1[−n] = µ[−n − 3]. Therefore,

x1,ev[n] =12 (µ[n − 3]+ µ[−n − 3]) =

1/2, n ≥ 3,0, −2 ≤ n ≤ 2,1/2, −3 ≤ n,

⎨ ⎪

⎩ ⎪

x1,od [n] =12 (µ[n − 3] − µ[−n − 3]) =

1/2, n ≥ 3,0, −2 ≤ n ≤ 2,

−1/2, −3 ≤ n.

⎨ ⎪

⎩ ⎪

(b)

x2[n] = αnµ[n −1]. Hence,

x2[−n] = α−nµ[−n −1]. Therefore,

x2,ev[n] =12 αnµ[n −1]+α−nµ[−n −1]( ) =

12α

n , n ≥ 2,0, −1≤ n ≤1,

12α

−n , −2 ≤ n,

⎨ ⎪ ⎪

⎩ ⎪ ⎪

x2,od [n] =12 αnµ[n −1] −α−nµ[−n −1]( ) =

12α

n, n ≥ 2,0, −1≤ n ≤1,

−12α

−n, −2 ≤ n.

⎨ ⎪ ⎪

⎩ ⎪ ⎪

(c)

x3[n] = nαnµ[n +1]. Hence,

x3[−n] = −nα−nµ[−n +1]. Therefore,

x3,ev[n] =12 nαnµ[n +1]+ (−n)α−nµ[−n +1]( ) =

12nαn, n ≥ 2,

12a − 1

a⎛

⎝ ⎜

⎠ ⎟ , n =1

0, n = 0

⎪ ⎪ ⎪

⎪ ⎪ ⎪

x3,od [n] =12 nαnµ[n +1] − (−n)α−nµ[−n +1]( ) =

12nαn , n ≥ 2,

12a +

1a

⎝ ⎜

⎠ ⎟ , n =1

0, n = 0

⎪ ⎪ ⎪

⎪ ⎪ ⎪

Page 14: to accompany Digital Signal Processing: A …...Digital Signal Processing: A Computer-Based Approach Fourth Edition Sanjit K. Mitra Prepared by Chowdary Adsumilli, John Berger, Marco

Not for sale. 14

(d)

x4[n] = α n . Hence,

x4[−n] = α −n = α n = x4[n]. Therefore,

x4,ev[n] =12 (x4[n]+ x4[−n]) =

12 (x4[n]+ x4[n]) = x4[n] = α n

x4,od [n] =12 (x4[n] − x4[−n]) =

12 (x4[n] − x4[n]) = 0.

2.28 (a)

x[n] = Aα |n| where A and α are complex numbers with

α <1. Because

n is always a positive number and

α <1, any positive exponential power of α will be smaller than 1. Hence, x[n] is a bounded sequence.

(b)

h[n] =12n

µ[n] is a causal sequence starting with a value h[0] = 1, and for all n > 0,

the amplitude of the sample values is less than 1. Hence, h[n] is a bounded sequence.

(c)

y[n] = αnµ[n −1], α <1 is a causal sequence starting with a value y[0] = 0, and for all n > 0, the amplitude of the sample values is less than 1. Hence, y[n] is a bounded sequence.

(d)

g[n] = 4ne jωonµ[n] is a causal complex-valued sequence. Its amplitude for all n> 0 is 4n and as

n→∞ , the amplitude approaches

∞ . Thus g[n] is not bounded.

(e)

w[n] = 3cos((ωo)2n) is a two-sided sequence. As

cos((ωo)2n) is a sinusoidal

sequence with values between

−1 and

+1 for all values of n, w[n] is a bounded sequence (f)

v[n] = (1− 1n2)µ[n −1] is a causal sequence starting with a value v[0] = 0, and for all n

> 0, the amplitude of the sample values is less than 1. Hence, v[n] is a bounded sequence.

2.29

x[n] =(−1)n+1

nµ[n −1]. Now

x[n]n=−∞

∑ =(−1)n+1

nn=1

∑ =1nn=1

∑ = ∞, hence x[n] is not

absolutely summable.

2.30 (a)

x1[n] = αnµ[n −1]. Now,

x2[n]n=−∞

∑ = αn

n=1

∑ = α n

n=1

∑ =α

1− α< ∞, since

Hence,

x1[n] is absolutely summable.

(b)

x2[n] = αnµ[n −1]. Here,

x2[n]n=−∞

∑ = nαn

n=1

∑ = nα n

n=1

(1− α )2< ∞, since

Hence,

x2[n] is absolutely summable.

Page 15: to accompany Digital Signal Processing: A …...Digital Signal Processing: A Computer-Based Approach Fourth Edition Sanjit K. Mitra Prepared by Chowdary Adsumilli, John Berger, Marco

Not for sale. 15

(c)

x3[n] = n2αnµ[n −1]. In this case,

x3[n]n=−∞

∑ = n2αn

n=1

∑ = n2

n=1

∑ α n

= α + 22 α 2 + 32 α 3 + 42 α 4 +…

= (α + α 2 + α 3 + α 4 +…) + 3(α 2 + α 3 + α 4 +…)

+ 5(α 3 + α 4 + α 5 +…) + 7(α 4 + α 5 + α 6 +…) + ...

1− α+3α 2

1− α+5α 3

1− α+7α 4

1− α+…

=1

1− α(2n −1)α n

n=1

∑⎛

⎝ ⎜ ⎜

⎠ ⎟ ⎟ =

11− α

2 nα n

n=1

∑ − α n

n=1

∑⎛

⎝ ⎜ ⎜

⎠ ⎟ ⎟

=1

1− α2α

(1− α )2−

α1− α

⎝ ⎜ ⎜

⎠ ⎟ ⎟

=α (1+ α )(1− α )3

< ∞.

Hence,

x3[n] is absolutely summable.

2.31 (a)

xa[n] =14n

µ[n]. Here,

xa[n]n=−∞

∑ =14nn=0

∑ =14nn=0

∑ =1

1− 14=43

< ∞.

Hence,

xa[n] is absolutely summable.

(b)

xb[n] =1

(n + 2)(n + 3)µ[n]. Here,

xb[n]n=−∞

∑ =1

(n + 2)(n + 3)n=0

=1

n + 2−

1n + 3

⎝ ⎜

⎠ ⎟

n=0

=12−13

⎝ ⎜

⎠ ⎟ +

13−14

⎝ ⎜

⎠ ⎟ +

14−15

⎝ ⎜

⎠ ⎟ +…

=12

< ∞.

Hence

xb[n] is absolutely summable. 2.32 First, we show that an absolutely summable sequence has finite energy. A sequence x[n]

is absolutely summable if

x[n]n=−∞

∑ < ∞. Using the Schwartz inequality we can write:

x[n] 2

n=−∞

∑ ≤ x[n]n=−∞

∑⎛

⎝ ⎜ ⎜

⎠ ⎟ ⎟ x[n]n=−∞

∑⎛

⎝ ⎜ ⎜

⎠ ⎟ ⎟ < ∞.

Hence, an absolutely summable sequence is square summable and has thus finite energy. To show that a finite energy sequence may not be absolutely summable, we need to find

only one example of where this is the case. Consider the sequence:

x[n] =1n

µ[n −1].

Page 16: to accompany Digital Signal Processing: A …...Digital Signal Processing: A Computer-Based Approach Fourth Edition Sanjit K. Mitra Prepared by Chowdary Adsumilli, John Berger, Marco

Not for sale. 16

We will demonstrate that this sequence has finite energy, but does not converge. Finite

energy is analogous to being square summable, and we will use the integral test of sequence convergence to prove both that x[n] is square summable but not absolutely summable.

The integral test for convergence can be stated as follows: let

an = f (x) be a continuous,

positive and decreasing function for all x ≥ 1. Then the series

ann=1∞∑ and the integral

f (x)dx1

∫ either both converge or both diverge.

First, to show that x[n] is square summable, we let

an =1/n2, and determine the

convergence of the integral:

1x21

∫ dx = −1x

⎝ ⎜

⎠ ⎟ 1

= −1∞

+1 =1.

Hence,

1n2n=1

∞∑ also converges, and

x[n] =1n

µ[n −1] is square-summable.

Second, to show that x[n] is not absolutely summable, we let

an =1/n and determine the

divergence of the integral:

1x

1

∫ dx = (ln x)1∞ = ∞ − 0 = ∞ .

As a result,

x[n] =1n

µ[n −1] is not absolutely summable. 2.33 The integral test for convergenece is usde to show the divergence of the absolute

summation of

x1[n]. Let

an =1/n and determine the divergence of the integral:

1x

1

∫ dx = (ln x)1∞ = ∞ − 0 = ∞ . This implies that the absolute summation:

x[n]n=−∞

∑ = 1n

n=1

∑ = ∞ . Therefore,

x1[n] is not absolutely summable.

2.34 To show square-summability, we evaluate

x2[n]2

n=−∞

∑ =cosωcnπn

⎝ ⎜

⎠ ⎟ 2

n=1

∑ ≤1

π 2n2n=1

∑ .

Since

1n2

n=1

∑ =π2

6 ,

cosωcnπn

⎝ ⎜

⎠ ⎟ 2

n=1

∑ ≤16

. Therefore

x2[n] is square-summable.

Using the integral test for convergence, we can show

x2[n] is not absolutely summable. The integral test relates the convergence or divergence of

an = f (x) , which is defined to be a continuous, positive and decreasing function for all x ≥ 1. Since

x2[n] meets these criterian, we can substitute f(x) into an integral and check for convergence or divergence:

Page 17: to accompany Digital Signal Processing: A …...Digital Signal Processing: A Computer-Based Approach Fourth Edition Sanjit K. Mitra Prepared by Chowdary Adsumilli, John Berger, Marco

Not for sale. 17

cosωc xπx1

∫ dx =1π⋅

cosωc xπx

cosωc x⋅

cos(t)dtt

ωc x

1

which diverges implying the divergence of

cosωcnπnn=1

∑ . Hence,

x2[n] is not absolutely summable.

2.35 (a)

xa[n] = Aαµ[n]. Here, E

xa = xa[n]2

n=−∞

∑ = A2 α2n

n=0

∑ =A2

1−α2.

(b)

xb[n] =1n2

µ[n −1]. Here, E

xb xb[n]2

n=−∞

∑ = 1n2n=1

∑ =1n4

n=1

=π4

90.

2.36 (a) E

x1= x1[n]2

n=−∞

∑ = 1n=−∞

∑ = ∞.

P

x1= limK→∞

12K+1 x1[n]

2

n=−K

K∑ = lim

K→∞

12K +1

(2K +1) =1.

(b) E

x2 = x2[n]2

n=−∞

∑ = 1n=0

∑ = ∞.

P

x2 = limK→∞

12K +1

x2[n]2

n=−K

K∑ = lim

K→∞

12K +1

1n=0

K∑ = lim

K→∞

K +12K +1

=12.

(c) E

x3= x3[n]2

n=−∞

∑ = n2

n=0

∑ = ∞.

P

x3= limK→∞

12K +1

x3[n]2

n=−K

K∑ = lim

K→∞

12K +1

n2

n=1

K∑

= limK→∞

K(K +1)(2K +1)6

= ∞.

(d) E

x4 = x4[n]2

n=−∞

∑ = A0ejω0n

2

n=−∞

∑ = A02

n=−∞

∑ = ∞.

P

x4 = limK→∞

12K +1

x4[n]2

= limK→∞

12K +1

A0ejω0n

2

n=−K

K∑

n=−K

K∑

= limK→∞

12K +1

A02

n=−K

K∑ = lim

K→∞

12K +1

⋅ A02(2K +1) = A0

2.

(e) E

x5= x5[n]2

n=−∞

∑ = Acos 2πnM

+ φ⎛

⎝ ⎜

⎠ ⎟ 2

n=−∞

∑ = ∞.

Page 18: to accompany Digital Signal Processing: A …...Digital Signal Processing: A Computer-Based Approach Fourth Edition Sanjit K. Mitra Prepared by Chowdary Adsumilli, John Berger, Marco

Not for sale. 18

P

x5=1M

x5[n]2

n=0

M −1∑ =

1M

Acos 2πnM

+ φ⎛ ⎝ ⎜ ⎞

⎠ ⎟ 2

n=0

M −1∑ =

1M⋅A2

2cos 4πn

M+2φ

⎛ ⎝ ⎜ ⎞

⎠ ⎟ +1

⎛ ⎝ ⎜

⎞ ⎠ ⎟

n=0

M −1∑ .

Let

C = cos 4πnM

+ 2φ⎛ ⎝ ⎜ ⎞

⎠ ⎟

n=0

M −1∑ and

S = sin 4πnM

+ 2φ⎛ ⎝ ⎜ ⎞

⎠ ⎟

n=0

M −1∑ .

Then

C + jS = ej 4πn

M+2φ( )

n=0

M −1∑ = e j2φ e j4πn /M

n=0

M −1∑ = e j2φ ⋅ 1− e j4π

1− e j4π /M= 0.

Therefore P

x5 =1M⋅A2

21

n=0

M −1∑ =

A2

2.

2.37 In general, for an N-periodic extension of a sequence, we use Eq. (2.44) to generate the

sequence and then determine the period of the new sequence based on the length of the original and N. If the length is smaller than N, then the sequence has period N. If the length of the original is greater than N, then the repetitions will force periodicity with a period of N. Thus any N-periodic extension will be periodic with period N. To find a sample period of the new sequence, we simply add up neighboring overlapping components and look at the range of one period.

(a) N = 6, and for each of the sequences, we can write the periodic extension as follows:

˜ x p[n] = x[n + k6]n=−∞

∑ .

˜ y p[n] = y[n + k6]n=−∞

∑ .

˜ w p[n] = w[n + k6]n=−∞

∑ .

The portion of

˜ x p[n] in the range 0 ≤ n ≤ 5 is given by:

x[n − 6]+ x[n]+ x[n + 6] = {0 0 0 0 0 0}+{6 −3 2 0 0 0}+{0 0 0 2 0 −1}

Hence, one period of

˜ x p[n] is given by

{6 −3 2 2 0 −1}, 0 ≤ n ≤ 5. The portion of

˜ y p[n] in the range 0 ≤ n ≤ 5 is given by:

y[n − 6]+ y[n]+ y[n + 6] = {0 0 0 0 0 0}+{1 1 0 0 0 0}+{0 8 2 −7 −3 0}.

Hence, one period of is given by

{1 9 2 −7 −3 0},0 ≤ n ≤ 5 The portion of

˜ w p[n] in the range 0 ≤ n ≤ 5 is given by:

w[n − 6] + w[n] + w[n + 6] = {0 0 0 0 0 0} +{−1 2 6 6 1 0} +{0 0 0 0 3 6}.

Page 19: to accompany Digital Signal Processing: A …...Digital Signal Processing: A Computer-Based Approach Fourth Edition Sanjit K. Mitra Prepared by Chowdary Adsumilli, John Berger, Marco

Not for sale. 19

Hence, one period of

˜ w p[n] is given by

{−1 2 6 6 4 6}, 0 ≤ n ≤ 5. (b) N = 8, and for each of the sequences, we can write the periodic extension as follows:

˜ x p[n] = x[n + k8]n=−∞

∑ ,

˜ y p[n] = y[n + k8]n=−∞

∑ ,

˜ w p[n] = w[n + k8]n=−∞

∑ .

The portion of

˜ x p[n] in the range 0 ≤ n ≤ 7 is given by:

x[n − 8] + x[n] + x[n + 8] = {0 0 0 0 0 0 0 0} +{6 −3 2 0 0 0 0 0} +{0 0 0 0 0 2 0 −1}.

Hence, one period of

˜ x p[n] is given by

{6 −3 2 0 0 2 0 −1}, 0 ≤ n ≤ 7. The portion of

˜ y p[n] in the range 0 ≤ n ≤ 7 is given by:

y[n − 8] + y[n] + y[n + 8] = {0 0 0 0 0 0 0 0} +{1 1 0 0 0 0 0 0} +{0 0 0 8 2 −7 −3 0}.

Hence, one period of

˜ y p[n] is given by

{1 1 0 8 2 −7 −3 0}, 0 ≤ n ≤ 7. The portion of

˜ w p[n] in the range 0 ≤ n ≤ 7 is given by:

w[n − 8] + w[n] + w[n + 8] = {0 0 0 0 0 0 0 0} +{−1 2 6 6 1 0 0 0} +{0 0 0 0 0 0 3 6}.

Hence, one period of

˜ w p[n] is given by

{−1 2 6 6 1 0 3 6}, 0 ≤ n ≤ 7. 2.38 Given

˜ x [n] = Asin(ωon + φ). (a)

˜ x [n] = {1, 1, −1, −1}. Hence

A = 2, ωo = π /4, φ = π /4. (b)

˜ x [n] = {0.5, −0.5, 0.5, −0.5}. Hence

ωo = π /2,

φ = π /2. (c)

˜ x [n] = {0, 0.5878, −0.9511, 0.9511, −0.5878}. Hence

ωo =1.25π ,

(d)

˜ x [n] = {2, 0, −2, 0}. Hence

A = 2, ωo = π /4, φ = π /2. 2.39 The fundamental period of a periodic sequence with an angular frequency ω0 satisfies

Equation (2.53a) with the smallest value of and .

Page 20: to accompany Digital Signal Processing: A …...Digital Signal Processing: A Computer-Based Approach Fourth Edition Sanjit K. Mitra Prepared by Chowdary Adsumilli, John Berger, Marco

Not for sale. 20

(a) Here, ω0 = 0.25π, so that the equation for fundamental period reduces to 0.25πN = 2πr, which is satisfied with N = 8, r = 1.

(b) Here, ω0 = 0.6π, so that the equation for fundamental period reduces to 0.6πN = 2πr, which is satisfied with N = 10, r = 3. (c) We first determine the fundamental period

N1 of

Re{e jπn /8} = cos(πn /8). In this case, the equation reduces to

0.125πN1 = 2πr1, which is satisfied with

N1 =16 and

r1 =1. Next, we determine the fundamental period

N2 of

Im{e jπn / 5 = j sin(0.2πn). In this case, the equation reduces to

0.2πN2 = 2πr2, which is satisfied with

N2 =10 and

r2 =1. Hence the fundamental period is given by

LCM(N1,N2) = LCM(10,16) = 80. (d) We first determine the fundamental period

N1 of

sin(0.15πn) In this case, the equation reduces to

0.15πN1 = 2πr1, which is satisfied with

N1 = 40 N1 = 40 and

r1 = 3. Next, we determine the fundamental period

N2 of

cos(0.12πn − 0.1π) . In this case, the equation reduces to

0.12πN2 = 2πr2, which is satisfied with

N2 = 50 and

r2 = 3. Hence the fundamental period is given by

LCM(N1,N2) = LCM(50,40) = 200. (e) Again, we start by finding the fundamental period of each sinusoidal component and then find the least common multiple of the three to determine the overall fundamental period. The fundamental period

N1 of

sin(0.1πn + 0.75π) In this case, the equation reduces to

0.1πN1 = 2πr1, which is satisfied with

N1 = 20 and

r1 =1. Next, we determine the fundamental period

N2 of

cos(0.8πn + 0.2π). The equation reduces to

0.8πN2 = 2πr2, which is satisfied with

N2 = 5 and

r2 = 2. Lastly, we determine the fundamental period

N3 of

cos(1.3πn) . The equation reduces to

1.3πN3 = 2πr3, which is satisfied with

N3 = 20 and

r3 =13. Hence the fundamental period is given by

LCM(N1,N2,N3) = LCM(20,5,20) = 20. 2.40 The fundamental period N of a periodic sequence with an angular frequency ω0 satisfies

Eq. (2.53a) with the smallest value of N and r.

(a) For this problem, ω0 = 0.3π, so the equation reduces to 0.3πN = 2πr, which is satisfied with N = 20, r = 3.

(b) For this problem, ω0 = 0.48π, so the equation reduces to 0.48πN = 2πr, which is satisfied with N = 25, r = 6.

(c) For this problem, ω0 = 0.525π, so the equation reduces to 0.525πN = 2πr, which is

satisfied with N = 80, r = 21. (d) For this problem, ω0 = 0.7π, so the equation reduces to 0.7πN = 2πr, which is satisfied

with N = 20, r = 7.

Page 21: to accompany Digital Signal Processing: A …...Digital Signal Processing: A Computer-Based Approach Fourth Edition Sanjit K. Mitra Prepared by Chowdary Adsumilli, John Berger, Marco

Not for sale. 21

(e) For this problem, ω0 = 0.75π, so the equation reduces to 0.75πN = 2πr, which is satisfied with N = 8, r = 3.

2.41 Here ω0 = 0.06π, so that Eq. (2.53a) reduces to 0.06πN = 2πr which is satisfied with N = 100 and r = 3. Other sequences

x[n] = sin(ωk ) with the same fundamental period will satisfy

100ωk = 2πr. Choosing r = 1 and r = 2, two possible sequences with the same fundamental period would have ω2 = 0.02π and ω3 = 0.01π, respectively, resulting in:

x2[n] = sin(0.01πn) and

x3[n] = sin(0.02πn). 2.42 In each of the following parts, N is the fundamental period and r is a positive integer. Eqs.

(2.53a) and (2.39) are used the compute the fundamental period and the average power of the periodic sequences.

(a) For

x1[n] = 5cos(πn /3), N and r must satisfy the relation (π/3)N = 2πr, which is satisfied by N = 6 and r = 1, which are the smallest values of N and r. The average power can be calculated as follows:

P

x1=1N

x1[n]2

n=0

N−1∑ =

16

5cos πn3

⎛ ⎝ ⎜ ⎞

⎠ ⎟

n=0

5∑

2

=256

cos πn3

⎛ ⎝ ⎜ ⎞

⎠ ⎟ 2

=252n=0

5∑ .

(b) For

x2[n] = 2cos(2πn /5), N and r must satisfy the relation (2π/5)N = 2πr, which is satisfied by N = 5 and r = 1, which are the smallest values of N and r. The average power can be calculated as follows:

P

x2=1N

x1[n]2

n=0

N−1∑ =

15

2cos 2πn5

⎛ ⎝ ⎜ ⎞

⎠ ⎟

n=0

5∑

2

=45

cos 2πn5

⎛ ⎝ ⎜ ⎞

⎠ ⎟ 2

= 2n=0

5∑ .

(c) For

x3[n] = 2cos(2πn /7), N and r must satisfy the relation (2π/7)N = 2πr, which is satisfied by N = 7 and r = 1, which are the smallest values of N and r. The average power can be calculated as follows:

P

x3=1N

x1[n]2

n=0

N−1∑ =

17

2cos 2πn7

⎛ ⎝ ⎜ ⎞

⎠ ⎟

n=0

6∑

2

=47

cos 2πn7

⎛ ⎝ ⎜ ⎞

⎠ ⎟ 2

= 2n=0

6∑ .

(d) For

x4[n] = 3cos(5πn /7), N and r must satisfy the relation (5π/7)N = 2πr, which is satisfied by N = 14 and r = 5, which are the smallest values of N and r. The average power can be calculated as follows:

P

x4 =1N

x1[n]2

n=0

N−1∑ =

114

3cos 5πn7

⎛ ⎝ ⎜ ⎞

⎠ ⎟

n=0

13∑

2

=914

cos 5πn7

⎛ ⎝ ⎜ ⎞

⎠ ⎟ 2

= 4.5n=0

6∑ .

(e) For

x5[n] = 4cos(2πn /5) + 3cos(3πn /5), the fundamental period will be the least common multiple of the fundamental periods of each component function. For the

Page 22: to accompany Digital Signal Processing: A …...Digital Signal Processing: A Computer-Based Approach Fourth Edition Sanjit K. Mitra Prepared by Chowdary Adsumilli, John Berger, Marco

Not for sale. 22

sequence

4cos(2πn /5),

N1 and

r1 must satisfy the relation

(2π /5)N1 = 2πr1, which is satisfied by

N1 = 5 and

r1 =1. For the sequence

3cos(3πn /5),

N2 and

r2 must satisfy the relation

(3π /5)N2 = 2πr2, which is satisfied by

N2 =10 and

r2 = 3. The LCM of these two number is 10, which is the fundamental period of the joint signal. The average power can be calculated as follows:

P

x5=1N

x1[n]2

n=0

N−1∑ =

110

4cos 2πn5

⎛ ⎝ ⎜ ⎞

⎠ ⎟ + 3cos 3πn

5⎛ ⎝ ⎜ ⎞

⎠ ⎟

n=0

9∑

2

=110

4cos 2πn5

⎛ ⎝ ⎜ ⎞

⎠ ⎟

n=0

9∑

2

+12cos 2πn5

⎛ ⎝ ⎜ ⎞

⎠ ⎟ cos 3πn

5⎛ ⎝ ⎜ ⎞

⎠ ⎟ + 3cos 3πn

5⎛ ⎝ ⎜ ⎞

⎠ ⎟ 2

=1610

cos 2πn5

⎛ ⎝ ⎜ ⎞

⎠ ⎟

n=0

9∑

2

+1210

cos 2πn5

⎛ ⎝ ⎜ ⎞

⎠ ⎟ cos 3πn

5⎛ ⎝ ⎜ ⎞

⎠ ⎟

n=0

9∑ +

910

cos 3πn5

⎛ ⎝ ⎜ ⎞

⎠ ⎟ 2

n=0

9∑

≅ 8 + 4.5 =12.5.

(f) For

x6[n] = 4cos(5πn /3) + 3cos(3πn /5), the fundamental period will be the least common multiple of the fundamental periods of each component function. For the sequence

cos(5πn /3),

N1 and

r1 must satisfy the relation

(5π /3)N1 = 2πr1, which is satisfied by

N1 = 6 and

r1 = 5.

r1 =1. For the sequence

3cos(3πn /5),

N2 and

r2 must satisfy the relation

(3π /5)N2 = 2πr2, which is satisfied by

N2 =10 and

r2 = 3. The LCM of these two number is 30, which is the fundamental period of the joint signal. The average power can be calculated as follows:

P

x6=1N

x1[n]2

n=0

N−1∑ =

130

4cos 5πn3

⎛ ⎝ ⎜ ⎞

⎠ ⎟ + 3cos 3πn

5⎛ ⎝ ⎜ ⎞

⎠ ⎟

n=0

29∑

2

=130

4cos 5πn3

⎛ ⎝ ⎜ ⎞

⎠ ⎟

n=0

29∑

2

+12cos 5πn3

⎛ ⎝ ⎜ ⎞

⎠ ⎟ cos 3πn

5⎛ ⎝ ⎜ ⎞

⎠ ⎟ + 3cos 3πn

5⎛ ⎝ ⎜ ⎞

⎠ ⎟ 2

=1630

cos 5πn3

⎛ ⎝ ⎜ ⎞

⎠ ⎟

n=0

29∑

2

+1230

cos 5πn3

⎛ ⎝ ⎜ ⎞

⎠ ⎟ cos 3πn

5⎛ ⎝ ⎜ ⎞

⎠ ⎟

n=0

29∑ +

930

cos 3πn5

⎛ ⎝ ⎜ ⎞

⎠ ⎟ 2

n=0

29∑

≅ 8 + 4.5 =12.5.

2.43 The impulse function and unit step functions are defined by Eqs. (2.45) and (2.46):

(a) Each of the sequences can be expressed as follows:

Page 23: to accompany Digital Signal Processing: A …...Digital Signal Processing: A Computer-Based Approach Fourth Edition Sanjit K. Mitra Prepared by Chowdary Adsumilli, John Berger, Marco

Not for sale. 23

(b) Each of the sequences can be expressed as shown below. Note that each sequence constructed in this manner must end with a unit step function after the end of the signal that renormalizes the remainder of the interval to zero.

2.44 Using the definition of Eq. (2.46), we can express this sequence as follows:

x[n] = 2.1µ[n +1] − 5.3µ[n]+1.6µ[n −1]+ 6.9µ[n − 2] − 5.2µ[n − 3]. 2.45 Using the definition of Eq. (2.46), we can express this sequence as follows: .

2.46 (a)

αnµ[n]O* µ[n] = α kµ[k]k=−∞

∑ µ[n − k] = α kµ[n − k]k=0

∑ = α k ,k=0n∑ n ≥ 0,0, n < 0,

⎧ ⎨ ⎪

⎩ ⎪

=1−αn+1

1−α

⎝ ⎜ ⎜

⎠ ⎟ ⎟ µ[n].

(b)

nαnµ[n]O* µ[n] = kα kµ[k]k=−∞

∑ µ[n − k] = kα kµ[n − k]k=0

∑ = kα k ,k=0n∑ n > 0,0, n ≤ 0.

⎧ ⎨ ⎪

⎩ ⎪

2.47 In this problem we make use of the identity

δ[n −m]O* δ[n − r] = δ[n −m − r].

(a)

y1[n] = x1[n]O* h1[n]

= 2δ[n −1] − 2δ[n +1]( )O* −δ[n − 2] −1.5δ[n] +δ[n + 3]( )

= −2δ[n −1]O* δ[n − 2] − 3δ[n −1]O* δ[n] + 2δ[n −1]O* δ[n + 3]

+ 2δ[n +1]O* δ[n − 2] + 3δ[n +1]O* δ[n] − 2δ[n +1]O* δ[n + 3]

= −2δ[n − 3] − 3δ[n −1] + 2δ[n + 2] + 2δ[n −1] + 3δ[n +1] − 2δ[n + 4]= −2δ[n − 3] −δ[n −1] + 3δ[n +1] + 2δ[n + 2] − 2δ[n + 4].

(b)

y2[n] = x2[n]O* h2[n]

Page 24: to accompany Digital Signal Processing: A …...Digital Signal Processing: A Computer-Based Approach Fourth Edition Sanjit K. Mitra Prepared by Chowdary Adsumilli, John Berger, Marco

Not for sale. 24

= 3δ[n − 2] −δ[n]( )O* 3δ[n − 3] + 2δ[n −1] −δ[n +1]( )

= 9δ[n − 2]O* δ[n − 3] + 6δ[n − 2]O* δ[n −1] − 3δ[n − 2]O* δ[n +1]

− 3δ[n]O* δ[n − 3] − 2δ[n]O* δ[n −1] +δ[n]O* δ[n +1]

= 9δ[n − 5] + 6δ[n − 3] − 3δ[n −1] − 3δ[n − 3] − 2δ[n −1] +δ[n +1]= 9δ[n − 5] + 3δ[n − 3] − 5δ[n −1] +δ[n +1].

(c)

y3[n] = x1[n]O* h2[n]

= 2δ[n −1] − 2δ[n +1]( )O* 3δ[n − 3] + 2δ[n −1] −δ[n +1]( )

= 6δ[n −1]O* δ[n − 3] + 4δ[n −1]O* δ[n −1] − 2δ[n −1]O* δ[n +1]

− 6δ[n +1]O* δ[n − 3] − 4δ[n +1]O* δ[n −1] + 2δ[n +1]O* δ[n +1]

= 6δ[n − 4] + 4δ[n − 2] − 2δ[n] − 6δ[n − 2] − 4δ[n] + 2δ[n + 2]= 6δ[n − 4] − 2δ[n − 2] − 6δ[n] + 2δ[n + 2].

(d)

y4[n] = x2[n]O* h1[n]

= 3δ[n − 2] −δ[n]( )O* −δ[n − 2] −1.5δ[n] +δ[n + 3]( )

= −3δ[n − 2]O* δ[n − 2] − 4.5δ[n − 2]O* δ[n] + 3δ[n − 2]O* δ[n + 3]

+δ[n]O* δ[n − 2] +1.5δ[n]O* δ[n] −δ[n]O* δ[n + 3]

= −3δ[n − 4] − 4.5δ[n − 2] + 3δ[n +1] +δ[n − 2] +1.5δ[n] −δ[n + 3]= −3δ[n − 4] − 3.5δ[n − 2] +1.5δ[n] + 3δ[n +1] −δ[n + 3].

2.48 The sequences x[n], h[n], g[n] and w[n] are all fine-length rectangular sequences with

sample values 1 in the ranges of n shown below:

x[n] = µ[n]−µ[n − N] =

0, n < 0,1 0 ≤ n ≤ N −1,0, n ≥ N .

⎨ ⎪

⎩ ⎪

h[n] = µ[n]−µ[n −M] =

0, n < 0,1 0 ≤ n ≤ M −1,0, n ≥ M .

⎨ ⎪

⎩ ⎪

g[n] = µ[n −M]−µ[n − N] =

0, n < M,1 M ≤ n ≤ N −1,0, n ≥ N .

⎨ ⎪

⎩ ⎪

w[n] = µ[n + M]−µ[n − N] =

0, n < −M,1 −M ≤ n ≤ N −1,0, n ≥ N.

⎨ ⎪

⎩ ⎪

Page 25: to accompany Digital Signal Processing: A …...Digital Signal Processing: A Computer-Based Approach Fourth Edition Sanjit K. Mitra Prepared by Chowdary Adsumilli, John Berger, Marco

Not for sale. 25

The location of the largest sample(s) will depend on the peak of the overlap between the corresponding functions. The convolution sum of two such sequences will be a triangular or trapezoidal pulse with the maximum(s) determined by the lengths of the rectangular sequences. If both sequences are of equal length K, then the maximum value will be also K and its location will depend on the location of first non-zero value of the sequence.

If the two sequences being convolved are of unequal lengths K and L with K > L, then the maximum value will be L and there will be

K − L samples with the maximum value. In the answers below, the location of the first such maximal value is listed.

(a) The maximum of

y1[n] will occur at

n = N −1 with a maximum value N. (b) The maximum of

y2[n] will occur at

n = M −1 with a maximum value M. (c) The maximum of

y3[n] will occur at

n = M + N −1 with a maximum value

N −M. (d) The maximum of will occur at with a value of (e) The maximum of will occur at with a maximum value (f) The maximum of will occur at with a value of (g) The maximum of will occur at with a maximum value

2.49 Each of these uses the definitions of conjugate symmetry and conjugate anti-symmetry

along with the definition of convolution:

hcs[n] = h *cs [−n] gcs[n] = g*cs [−n]hca[n] = −h *ca [−n] gca[n] = −g*ca [−n]

(a) We will show that if both of the sequences being convolved are conjugate symmetric,

then the result will also be conjugate symmetric. First, define y[n] to be the convolution sum:

y[n] = hcs[n]O* gcs[n] = hcs[k]gcs[n − k]k=−∞

∑ .

Next, check whether this satisfies conjugate symmetry:

y *[−n] = h *cs [k]g*cs [−n − k]k=−∞

∑ = h *cs [−k]g*cs [−n + k]k=−∞

= h *cs [−k]g*cs [−(n − k)]k=−∞

∑ = hcs[k]gcs[n − k]k=−∞

∑ = y[n].

(b) We will show that if one of the sequences being convolved isconjugate symmetric,

and the other is conjugate anti-symmetric, then the combination will be conjugate anti-symmetric: First, define y[n] to be the convolution sum:

Page 26: to accompany Digital Signal Processing: A …...Digital Signal Processing: A Computer-Based Approach Fourth Edition Sanjit K. Mitra Prepared by Chowdary Adsumilli, John Berger, Marco

Not for sale. 26

y[n] = hca[n]O* gcs[n] = hca[k]gcs[n − k]k=−∞

∑ .

Next, check whether this satisfies conjugate symmetry:

y *[−n] = h *ca [k]g*cs [−n − k]k=−∞

∑ = h *ca [−k]g*cs [−n + k]k=−∞

= h *ca [−k]g*cs [−(n − k)]k=−∞

∑ = − hcs[k]gcs[n − k]k=−∞

∑ = −y[n].

(c) If both of the sequences being convolved are conjugate anti-symmetric, then the

result will also be conjugate anti-symmetric. First, define y[n] to be the convolution sum:

y[n] = hca[n]O* gca[n] = hca[k]gca[n − k]k=−∞

∑ .

Next, check whether this satisfies conjugate symmetry:

y *[−n] = h *ca [k]g*ca [−n − k]k=−∞

∑ = h *ca [−k]g*ca [−n + k]k=−∞

= h *ca [−k]g*ca [−(n − k)]k=−∞

∑ = (−1)hca[k](−1)gca[n − k]k=−∞

∑ = y[n].

2.50 The three parameters and of the continuous-time signal

xa (t)can be determined from

x[n] = xa (nT) = Acos(ΩonT + φ) by setting 3 distinct values of For example

x[0] = Acosφ = α,

x[−1] = Acos(−ΩoT + φ) = Acos(ΩoT)cosφ + Asin(ΩoT)sinφ = β,

x[1] = Acos(ΩoT + φ) = Acos(ΩoT)cosφ − Asin(ΩoT)sinφ = γ .

Substituting the first equation into the last two equations and then adding them yields:

cos(ΩoT) =β+ γ2α

.

Solving this can be used to determine . From the second equation we have:

Asinφ = β − Acos(ΩoT)cosφ = β −α cos(ΩoT).

Dividing this equation by the previous result yields

tanφ =β −α cos(ΩoT)α sin(ΩoT

.

This can be solved to determine Finally, A is determined from the first equation.

Page 27: to accompany Digital Signal Processing: A …...Digital Signal Processing: A Computer-Based Approach Fourth Edition Sanjit K. Mitra Prepared by Chowdary Adsumilli, John Berger, Marco

Not for sale. 27

Given

ΩT =2πT

= 2Ωo. x[n] = β and x[n+1] = β. Snce all sample values are equal, the

three parameters cannot be determined uniquely.

In the case where

ΩT =2πT

< 2Ωo.

x[n] = Acos(ΩonT + φ)

= Acos(ωon + φ) implying

ωo =ΩoT > π . A digital sinusoidal sequence with an angular frequency

ωo greater than assumes the identity of a sinusoidal sequence with an angular frequency in the range

0 ≤ω < π .. Hence, cannot be uniquely determined from

x[n] = Acos(ΩonT + φ) . 2.51

x[n] = cos(ΩonT). If x[n] is periodic with a period N, then:

x[n + N] = cos Ω0nT +Ω0NT( ) = x[n] = cos(Ω0nT). This implies that

ΩoNT = 2πrwith r being any nonzero positive integer. Hence the sampling rate must satisfy the relation

T = 2πr /ΩoN. If

Ωo = 30, i.e.,

T = π /6, then we must have 30N(π/6) = 2πr.

The smallest value of and satisfying this relation are N = 2 and r = 5, thus the

fundamental period is N = 2. 2.52 The autocorrelation and cross-correlation sequences are defined by Eqs. (2.69) and (2.67),

respectively:

rxx[l] = x[k]x[k − l]k=−∞

∑ ,

rxy[l] = y[k]x[k − l]k=−∞

∑ .

(a) The autocorrelations are as follows:

rxx[l] = 0 4 −6 10 13 −30 54 −30 13 10 −6 4 2{ },

ryy[l] = 8 10 −5 −34 −65 24 128 24 −65 −34 −5 10 8{ },

rww[l] = 3 24 53 38 21 64 123 64 21 38 53 24 3{ }.

(b) The cross-correlations are as follows:

rxy[l] = 2 2 −1 −1 −11 6 7 −35 19 28 −20 16 0{ },

rxw[l] = 2 12 11 4 25 30 13 −6 40 −2 3 6 0{ }.

2.53 The autocorrelation sequence is defined by Eq. (2.69):

rxx[l] = x[k]x[k − l]k=−∞

∑ .

Page 28: to accompany Digital Signal Processing: A …...Digital Signal Processing: A Computer-Based Approach Fourth Edition Sanjit K. Mitra Prepared by Chowdary Adsumilli, John Berger, Marco

Not for sale. 28

(a) The autocorrelations can be computed as follows:

rx1x1[] = x1[n]n=−∞

∞∑ x1[n − ] = αnn=−∞

∞∑ µ[n]αn−µ[n − ]

= α2n−n=0∞∑ µ[n − ] =

α2n−n=0∞∑ , < 0,

α2n−n=∞∑ , ≥ 0,

⎨ ⎪

⎩ ⎪

=

α−

1−α2, < 0,

α

1−α2, ≥ 0.

⎨ ⎪

⎩ ⎪

Note that for

≥ 0,rx1x1[] =α

1−α2, and for

< 0,rx1x1[] =α−

1−α2.

Replacing

with

− in the second expression we get:

rx1x1[−] =α−(−)

1−α2=

α

1−α2= rx1x1[].

Hence,

rx1x1[] is an even function of

. The maximum value of

rx1x1[] occurs at

= 0 since

α is a decaying function for increasing n when

(b) The autocorrelations can be computed as follows:

rx2x2 [] = x2[n − ]n=0N−1∑ .

Since:

x2[n − ] =1, ≤ n ≤ N −1+ ,0, otherwise.⎧ ⎨ ⎩

Therefore:

rx2x2 [] =

0, for < −(N −1),N + , for − (N −1) ≤ ≤ 0,N, for = 0,

N − , for 0 < N − ≤ N −1,0, for > N −1.

⎪ ⎪ ⎪

⎪ ⎪ ⎪

It follows from the above that

rx2x2 [] is a triangular function of , and hence is an even function with a maximum value of at

= 0. M2.1 The sample program is listed below, with cs and ca corresponding to the conjugate

symmetric and conjugate anti-symmetric components, respectively: cs = 0.5*(x + conj(fliplr(x))); ca = 0.5*(x - conj(fliplr(x))); Given the sample input from Example 2.8: g[n] = {0 1+4j -2+3j 4-2j -5-6j -2j 3} We get:

Page 29: to accompany Digital Signal Processing: A …...Digital Signal Processing: A Computer-Based Approach Fourth Edition Sanjit K. Mitra Prepared by Chowdary Adsumilli, John Berger, Marco

Not for sale. 29

cs = {1.5, 0.5 + 3j, -3.5 + 4.5j, 4, -3.5-4.5j, 0.5 - 3j, 1.5} ca = {-1.5, 0.5 + j, 1.5 – 1.5j, -2j, -1.5 – 1.5j, -0.5 + 1.5j} This verifies the results in Example 2.8. M2.2 (a) The input data entered during the execution of Program 2_2.m are:

For Figure 2.23 Type in real exponent = -1/12 Type in imaginary exponent = pi/6 Type in gain constant = 1

Type in length of sequence = 41

For Figure 2.24 (a) Type in real exponent = log(1.2) Type in imaginary exponent = 0 Type in gain constant = 0.2

Type in length of sequence = 31

For Figure 2.24 (b) Type in real exponent = log(0.9) Type in imaginary exponent = 0 Type in gain constant = 20

Type in length of sequence = 31 (b) The input data entered during the execution of Program 2_2.m are:

Type in real exponent = -0.4 Type in imaginary exponent = pi/6 Type in gain constant = -2.7

Type in length of sequence = 8

M2.2 (a)

˜ x a[n] = e j0.25πn . The plots generated using Program 2_2.m are shown below:

Page 30: to accompany Digital Signal Processing: A …...Digital Signal Processing: A Computer-Based Approach Fourth Edition Sanjit K. Mitra Prepared by Chowdary Adsumilli, John Berger, Marco

Not for sale. 30

(b) The code fragment used to generate

˜ x b[n] = cos(0.6πn + 0.3π) is: x = cos(0.6*pi*[0:40] + 0.3*pi);

(c) The code fragment used to generate

˜ x c[n] = Re e jπn /8( ) + Im e jπn / 5( ) is: x = real(exp(i*pi*[0:40]/8))+imag(exp(i*pi*[0:40]/5));

(d) The code used to generate

˜ x d [n] = 6sin(0.15πn) − cos(0.12πn + 0.1π) is:

Page 31: to accompany Digital Signal Processing: A …...Digital Signal Processing: A Computer-Based Approach Fourth Edition Sanjit K. Mitra Prepared by Chowdary Adsumilli, John Berger, Marco

Not for sale. 31

x = 6*cos(0.15*pi*[0:40])-cos(0.12*pi*[0:40]+0.1*pi);

(e) The code for

˜ x e[n] =sin(0.1πn + 0.75π) − 3cos(0.8πn + 0.2π) − cos(1.3πn) is:

x = sin(1.5*pi*n+0.75*pi)-3*cos(0.8*pi*[0:40]+0.2*pi)-cos(1.3*pi*[0:40]);

M2.4 (a) L = input('Desired length = '); A = input('Amplitude = '); omega = input('Angular frequency = '); phi = input('Phase = '); n = 0:L-1; x = A*cos(omega*n + phi); stem(n,x); xlabel('Time Index'); ylabel('Amplitude'); title(['\omega_{o} = ',num2str(omega/pi),'\pi']);

(b)

Page 32: to accompany Digital Signal Processing: A …...Digital Signal Processing: A Computer-Based Approach Fourth Edition Sanjit K. Mitra Prepared by Chowdary Adsumilli, John Berger, Marco

Not for sale. 32

M2.5 The code is given below: n = [0:0.001:1]; g1 = cos(6*pi*n); g2 = cos(14*pi*n); g3 = cos(26*pi*n); gpoints = cos(6*pi*[0:0.1:1]); plot(n,g1,'k-')

Page 33: to accompany Digital Signal Processing: A …...Digital Signal Processing: A Computer-Based Approach Fourth Edition Sanjit K. Mitra Prepared by Chowdary Adsumilli, John Berger, Marco

Not for sale. 33

hold on; plot(n,g2,'k--') plot(n,g3,'k-.') plot([0:0.1:1],gpoints,'bo') hold off;

M2.6 Code for plotting sinusoids is given below: t = 0:0.001:1;

fo = input('Frequency of sinusoid in Hz = '); FT = input('Sampling frequency in Hz = '); g1 = cos(2*pi*fo*t); plot(t,g1,'-'); xlabel('time'); ylabel('Amplitude'); hold n = 0:1:FT; gs = cos(2*pi*fo*n/FT);

plot(n/FT,gs,'o'); hold off M2.7 Sample code to verify the validity of the expeirment is shown below: t = 0:0.001:0.85;

g1 = cos(6*pi*t); g2 = cos(14*pi*t); g3 = cos(26*pi*t); plot(t/0.85,g1,'-', t/0.85, g2, '--', t/0.85, g3,':'); xlabel('time'); ylabel('Amplitude'); hold

Page 34: to accompany Digital Signal Processing: A …...Digital Signal Processing: A Computer-Based Approach Fourth Edition Sanjit K. Mitra Prepared by Chowdary Adsumilli, John Berger, Marco

Not for sale. 34

n = 0:1:8; gs = cos(0.6*pi*n); plot(n/8.5,gs,'o'); hold off M2.8 Sample code for autocorrelation and cross correlation is shown below: rxx = conv(x,fliplr(x)) Given the sequences in Problem 2.52, the autocorrelations and cross correlations are

given below: rxx = 0 4 -6 10 13 -30 54 -30 13 10 -6 4 0 ryy = 8 10 -5 -34 -65 24 128 24 -65 -34 -5 10 8 rww = 3 24 53 38 21 64 123 64 21 38 53 24 3 rxy = 2 2 -1 -1 -11 6 7 -35 19 28 -20 16 0 rxw = 2 12 11 4 25 30 13 -6 40 -2 3 6 0

M2.9 Sample code is provided below:

N = input('Length of sequence = '); n = 0:N-1; x = exp(-0.8*n); y = rand(1,N)-0.5+x; n1 = length(x)-1; r = conv(y,fliplr(y)); k = (-n1):n1; stem(k,r); xlabel('Lag_index'); ylabel('Amplitude');

M2.10 The plot of the correlation is shown below:

Page 35: to accompany Digital Signal Processing: A …...Digital Signal Processing: A Computer-Based Approach Fourth Edition Sanjit K. Mitra Prepared by Chowdary Adsumilli, John Berger, Marco

Not for sale. 35