Digital Signal Processing: A Computer-Based Approach

62 downloads 726 Views 321KB Size Report
1. SOLUTIONS MANUAL to accompany. Digital Signal Processing: A Computer- Based Approach. Second Edition. Sanjit K. Mitra. Prepared by. Rajeev Gandhi ...
SOLUTIONS MANUAL to accompany

Digital Signal Processing: A Computer-Based Approach Second Edition

Sanjit K. Mitra

Prepared by Rajeev Gandhi, Serkan Hatipoglu, Zhihai He, Luca Lucchese, Michael Moore, and Mylene Queiroz de Farias

1

Chapter 2 (2e) 2.1 (a) u[n] = x[n] + y[n] = {3 5 1 −2 8 14 0} (b) v[n] = x[n] ⋅ w[n] = {−15 −8 0 6 −20 0 2} (c)

s[n] = y[n] − w[n] = {5 3 −2 −9 9 9 −3}

(d)

r[n] = 4.5y[n] = {0 31.5 4.5 −13.5 18 40.5 −9}

2.2 (a) From the figure shown below we obtain v[n]

x[n]

v[n–1]

–1

z α β

y[n]

v[n] = x[n] + α v[n − 1] and

γ

y[n] = β v[n − 1] + γ v[n − 1] = (β + γ )v[n − 1]. Hence,

v[n − 1] = x[n − 1] + α v[n − 2] and

y[n − 1] = (β + γ )v[n − 2]. Therefore,

y[n] = (β + γ )v[n − 1] = (β + γ )x[n − 1] + α(β + γ )v[n − 2] = (β + γ )x[n − 1] + α(β + γ ) = (β + γ )x[n − 1] + α y[n − 1] . ( b ) From the figure shown below we obtain –1 x[n–1]

x[n]

z

–1

–1 x[n–2]

z

–1

x[n–4] z

x[n–3] z

α

β

γ y[n]

y[n] = γ x[n − 2] + β(x[n − 1] + x[n − 3]) + α(x[n] + x[n − 4]) . (c)

From the figure shown below we obtain v[n]

x[n]

–1 v[n–1]

z –1 –1

d1

z

2

y[n]

y[n − 1] (β + γ )

v[n] = x[n] − d1v[n − 1] and y[n] = d1v[n] + v[n − 1] . Therefore we can rewrite the second

(

)

(

)

equation as y[n] = d1 x[n] − d1v[n − 1] + v[n − 1] = d1x[n] + 1 − d12 v[n − 1]

(

)(

)

(

(1)

(

)

)

= d1x[n] + 1 − d12 x[n − 1] − d1v[n − 2] = d1x[n] + 1 − d12 x[n − 1] − d1 1 − d12 v[n − 2]

( (

) )

From Eq. (1), y[n − 1] = d1x[n − 1] + 1 − d12 v[n − 2] , or equivalently, d1y[n − 1] = d12 x[n − 1] + d1 1 − d12 v[n − 2]. Therefore, y[n] + d1y[n − 1] = d1x[n] + 1 − d12 x[n − 1] − d1 1 − d12 v[n − 2] + d12 x[n − 1] + d1

(

)

(

)

= d1x[n] + x[n − 1], or y[n] = d1x[n] + x[n − 1] − d1y[n − 1]. (d )

(1 − d12 )v[n − 2]

From the figure shown below we obtain x[n]

v[n] –1 z

v[n–1]

–1

v[n–2]

y[n]

z

–1

d1

w[n]

u[n] d2

v[n] = x[n] − w[n], w[n] = d1v[n − 1] + d 2 u[n], and u[n] = v[n − 2] + x[n]. From these equations we get w[n] = d 2 x[n] + d1x[n − 1] + d 2 x[n − 2] − d1w[n − 1] − d 2 w[n − 2] . From the figure we also obtain y[n] = v[n − 2] + w[n] = x[n − 2] + w[n] − w[n − 2], which yields d1y[n − 1] = d1x[n − 3] + d1w[n − 1] − d1w[n − 3], and d 2 y[n − 2] = d 2 x[n − 4] + d 2 w[n − 2] − d 2 w[n − 4], Therefore, y[n] + d1y[n − 1] + d 2 y[n − 2] = x[n − 2] + d1x[n − 3] + d 2 x[n − 4]

(

) (

)

+ w[n] + d1w[n − 1] + d 2 w[n − 2] − w[n − 2] + d1w[n − 3] + d 2 w[n − 4] = x[n − 2] + d 2 x[n] + d1x[n − 1] or equivalently, y[n] = d 2 x[n] + d1x[n − 1] + x[n − 2] − d1y[n − 1] − d 2 y[n − 2]. 2.3

(a) x[ n ] = {3 −2 0 1 4 5 2}, Hence, x[ − n ] = {2 5 4 1 0 −2 3}, − 3 ≤ n ≤ 3. 1 Thus, x ev [ n ] = ( x[ n ] + x[ − n ]) = {5 / 2 3 / 2 2 1 2 3 / 2 5 / 2}, − 3 ≤ n ≤ 3, and 2 1 x od [ n ] = ( x[ n ] − x[ − n ]) = {1 / 2 −7 / 2 −2 0 2 7 / 2 −1 / 2}, − 3 ≤ n ≤ 3. 2 (b) y[ n ] = {0 7 1 −3 4 9 −2}. Hence, y[ − n ] = {−2 9 4 −3 1 7 0}, − 3 ≤ n ≤ 3. 1 Thus, y ev [ n ] = ( y[ n ] + y[ − n ]) = {−1 8 5 / 2 −3 5 / 2 8 −1}, − 3 ≤ n ≤ 3, and 2 1 y od [ n ] = ( y[ n ] − y[ − n ]) = {1 −1 −3 / 2 0 1 3 / 2 −1}, − 3 ≤ n ≤ 3. 2

3

(c) w[ n ] = {−5 4 3 6 −5 0 1}, Hence, w[ − n ] = {1 0 −5 6 3 4 −5}, − 3 ≤ n ≤ 3. 1 Thus, w ev [ n ] = ( w[ n ] + w[ − n ]) = {−2 2 −1 6 −1 2 −2}, − 3 ≤ n ≤ 3, and 2 1 w od [ n ] = ( w[ n ] − w[ − n ]) = {−3 2 4 0 −4 −2 3}, − 3 ≤ n ≤ 3, 2 2.4

(a) x[ n ] = g[ n ]g[ n ] . Hence x[ − n ] = g[ − n ]g[ − n ] . Since g[n] is even, hence g[–n] = g[n]. Therefore x[–n] = g[–n]g[–n] = g[n]g[n] = x[n]. Hence x[n] is even. (b) u[n] = g[n]h[n]. Hence, u[–n] = g[–n]h[–n] = g[n](–h[n]) = –g[n]h[n] = –u[n]. Hence u[n] is odd. (c) v[n] = h[n]h[n]. Hence, v[–n] = h[n]h[n] = (–h[n])(–h[n]) = h[n]h[n] = v[n]. Hence v[n] is even.

2.5

Yes, a linear combination of any set of a periodic sequences is also a periodic sequence and the period of the new sequence is given by the least common multiple (lcm) of all periods. For our example, the period = lcm ( N1, N 2 , N 3 ) . For example, if N1 = 3, N 2 = 6, and N 3 = 12, then N = lcm(3, 5, 12) = 60.

2.6

1 1 (a) x pcs [ n ] = {x[ n ] + x * [ − n ]} = {A α n + A *(α*) − n}, and 2 2 1 1 x pca [ n ] = {x[ n ] − x * [ − n ]} = {A α n − A *(α*) − n}, − N ≤ n ≤ N. 2 2 (b) h[ n ] = {−2 + j5 4 − j3 5 + j6 3 + j −7 + j2} −2 ≤ n ≤ 2 , and hence, h * [ − n ] = {−7 − j2 3 − j 5 − j6 4 + j3 −2 − j5}, −2 ≤ n ≤ 2 . Therefore, 1 h pcs [ n ] = {h[ n ] + h * [ − n ]} = {−4.5 + j1.5 3.5 − j2 5 3.5 + j2 −4.5 − j1.5} and 2 1 h pca [ n ] = {h[ n ] − h * [ − n ]} = {2.5 + j3.5 0.5 − j j6 −0.5 − j −2.5 + j3.5} −2 ≤ n ≤ 2 . 2

2.7 (a)

{ }

{x[n]} = Aα n

where A and α are complex numbers,with α < 1.

Since for n < 0, α n can become arbitrarily large hence {x[n]} is not a bounded sequence. (b) {y[n]} = Aα n µ[n]

where A and α are complex numbers,with α < 1.

In this case y[n] ≤ A

∀n hence {y[n]} is a bounded sequence.

( c ) {h[n]} = Cβ n µ[n]

where C and β are complex numbers,with β > 1.

Since β

n

becomes arbitrarily large as n increases hence {h[n]} is not a bounded sequence.

4

(d) {g[n]} = 4 sin(ω a n). Since − 4 ≤ g[n] ≤ 4 for all values of n, {g[n]} is a bounded sequence. (e) {v[n]} = 3 cos2 (ω b n 2 ). Since − 3 ≤ v[n] ≤ 3 for all values of n, {v[n]} is a bounded sequence. 2.8

1

(a) Recall, x ev [n] = (x[n] + x[− n]). 2 Since x[n] is a causal sequence, thus x[–n] = 0 ∀n > 0 . Hence, x[n] = x ev [n] + x ev [− n] = 2x ev [n], ∀n > 0 . For n = 0, x[0] = xev [0]. Thus x[n] can be completely recovered from its even part. 1 1 Likewise, x od [n] = (x[n] – x[− n]) =  2 x[n], n > 0, 2  0, n = 0. Thus x[n] can be recovered from its odd part ∀n except n = 0. (b) 2y ca [n] = y[n] − y *[− n] . Since y[n] is a causal sequence y[ n ] = 2 y ca [ n ] ∀n > 0 . For n = 0, Im{y[0]} = y ca [0] . Hence real part of y[0] cannot be fully recovered from y ca [ n ] . Therefore y[n] cannot be fully recovered from y ca [ n ] . 2y cs [n] = y[n] + y *[− n] . Hence, y[ n ] = 2 y cs [ n ]

∀n > 0 .

For n = 0, Re{y[0]} = y cs [0]. Hence imaginary part of y[0] cannot be recovered from y cs [ n ] . Therefore y[n] cannot be fully recovered from y cs [ n ] . 2.9

1

1

x ev [n] = (x[n] + x[− n]). This implies, x ev [– n] = (x[– n] + x[n]) = x ev [n]. 2 2 Hence even part of a real sequence is even. 1

1

x od [n] = (x[n] – x[– n]). This implies, x od [– n] = (x[– n] – x[n]) = – x od [n]. 2 2 Hence the odd part of a real sequence is odd. 1

1

2.10 RHS of Eq. (2.176a) is x cs [n] + x cs [n − N] = (x[n] + x *[− n]) + (x[n − N] + x *[N − n]). 2 2 Since x[n] = 0 ∀n < 0 , Hence 1 2

x cs [n] + x cs [n − N] = (x[n] + x *[N − n]) = x pcs [n],

0 ≤ n ≤ N – 1.

RHS of Eq. (2.176b) is 1 2

1 2

x ca [n] + x ca [n − N] = (x[n] − x *[− n]) + (x[n − N] − x *[n − N]) 1 2

= (x[n] − x *[N − n]) = x pca [n],

5

0 ≤ n ≤ N – 1.

1

(

)

2.11 x pcs [n] = x[n] + x *[< − n > N ] for 0 ≤ n ≤ N – 1, Since, x[< − n > N ] = x[ N − n ] , it 2

follows

1

that x pcs [n] = (x[n] + x *[N − n]), 1 ≤ n ≤ N – 1. 2 1

For n = 0, x pcs [0] = (x[0] + x *[0]) = Re{x[0]}. 2 1

(

)

1

Similarly x pca [n] = x[n] − x *[< − n > N ] = (x[n] − x *[N − n]), 1 ≤ n ≤ N – 1. Hence, 2 2 1

for n = 0, x pca [0] = ( x[0] − x * [0]) = jIm{x[0]}. 2 ∞

∑n =−∞ x[n] < ∞. Therefore, by Schwartz inequality, ∞ ∞ ∞ ∑n =−∞ x[n] 2 ≤  ∑n =−∞ x[n]  ∑n =−∞ x[n] < ∞.

2.12 (a) Given

(b) Consider x[n] =

{1 0/ ,n,

n ≥ 1, otherwise. The convergence of an infinite series can be shown

via the integral test. Let a n = f ( x), where f(x) is a continuous, positive and decreasing ∞

∑ n=1 a n

function for all x ≥ 1. Then the series

and the integral



∫1

f ( x) dx both converge or

∞1 ∞ both diverge. For a n = 1 / n , f(x) = 1/n. But ∫ dx = (ln x) = ∞ − 0 = ∞. Hence, 1 1 x ∞ ∞ ∑ n =−∞ x[n] = ∑ n =1 1n does not converge, and as a result, x[n] is not absolutely 1 summable. To show {x[n]} is square-summable, we observe here a n = 2 , and thus, n ∞ ∞ 1 1 1 1 ∞ 1  1 f ( x) = 2 . Now, ∫ 2 dx = − = − + = 1. Hence, ∑ n=1 2 converges, or in other 1 x  x 1 ∞ 1 x n

words, x[n] = 1/n is square-summable. 2.13

See Problem 2.12, Part (b) solution.

2.14

x 2 [n] =



cos ω c n πn

, 1 ≤ n ≤ ∞. Now,



2

 cos ω c n   ≤  n =1  πn 







1 . Since, n =1 π 2 n 2



1 π2 = , n=1 n 2 6



2

1  cos ω c n  ≤ . Therefore x 2 [n] is square-summable.   n =1  πn  6



Using integral test we now show that x 2 [n] is not absolutely summable. ∞

∫1

cos ω c x πx



cos ω c x dx =

x 1 ⋅ x ⋅ cos int(ω c x) π cos ω c x

where cosint is the cosine integral function. 1

Since



∫1

cosω c x πx

dx diverges,



∑n =1

cosω c n πn

6

also diverges.





2.15

x2 [n] =

n =−∞ ∞

=





2 ∑ (x ev [n] + xod [n])

n =−∞ ∞



x 2ev [ n ] +

x 2od [ n ] + 2

n =−∞ n =−∞ ∞ x [ n ]x od [ n ] = as n = – ∞ ev



2.16 x[n] = cos(2πkn / N), N −1

Ex =



2

cos (2πkn / N) =



Therefore C + jS =

n =−∞





n =−∞

x 2ev [ n ] +





n =−∞

2 x od [n]

0 since x ev [ n ]x od [ n ] is an odd sequence.

1 2

N −1

∑ (1 + cos(4πkn / N)) =

n=0

cos(4πkn / N), and S =

n=0



x ev [ n ]x od [ n ] =

0 ≤ n ≤ N – 1. Hence,

n=0 N −1

Let C =



+

N −1

1 2

N −1

∑ cos(4πkn / N).

n=0

∑ sin(4πkn / N).

n=0 j4 πk

N −1

N 2

−1

∑ e j4πkn / N = e j4πk / N − 1 = 0. Thus, C = Re{C + jS} = 0 . e

n=0

As C = Re{C + jS} = 0 , it follows that E x = . 2 N

Average power =





∑ n =−∞ µ 2 [n] = ∑ n =−∞ 12 = ∞. 1 1 1 K K K 12 = lim lim (µ[ n ])2 = lim = . ∑ ∑ 0 n =− K n = K →∞ 2 K + 1 K →∞ 2 K + 1 K →∞ 2 K + 1 2

2.17 (a) x1[ n ] = µ[ n ]. Energy =

2





(b) x 2 [ n ] = nµ[ n ]. Energy = ∑ n =−∞ ( nµ[ n ]) = ∑ n =−∞ n 2 = ∞. 1 1 K K 2 ( µ [ ]) lim Aveerage power = lim n n = ∑ ∑ n = 0 n 2 = ∞. n =− K K →∞ 2 K + 1 K →∞ 2 K + 1 (c) x 3[ n ] = A o e jω o n . Energy =



∫n =−∞

A o e jω o n

2



= ∑ n =−∞ A o

2

= ∞. Average power =

2 1 1 2 K A 2o K K jω o n 2 lim lim A e = A = ∑ n =− K o ∑ n =− K o K→∞ 2K + 1 = A 2o . K →∞ 2 K + 1 K →∞ 2 K + 1

lim

A 2π  2 πn  + φ = A o e jω o n + A1e − jω o n , where ω o = , A o = − e jφ and  M  2 M A − jφ 3 A1 = e . From Part (c), energy = ∞ and average power = A 2o + A12 + 4 A 2o A12 = A 2 . 4 2

(d) x[ n ] = A sin

2.18

1, n ≥ 0, 1, n < 0, Now, µ[ n ] =  Hence, µ[ − n − 1] =  Thus, x[n] = µ[ n ] + µ[ − n − 1]. 0, n < 0. 0, n ≥ 0. n

2.19 (a) Consider a sequence defined by x[n] =

∑ δ[k].

k =−∞

7

If n < 0 then k = 0 is not included in the sum and hence x[n] = 0, whereas for n ≥ 0 , k = 0 is n n ≥ 0, 1, included in the sum hence x[n] = 1 ∀ n ≥ 0 . Thus x[n] = δ[k ] =  = µ[n]. 0, n < 0,



n ≥ 0, 1, it follows that µ[n – 1] =  n < 0, 0,

1, (b) Since µ[n] =  0,

{

Now x[ n ] = A sin(ω 0 n + φ) .

{

(a) Given x[ n ] = 0 − 2

n ≥ 1, n ≤ 0.

n = 0, n ≠ 0, = δ[n].

1, Hence, µ[n] – µ[n − 1] = 0, 2.20

k =−∞

−2 − 2

0

2

2

}

2 . The fundamental period is N = 4,

hence ω o = 2 π / 8 = π / 4. Next from x[0] = A sin(φ) = 0 we get φ = 0, and solving π x[1] = A sin( + φ) = A sin( π / 4) = − 2 we get A = –2. 4 (b) Given x[ n ] =

{

2

2

− 2

}

− 2 . The fundamental period is N = 4, hence

ω 0 = 2π/4 = π/2. Next from x[0] = A sin(φ) = 2 and

x[1] = A sin(π / 2 + φ) = A cos(φ) = 2 it

can be seen that A = 2 and φ = π/4 is one solution satisfying the above equations. (c) x[ n ] = {3

−3} . Here the fundamental period is N = 2, hence ω 0 = π . Next from x[0]

= A sin(φ) = 3 and x[1] = A sin(φ + π) = − A sin(φ) = −3 observe that A = 3 and φ = π/2 that A = 3 and φ = π/2 is one solution satisfying these two equations. (d) Given x[ n ] = {0 1.5 0

−1.5}, it follows that the fundamental period of x[n] is N =

4. Hence ω 0 = 2 π / 4 = π / 2 . Solving x[0] = A sin(φ) = 0 we get φ = 0, and solving x[1] = A sin( π / 2) = 1.5 , we get A = 1.5. 2.21 (a) x˜ 1[ n ] = e − j0.4 πn . Here, ω o = 0.4 π. From Eq. (2.44a), we thus get N=

2π r 2π r = = 5 r = 5 for r =1. ω o 0.4 π

(b) x˜ 2 [ n ] = sin(0.6 πn + 0.6 π ). Here, ω o = 0.6 π. From Eq. (2.44a), we thus get N=

2 π r 2 π r 10 = = r = 10 for r = 3. ω o 0.6 π 3

(c) x˜ 3[ n ] = 2 cos(1.1πn − 0.5π ) + 2 sin(0.7πn ). Here, ω1 = 1.1π and ω 2 = 0.7π . From Eq. 2 π r2 2 π r2 20 2 π r1 2 π r1 20 = = = = r2 . To be periodic (2.44a), we thus get N1 = r1 and N 2 = ω2 0.7π 7 ω1 1.1π 11

8

we must have N1 = N 2 . This implies,

20 20 r1 = r2 . This equality holds for r1 = 11 and r2 = 7 , 11 7

and hence N = N1 = N 2 = 20. 2 π r1 20 2 π r2 20 = = r1 and N 2 = r2 . It follows from the results of Part (c), N = 20 1.3π 13 0.3π 3 with r1 = 13 and r2 = 3. (d) N1 =

2 π r1 5 2 π r2 5 = r1 , N 2 = = r2 and N 3 = N 2 . Therefore, N = N1 = N 2 = N 2 = 5 for 1.2 π 3 0.8π 2 r1 = 3 and r2 = 2.

(e) N1 =

(f) x˜ 6 [n] =n modulo 6. Since x˜ 6 [ n + 6] = (n+6) modulo 6 = n modulo 6 = x˜ 6 [n]. Hence N = 6 is the fundamental period of the sequence x˜ 6 [n]. 2π r 2π r 100 = = r = 100 for r = 7. ω o 0.14 π 7 2π r 2π r 25 (b) ω o = 0.24 π. Therefore, N = = = r = 25 for r = 3. ω o 0.24 π 3 2π r 2π r 100 (c) ω o = 0.34 π. Therefore, N = = = r = 100 for r = 17. ω o 0.34 π 17 2π r 2π r 8 (d) ω o = 0.75π. Therefore, N = = = r = 8 for r = 3. ω o 0.75π 3

2.22 (a) ω o = 0.14 π. Therefore, N =

2.23 x[ n ] = x a ( nT ) = cos(Ω o nT ) is a periodic sequence for all values of T satisfying Ω o T ⋅ N = 2 πr for r and N taking integer values. Since, Ω o T = 2 πr / N and r/N is a rational number, Ω o T must also be rational number. For Ω o = 18 and T = π/6, we get N = 2r/3. Hence, the smallest value of N = 3 for r = 3. 2.24

(a) x[n] = 3 δ[n + 3] − 2 δ[n + 2] + δ[n] + 4 δ[n − 1] + 5 δ[n − 2] + 2 δ[n − 3] (b) y[n] = 7 δ[n + 2] + δ[n + 1] − 3 δ[n] + 4 δ[n − 1] + 9 δ[n − 2] − 2 δ[n − 3] (c) w[n] = −5 δ[n + 2] + 4 δ[n + 2] + 3δ[n + 1] + 6 δ[n] − 5 δ[n − 1] + δ[n − 3]

2.25

(a) For an input x i [ n ], i = 1, 2, the output is y i [ n ] = α1x i [ n ] + α 2 x i [ n − 1] + α 3x i [ n − 2] + α 4 x i [ n − 4], for i = 1, 2. Then, for an input x[ n ] = A x1[ n ] + Bx 2 [ n ], the output is y[ n ] = α1 ( A x1[ n ] + Bx 2 [ n ]) + α 2 ( A x1[ n − 1] + Bx 2 [ n − 1]) +α 3 ( A x1[ n − 2] + Bx 2 [ n − 2]) + α 4 ( A x1[ n − 3] + Bx 2 [ n − 3])

= A(α1x1[ n ] + α 2 x1[ n − 1] + α 3x1[ n − 2] + α 4 x1[ n − 4])

+ B (α1x 2 [ n ] + α 2 x 2 [ n − 1] + α 3x 2 [ n − 2] + α 4 x 2 [ n − 4]) = A y1[ n ] + By 2 [ n ]. Hence, the system is linear.

9

(b) For an input x i [ n ], i = 1, 2, the output is y i [ n ] = b 0 x i [ n ] + b1x i [ n − 1] + b 2 x i [ n − 2] + a1y i [ n − 1] + a 2 y i [ n − 2], i = 1, 2. Then, for an input x[ n ] = A x1[ n ] + Bx 2 [ n ], the output is y[ n ] = A ( b 0 x1[ n ] + b1x1[ n − 1] + b 2 x1[ n − 2] + a1y1[ n − 1] + a 2 y1[ n − 2])

+ B ( b 0 x 2 [ n ] + b1x 2 [ n − 1] + b 2 x 2 [ n − 2] + a1y 2 [ n − 1] + a 2 y 2 [ n − 2]) = A y1[ n ] + By 2 [ n ]. Hence, the system is linear.

x i [ n / L ], n = 0, ± L, ± 2 L, K (c) For an input x i [ n ], i = 1, 2, the output is y i [ n ] =,  otherwise, 0,  Consider the input x[ n ] = A x1[ n ] + Bx 2 [ n ], Then the output y[n] for n = 0, ± L, ± 2 L, K is given by y[n] = x[ n / L ] = A x1[ n / L ] + Bx 2 [ n / L ] = A y1[ n ] + By 2 [ n ] . For all other values of n, y[ n ] = A ⋅ 0 + B ⋅ 0 = 0. Hence, the system is linear. (d) For an input x i [ n ], i = 1, 2, the output is y i [ n ] = x i [ n / M] . Consider the input x[ n ] = A x1[ n ] + Bx 2 [ n ], Then the output y[ n ] = A x1[ n / M] + Bx 2 [ n / M] = A y1[ n ] + By 2 [ n ]. Hence, the system is linear. (e) For an input x i [ n ], i = 1, 2, the output is y i [ n ] = input x[ n ] = A x1[ n ] + Bx 2 [ n ], the output is y i [ n ] =

1 M −1 x i [ n − k ]. Then, for an ∑ M k =0

1 M −1 (A x1[n − k ] + Bx 2 [n − k ]) ∑ M k =0

M −1 M −1 1  1  x [n − k ] + B x [ n − k ] = A y1[ n ] + By 2 [ n ]. Hence, the system is  M ∑k =0 1   M ∑k =0 2  linear.

=A

(f) The first term on the RHS of Eq. (2.58) is the output of an up-sampler. The second term on the RHS of Eq. (2.58) is simply the output of an unit delay followed by an upsampler, whereas, the third term is the output of an unit adavance operator followed by an up-sampler We have shown in Part (c) that the up-sampler is a linear system. Moreover, the delay and the advance operators are linear systems. A cascade of two linear systems is linear and a linear combination of linear systems is also linear. Hence, the factor-of-2 interpolator is a linear system. (g) Following thearguments given in Part (f), it can be shown that the factor-of-3 interpolator is a linear system. 2.26

(a) y[n] = n2 x[n]. For an input xi[n] the output is yi[n] = n2x i[n], i = 1, 2. Thus, for an input x3[n] = Ax1[n] + Bx2[n], the output y3[n] is given by y 3[ n ] = n 2 ( A x1[ n ] + Bx 2 [ n ]) = A y1[ n ] + By 2 [ n ] . Hence the system is linear. Since there is no output before the input hence the system is causal. However, y[ n ] being proportional to n, it is possible that a bounded input can result in an unbounded output. Let x[n] = 1 ∀ n , then y[n] = n2. Hence y[ n ] → ∞ as n → ∞ , hence not BIBO stable. Let y[n] be the output for an input x[n], and let y1[n] be the output for an input x1[n]. If x1[n] = x[n − n 0 ] then y1[n] = n 2 x1[n] = n 2 x[n − n 0 ]. However, y[n − n 0 ] = (n − n 0 )2 x[n − n 0 ] . Since y1[n] ≠ y[n − n 0 ] , the system is not time-invariant.

10

(b) y[n] = x 4 [n] . For an input x1 [n] the output is yi[n] = xi4 [n], i = 1, 2. Thus, for an input x3[n] = Ax1[n] + Bx 2[n], the output y3[n] is given by y 3[ n ] = ( A x1[ n ] + Bx 2 [ n ]) 4 ≠ A 4 x14 [ n ] + A 4 x 24 [ n ] Hence the system is not linear. Since there is no output before the input hence the system is causal. Here, a bounded input produces bounded output hence the system is BIBO stable too. Let y[n] be the output for an input x[n], and let y1[n] be the output for an input x1[n]. If x1[n] = x[n − n 0 ] then y1[ n ] = x14 [ n ] = x 4 [ n − n 0 ] = y[ n − n 0 ]. Hence, the system is timeinvariant. 3

(c) y[n] = β +

∑ x[n − l].

l= 0

For an input xi[n] the output is y i [ n ] = β +

3

∑ x i [n − l] , i = 1, 2.

l= 0

Thus, for an input x3[n] =

Ax 1[n] + Bx2[n], the output y3[n] is given by y[ n ] = β +

3

3

3

l= 0

l= 0

l= 0

∑ (A x1[n − l] + Bx 2 [n − l]) = β + ∑ A x1[n − l] + ∑ Bx 2 [n − l]

≠ A y1[ n ] + By 2 [ n ]. Since β ≠ 0 hence the system is not linear. Since there is no output before the input hence the system is causal. Here, a bounded input produces bounded output hence the system is BIBO stable too. Also following an analysis similar to that in part (a) it is easy to show that the system is timeinvariant. 3

(d) y[ n ] = β +



x[ n − l]

l= –3

For an input xi[n] the output is y i [ n ] = β +

3



l= –3

x i [ n − l] , i = 1, 2. Thus, for an input x3[n] =

Ax 1[n] + Bx2[n], the output y3[n] is given by y[ n ] = β +

3

3

l=−3

l=−3

∑ (A x1[n − l] + Bx 2 [n − l]) = β + ∑

A x1[ n − l] +

3



l=−3

Bx 2 [ n − l]

≠ A y1[ n ] + By 2 [ n ]. Since β ≠ 0 hence the system is not linear. Since there is output before the input hence the system is non-causal. Here, a bounded input produces bounded output hence the system is BIBO stable.

11

Let y[n] be the output for an input x[n], and let y1[n] be the output for an input x1[n]. If x1[n] = x[n − n 0 ] then y1[ n ] = β +

3



l= –3

x1[ n − l] = β +

3



l= –3

x1[ n − n 0 − l] = y[ n − n 0 ]. Hence the

system is time-invariant. (e) y[ n ] = α x[ − n ] The system is linear, stable, non causal. Let y[n] be the output for an input x[n] and y1[n] be the output for an input x1[n]. Then y[ n ] = α x[ − n ] and y1[ n ] = α x1[ − n ] . Let x1[n] = x[n − n 0 ], then y1[ n ] = α x1[ − n ] = α x[ − n − n 0 ], whereas y[ n − n 0 ] = α x[ n 0 − n ]. Hence the system is time-varying. (f) y[n] = x[n – 5] The given system is linear, causal, stable and time-invariant. 2.27 y[n] = x[n + 1] – 2x[n] + x[n – 1]. Let y1[n] be the output for an input x1[n] and y 2 [n] be the output for an input x 2 [n]. Then for an input x 3[n] = αx1[n] + βx 2 [n] the output y 3[n] is given by y 3[n] = x 3[n + 1] − 2x 3[n] + x 3[n − 1] = αx1[n + 1] − 2αx1[n] + αx1[n − 1] + βx 2 [n + 1] − 2βx 2 [n] + βx 2 [n − 1] = αy1[n] + βy 2 [n]. Hence the system is linear. If x1[n] = x[n − n 0 ] then y1[n] = y[n − n 0 ]. Hence the system is time-inavariant. −2, h[n] =  1,  0,

Also the system's impulse response is given by n = 0, n = 1,-1, elsewhere.

Since h[n] ≠ 0 ∀ n < 0 the system is non-causal. 2.28 Median filtering is a nonlinear operation. Consider the following sequences as the input to a median filter: x1[n] = {3, 4, 5} and x 2 [n] = {2, − 2, − 2} . The corresponding outputs of the median filter are y1[n] = 4 and y 2 [n] = −2 . Now consider another input sequence x3[n] = x 1 [n] + x2 [n]. Then the corresponding output is y 3[n] = 3, On the other hand,

y1[ n ] + y 2 [ n ] = 2 . Hence median filtering is not a linear operation. To test the timeinvariance property, let x[n] and x1[n] be the two inputs to the system with correponding outputs y[n] and y1 [n]. If x1[n] = x[n − n 0 ] then y1[n] = median{x1[n − k ],......., x1[n],.......x1[n + k ]} = median{x[n − k − n 0 ],......., x[n − n 0 ],.......x[n + k − n 0 ]} = y[n − n 0 ]. Hence the system is time invariant.

12

2.29

y[n] =

1 x[n]   y[n − 1] +  2 y[n − 1]

Now for an input x[n] = α µ[n], the ouput y[n] converges to some constant K as n → ∞ . 1 α The above difference equation as n → ∞ reduces to K =  K +  which is equivalent to  2 K K 2 = α or in other words, K = α . It is easy to show that the system is non-linear. Now assume y1[n] be the output for an x [n]  1 input x1 [n]. Then y1[n] =  y1[n − 1] + 1 2 y1[n − 1] If x1[n] = x[n − n 0 ]. Then, y1[n] =

x[n − n 0 ] 1 y1[n − 1] + .  2 y1[n − 1] 

Thus y1[n] = y[n − n 0 ]. Hence the above system is time invariant. 2.30 For an input x i [ n ], i = 1, 2, the input-output relation is given by y i [ n ] = x i [ n ] − y 2i [ n − 1] + y i [ n − 1]. Thus, for an input Ax1[n] + Bx2[n], if the output is Ay 1[n] + By2[n], then the input-output relation is given by A y1[ n ] + By 2 [ n ] = A x1[ n ] + Bx 2 [ n ] − ( A y1[ n − 1] + By 2 [ n − 1]) + A y1[ n − 1] + By 2 [ n − 1] = A x1[ n ] + Bx 2 [ n ] − A 2 y12 [ n − 1] − B2 y 22 [ n − 1] + 2 ABy1[ n − 1]y 2 [ n − 1] + A y1[ n − 1] + By 2 [ n − 1] 2

≠ A x1[ n ] − A 2 y12 [ n − 1] + A y1[ n − 1] + Bx 2 [ n ] − B2 y 22 [ n − 1] + By 2 [ n − 1]. Hence, the system is nonlinear. Let y[n] be the output for an input x[n] which is related to x[n] through y[ n ] = x[ n ] − y 2 [ n − 1] + y[ n − 1]. Then the input-output realtion for an input x[ n − n o ] is given by y[ n − n o ] = x[ n − n o ] − y 2 [ n − n o − 1] + y[ n − n o − 1], or in other words, the system is timeinvariant. Now for an input x[n] = α µ[n], the ouput y[n] converges to some constant K as n → ∞ . The above difference equation as n → ∞ reduces to K = α − K 2 + K , or K 2 = α , i.e. K= α. 2.31 As δ[ n ] = µ[ n ] − µ[ n − 1] , Τ{δ[n]} = Τ{µ[n]} − Τ{µ[n − 1]} ⇒ h[ n ] = s[ n ] − s[ n − 1] For a discrete LTI system ∞

y[n] =





h[k]x[n − k ] =

k =−∞

2.32

∑ (s[k] − s[k − 1])x[n − k] =

k =−∞









s[k ]x[n − k ] −

k =−∞

∑ s[k − 1]x[n − k]

k =−∞



y[ n ] = ∑ m =−∞ h[ m ] x˜ [ n − m ] . Hence, y[ n + kN ] = ∑ m =−∞ h[ m ] x˜ [ n + kN − m ] ∞

= ∑ m =−∞ h[ m ] x˜ [ n − m ] = y[ n ]. Thus, y[n] is also a periodic sequence with a period N.

13

2.33

Now δ[ n − r ] * δ[ n − s] =



∑ m =−∞ δ[m − r ] δ[n − s − m] = δ[n − r − s]

(a) y1[ n ] = x1[ n ] * h1[ n ] = (2δ[ n − 1] − 0.5δ[ n − 3]) * (2δ[ n ] + δ[ n − 1] − 3 δ[ n − 3]) = 4 δ[ n − 1] * δ[ n ] – δ[ n − 3] * δ[ n ] + 2 δ[ n − 1] * δ[ n − 1] – 0.5 δ[ n − 3] * δ[ n − 1] – 6 δ[ n − 1] * δ[ n − 3] + 1.5 δ[ n − 3] * δ[ n − 3] = 4 δ[ n − 1] – δ[ n − 3] + 2 δ[ n − 1] – 0.5 δ[ n − 4] – 6 δ[ n − 4] + 1.5 δ[ n − 6] = 4 δ[ n − 1] + 2 δ[ n − 1] – δ[ n − 3] – 6.5 δ[ n − 4] + 1.5 δ[ n − 6] (b) y 2 [ n ] = x 2 [ n ] * h 2 [ n ] = ( −3δ[ n − 1] + δ[ n + 2]) * ( −δ[ n − 2] − 0.5 δ[ n − 1] + 3 δ[ n − 3]) = − 0.5 δ[ n + 1] − δ[ n ] + 3 δ[ n − 1] + 1.5 δ[ n − 2] + 3 δ[ n − 3] − 9 δ[ n − 4] (c) y 3[ n ] = x1[ n ] * h 2 [ n ] = (2δ[n − 1] − 0.5δ[n − 3]) * (−δ[n − 2] − 0.5 δ[n − 1] + 3 δ[n − 3]) = − δ[ n − 2] − 2 δ[ n − 3] − 6.25 δ[ n − 4] + 0.5 δ[ n − 5] – 1.5 δ[ n − 6] (d) y 4 [ n ] = x 2 [ n ] * h1[ n ] = ( −3δ[ n − 1] + δ[ n + 2]) * (2δ[ n ] + δ[ n − 1] − 3 δ[ n − 3]) = 2 δ[ n + 2] + δ[ n + 1] − δ[ n − 1] − 3 δ[ n − 2] – 9 δ[ n − 4] 2.34 y[ n ] = ∑ m2= N g[ m ] h[ n − m ] . Now, h[n – m] is defined for M1 ≤ n − m ≤ M 2 . Thus, for N

1

m = N1 , h[n–m] is defined for M1 ≤ n − N1 ≤ M 2 , or equivalently, for M1 + N1 ≤ n ≤ M 2 + N1 . Likewise, for m = N 2 , h[n–m] is defined for M1 ≤ n − N 2 ≤ M 2 , or equivalently, for M1 + N 2 ≤ n ≤ M 2 + N 2 . (a) The length of y[n] is M 2 + N 2 − M1 – N1 + 1 . (b) The range of n for y[ n ] ≠ 0 is min(M1 + N1, M1 + N 2 ) ≤ n ≤ max(M 2 + N1, M 2 + N 2 ) , i.e., M1 + N1 ≤ n ≤ M 2 + N 2 . 2.35 y[n] = x1 [n] * x 2 [n] =



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

Now, v[n] = x1[n – N1] * x 2 [n – N2 ] = k − N 2 = m. Then v[n] =





∑ k =−∞ x1[n − N1 − k ] x 2 [ k − N 2 ].

Let

∑ m =−∞ x1[n − N1 − N 2 − m] x 2 [m] = y[n − N1 − N 2 ],

2.36 g[n] = x1 [n] * x 2 [n] * x 3 [n] = y[n] * x 3 [n] where y[n] = x1 [n] * x 2 [n]. Define v[n] = x 1 [n – N1 ] * x 2 [n – N2 ]. Then, h[n] = v[n] * x3[n – N3] . From the results of Problem 2.32, v[n] = y[ n − N1 − N 2 ] . Hence, h[n] = y[ n − N1 − N 2 ] * x 3 [n – N3 ] . Therefore, using the results of Problem 2.32 again we get h[n] = g[n– N1– N2– N3] .

14



2.37 y[n] = x[n] * h[n] =

∑ x[n − k]h[k].

k =−∞



∑ x[m]h[n − m] = h[n]

get y[n] =

Substituting k by n-m in the above expression, we

* x[n]. Hence convolution operation is commutative.

m =−∞

(

)

Let y[n] = x[n] * h1[n] + h 2 [n] = = =



k =∞

k =−∞

k =−∞



∑ x[n − k](h1[k] + h 2[k])

k =−∞

∑ x[n − k]h1[k] + ∑ x[n − k]h 2[k] = x[n]

* h 1 [n] + x[n] * h2[n]. Hence convolution is

distributive. 2.38

x 3 [n] * x 2 [n] * x 1 [n] = x3 [n] * (x 2 [n] * x 1 [n]) As x2[n] * x1[n] is an unbounded sequence hence the result of this convolution cannot be determined. But x2[n] * x 3 [n] * x 1 [n] = x2 [n] * (x 3 [n] * x 1 [n]) . Now x3 [n] * x 1 [n] = 0 for all values of n hence the overall result is zero. Hence for the given sequences x 3 [n] * x 2 [n] * x 1 [n] ≠ x2 [n] * x 3 [n] * x 1 [n] .

2.39 w[n] = x[n] * h[n] * g[n]. Define y[n] = x[n] * h[n] = h[n] * g[n] =

∑ g[k] h[n − k].

∑ x[k] h[n − k] and f[n] = k

Consider w1[n] = (x[n] * h[n]) * g[n] = y[n] * g[n]

k

∑ g[m] ∑ x[k] h[n − m − k]. m k = ∑ x[k ] ∑ g[m] h[n − k − m]. =

k

Next consider w2[n] = x[n] * (h[n] * g[n]) = x[n] * f[n] Difference between the expressions for w1[n] and w2[n] is

m

that the order of the summations is changed. A) Assumptions: h[n] and g[n] are causal filters, and x[n] = 0 for n < 0. This implies for m < 0, 0,  y[m] =  m  k = 0 x[k ] h[m − k ], for m ≥ 0.



Thus, w[n] =

n−m

∑m = 0 g[m] y[n − m] = ∑m = 0 g[m] ∑ k = 0 x[k] h[n − m − k] . n

n

All sums have only a finite number of terms. Hence, interchange of the order of summations is justified and will give correct results. B) Assumptions: h[n] and g[n] are stable filters, and x[n] is a bounded sequence with x[n] ≤ X. Here, y[m] =



∑ k =−∞ h[k] x[m − k] = ∑ k = k k2

ε k , k [m] ≤ ε n X. 1 2

15

1

h[k ] x[m − k ] + ε k , k [m] with 1 2

In this case all sums have effectively only a finite number of terms and the error can be reduced by choosing k1 and k2 sufficiently large. Hence in this case the problem is again effectively reduced to that of the one-sided sequences. Here, again an interchange of summations is justified and will give correct results. Hence for the convolution to be associative, it is sufficient that the sequences be stable and single-sided. 2.40 y[n] =



∑ k =−∞ x[n − k]h[k].

Since h[k] is of length M and defined for 0 ≤ k ≤ M – 1, the

convolution sum reduces to y[n] =

(M −1)

∑k =0

x[n − k ]h[k ]. y[n] will be non-zero for all those

values of n and k for which n – k satisfies 0 ≤ n − k ≤ N − 1. Minimum value of n – k = 0 and occurs for lowest n at n = 0 and k = 0. Maximum value of n – k = N–1 and occurs for maximum value of k at M – 1. Thus n – k = M – 1 ⇒ n = N + M − 2 . Hence the total number of non-zero samples = N + M – 1. ∞

2.41 y[n] = x[n] * x[n] =

∑ x[n − k]x[k].

k =−∞

Since x[n – k] = 0 if n – k < 0 and x[k] = 0 if k < 0 hence the above summation reduces to N −1 0 ≤ n ≤ N − 1,  n + 1, y[n] = x[n − k ]x[k ] =  2N − n, N ≤ n ≤ 2N − 2. k=n



Hence the output is a triangular sequence with a maximum value of N. Locations of the output samples with values N 2

with values N 4

otherwise

are n =

N 2

N 4

N 4

are n =

– 1 and

3N 2

– 1 and

7N 4

– 1. Locations of the output samples

– 1. Note: It is tacitly assumed that N is divisible by 4

is not an integer.

N −1

2.42 y[ n ] = ∑ k = 0 h[ k ] x[ n − k ]. The maximum value of y[n] occurs at n = N–1 when all terms in the convolution sum are non-zero and is given by N( N + 1) N −1 N y[ N − 1] = ∑ k = 0 h[ k ] = ∑ k =1 k = . 2 ∞

2.43

(a) y[n] = gev [n] * hev[n] =





h ev [n − k ]g ev [k ] . Hence, y[–n] =

k =−∞

∑ h ev[−n − k]gev[k].

k =−∞

Replace k by – k. Then above summation becomes ∞



y[− n] =



h ev [− n + k ]g ev [− k ] =

k =−∞





h ev [−(n − k )]g ev [− k ] =

k =−∞

= y[n]. Hence gev[n] * hev[n] is even.

16

∑ h ev[(n − k)]gev[k]

k =−∞



∑ h od [(n − k)]gev[k] . As a result,

y[n] = gev [n] * h od [n] =

(b)



y[–n] =



h od [(− n − k )]g ev [k ] =

k =−∞

k =−∞ ∞



k =−∞

k =−∞

∑ h od [−(n − k)]gev[−k] = − ∑ h od [(n − k)]gev[k].

Hence gev[n] * h od [n] is odd. ∞

(c)

y[n] = god [n] * h od [n] = ∞

y[–n] =



∑ h od [n − k]god [k]. As a result,

k =−∞ ∞

h od [− n − k ]g od [k ] =

k =−∞





h od [−(n − k )]g od [− k ] =

k =−∞

∑ h od [(n − k)]god [k].

k =−∞

Hence god [n] * hod[n] is even. 2.44 (a) The length of x[n] is 7 – 4 + 1 = 4. Using x[ n ] = we arrive at x[n] = {1 3 –2 12}, 0 ≤ n ≤ 3 (b) The length of x[n] is 9 – 5 + 1 = 5. Using x[ n ] = arrive at x[n] = {1

1

1

}

{

}

{

}

1 9 y[ n ] − ∑ k =1 h[ k ] x[ n − k ] , we h[0]

1}, 0 ≤ n ≤ 4.

1

{

1 7 y[ n ] − ∑ k =1 h[ k ] x[ n − k ] , h[0]

1 5 y[ n ] − ∑ k =1 h[ k ] x[ n − k ] , we get h[0] x[n] = {−4 + j, −0.6923 + j 0.4615, 3.4556 + j1.1065} , 0 ≤ n ≤ 2. (c) The length of x[n] is 5 – 3 + 1 = 3. Using x[ n ] =

2.45

y[n] = ay[n – 1] + bx[n]. Hence, y[0] = ay[–1] + bx[0]. Next, y[1] = ay[0] + bx[1] = a 2 y[−1] + a b x[0] + b x[1] . Continuing further in similar way we obtain y[n] = a n +1y[−1] +

∑ k = 0 a n − k b x[k]. n

(a) Let y1[n] be the output due to an input x1[n]. Then y1[n] = a n +1y[−1] + If x1[n] = x[n – n 0 ] then y1[n] = a

n +1

y[−1] +

n

∑a

k=n0

However, y[n − n 0 ] = a

n−k

b x[k − n 0 ] = a

n − n 0 +1

y[−1] +

n +1

y[−1] +

n

∑ a n − k b x1[k].

k =0

n−n0

∑ a n − n 0 − r b x[r]. r =0

n−n0

∑ a n − n 0 − r b x[r]. r =0

Hence y1[n] ≠ y[n − n 0 ] unless y[–1] = 0. For example, if y[–1] = 1 then the system is time variant. However if y[–1] = 0 then the system is time -invariant.

17

(b)

Let y1 [n] and y2 [n] be the outputs due to the inputs x1 [n] and x2 [n]. Let y[n] be the output for an input α x1[n] + β x 2 [n]. However, αy1[n] + βy 2 [n] = α a n +1y[−1] + β a n +1y[−1] + α whereas y[n] = a

n +1

n

y[−1] + α

∑a

k =0

n−k

n



k =0

a n − k b x1[k ] + β

n

∑ a n − k b x 2 [k]

k =0

n

b x1[k ] + β

∑ a n − k b x 2 [ k ].

k =0

Hence the system is not linear if y[–1] = 1 but is linear if y[–1] = 0. (c)

Generalizing the above result it can be shown that for an N-th order causal discrete time system to be linear and time invariant we require y[–N] = y[–N+1] = L = y[–1] = 0.

2.46 ystep [ n ] = ∑ k = 0 h[ k ] µ[ n − k ] = ∑ k = 0 h[ k ], n ≥ 0, and ystep [ n ] = 0, n < 0. Since h[k] is nonnegative, ystep [ n ] is a monotonically increasing function of n for n ≥ 0, and is not oscillatory. Hence, no overshoot. n

2.47

n

(a) f[n] = f[n – 1] + f[n – 2]. Let f[n] = αr n , then the difference equation reduces to 1± 5 αr n − αr n −1 − αr n − 2 = 0 which reduces to r 2 − r − 1 = 0 resulting in r = . 2 n

n

1+ 5  1− 5  Thus, f[n] = α1  + α2   .  2   2  Since f[0] = 0 hence α1 + α 2 = 0 . Also f[1] = 1 hence

α1 + α 2 2

α − α2 + 5 1 = 1. 2 n

n

1 1 1+ 5  1 1− 5  . Hence, f[n] = Solving for α1 and α 2 , we get α1 = – α 2 =   −   . 5 5 2  5 2  (b) y[n] = y[n – 1] + y[n – 2] + x[n – 1]. As system is LTI, the initial conditions are equal to zero. Let x[n] = δ[ n ]. Then, y[n] = y[n – 1] + y[n – 2] + δ[ n − 1]. Hence, y[0] = y[– 1] + y[– 2] = 0 and y[1] = 1. For n > 1 the corresponding difference equation is y[n] = y[n – 1] + y[n – 2] with initial conditions y[0] = 0 and y[1] = 1, which are the same as those for the solution of Fibonacci's sequence. Hence the solution for n > 1 is given by n

1 1+ 5  1 1− 5  y[n] =   −   5 2  5 2 

n

Thus f[n] denotes the impulse response of a causal LTI system described by the difference equation y[n] = y[n – 1] + y[n – 2] + x[n – 1]. 2.48 y[n] = αy[n −1]+ x[n] . Denoting, y[n] = yre[n] + j yim [n], and α = a + jb, we get, y re [n] + jy im [n] = (a + jb)(y re [n − 1] + jy im [n − 1]) + x[n] .

18

Equating the real and the imaginary parts , and noting that x[n] is real, we get y re [n] = a y re [n − 1] − b y im [n − 1] + x[n],

(1)

y im [n] = b y re [n − 1] + a y im [n − 1] Therefore y im [n − 1] =

1 b y im [n] − y re [n − 1] a a

Hence a single input, two output difference equation is b b2 y re [n] = ay re [n − 1] − y im [n] + y [n − 1] + x[n] a a re thus b y im [n − 1] = −a y re [n − 1] + (a 2 + b 2 )y re [n − 2] + a x[n − 1] . Substituting the above in Eq. (1) we get y re [n] = 2a y re [n − 1] − (a 2 + b 2 )y re [n − 2] + x[n] − a x[n − 1] which is a second-order difference equation representing y re [n] in terms of x[n]. 2.49 From Eq. (2.59), the output y[n] of the factor-of-3 interpolator is given by 1 2 y[ n ] = x u [ n ] + ( x u [ n − 1] + x u [ n + 2]) + ( x u [ n − 2] + x u [ n + 1]) where x u [ n ] is the output of 3 3 the factor-of-3 up-sampler for an input x[n]. To compute the impulse response we set x[n] = δ[ n ] , in which case, x u [ n ] = δ[3n ]. As a result, the impulse response is given by 1 2 h[ n ] = δ[3n ] + (δ[3n − 3] + δ[3n + 6]) + (δ[3n − 6] + δ[3n + 3]) or 3 3 1 2 1 2 = δ[ n + 2] + δ[ n + 1] + δ[ n ] + δ[ n − 1] + δ[ n − 2]. 3 3 3 3 2.50 The output y[n] of the factor-of-L interpolator is given by 1 2 y[ n ] = x u [ n ] + ( x u [ n − 1] + x u [ n + L − 1]) + ( x u [ n − 2] + x u [ n + L − 2]) L L L −1 +K + (x u [n − L + 1] + x u [n + 1]) where x u [n] is the output of the factor-of-L upL sampler for an input x[n]. To compute the impulse response we set x[n] = δ[ n ] , in which case, x u [ n ] = δ[ Ln ]. As a result, the impulse response is given by 1 2 h[ n ] = δ[ Ln ] + (δ[ Ln − L ] + δ[ Ln + L( L − 1)]) + (δ[ Ln − 2 L ] + δ[ Ln + L( L − 2)]) L L 1 2 L −1 +K + (δ[Ln − L(L – 1)] + δ[Ln + L]) = δ[n + (L − 1)] + δ[n + (L − 2)] + K L L L L −1 1 2 L −1 + δ[ n + 1] + δ[ n ] + δ[ n − 1] + δ[ n − 2] + δ[ n − ( L − 1)] L L L L 2.51 The first-order causal LTI system is characterized by the difference equation y[n] = p 0 x[n] + p1x[n − 1] − d1y[n − 1] . Letting x[n] = δ[ n ] we obtain the expression for its impulse response h[ n ] = p 0 δ[ n ] + p1δ[ n − 1] − d1h[ n − 1] . Solving it for n = 0, 1, and 2, we get h[0] = p 0 , h[1] = p1 − d1h[0] = p1 − d1p 0 , and h[2] = − d1h[1] == − d1 ( p1 − d1p 0 ). Solving these h[2] h[2]h[0] , and p1 = h[1] − equations we get p 0 = h[0], d1 = − . h[1] h[1]

19

M

2.52



k =0

N

p k x[n − k ] =

∑ d k y[n − k].

k =0

Let the input to the system be x[ n ] = δ[ n ] . Then,

M

N

k =0

k =0

∑ p kδ[n − k] = ∑ d k h[n − k]. Thus,

N

pr =

∑ d k h[r − k].

Since the system is assumed to be causal, h[r – k] = 0 ∀ k > r.

k =0 r

pr =



k =0

r

d k h[r − k ] =

∑ h[k] d r − k .

k =0

2.53 The impulse response of the cascade is given by h[n] = h1[n] * h2[n] where  n  n n α k β n − k  µ[n] . h1[n] = α µ[n] and h 2 [n] = β µ[n] . Hence, h[n] =     k =0 



2.54 Now, h[n] = α n µ[n]. Therefore y[n] = = x[n] +







h[k ] x[n − k ] =



k =−∞ ∞

k =1

k =0

∑ α k x[n − k]

k =0

∑ α k x[n − k] = x[n] + α ∑ α k x[n − 1 − k] = x[n] + αy[n − 1] .

Hence, x[n] = y[n] – αy[n − 1] . Thus the inverse system is given by y[n] = x[n] – αx[n − 1].   The impulse response of the inverse system is given by g[n] = 1 −α  . ↑  2.55 y[ n ] = y[ n − 1] + y[ n − 2] + x[ n − 1]. Hence, x[n – 1] = y[n] – y[n – 1] – y[n – 2], i.e. x[n] = y[n + 1] – y[n] – y[n – 1]. Hence the inverse system is characterised by   y[n] = x[n + 1] – x[n] – x[n – 1] with an impulse response given by g[n] = 1 –1 –1. ↑   d p 1 2.56 y[n] = p 0 x[n] + p1x[n − 1] − d1y[n − 1] which leads to x[n] = y[n] + 1 y[n − 1] − 1 x[n − 1] p0 p0 p0 Hence the inverse system is characterised by the difference equation d p 1 y1[n] = x1[n] + 1 x1[n − 1] − 1 y1[n − 1]. p0 p0 p0 2.57 (a) From the figure shown below we observe v[n] ↓ h [n] x[n] h1[n] 2 h 5[n] h 3 [n]

h 4 [n]

20

y[n]

v[n] = (h1 [n] + h3 [n] * h 5 [n]) * x[n] and y[n] = h2 [n] * v[n] + h3[n] * h 4 [n] * x[n]. Thus, y[n] = (h2 [n] * h 1 [n] + h2 [n] * h 3 [n] * h 5 [n] + h3 [n] * h 4 [n]) * x[n]. Hence the impulse response is given by h[n] = h2 [n] * h 1 [n] + h2 [n] * h 3 [n] * h 5 [n] + h3 [n] * h 4 [n] (b)

From the figure shown below we observe h 4 [n]

x[n]

h1 [n ]

h 2 [n]

v[n] ↓

h 3[n]

y[n]

h 5 [n]

v[n] = h4 [n] * x[n] + h1 [n] * h 2 [n] * x[n]. Thus, y[n] = h3 [n] * v[n] + h1[n] * h 5 [n] * x[n] = h3 [n] * h 4 [n] * x[n] + h3 [n] * h 1 [n] * h 2 [n] * x[n] + h1 [n] * h 5 [n] * x[n] Hence the impulse response is given by h[n] = h3 [n] * h 4 [n] + h3 [n] * h 1 [n] * h 2 [n] + h1 [n] * h 5 [n] 2.58 h[ n ] = h1[ n ] * h 2 [ n ] + h 3[ n ] Now h1[ n ] * h 2 [ n ] = (2 δ[ n − 2] − 3 δ[ n + 1]) * (δ[ n − 1] + 2 δ[ n + 2]) = 2 δ[ n − 2] * δ[ n − 1] – 3 δ[ n + 1] * δ[ n − 1] + 2 δ[ n − 2] * 2 δ[ n + 2] – 3 δ[ n + 1] * 2 δ[ n + 2] = 2 δ[ n − 3] – 3δ[ n ] + 4 δ[ n ] – 6 δ[ n + 3] = 2 δ[ n − 3] + δ[ n ] – 6 δ[ n + 3] . Therefore, y[n] = 2 δ[ n − 3] + δ[ n ] – 6 δ[ n + 3] + 5 δ[ n − 5] + 7 δ[ n − 3] + 2 δ[ n − 1] − δ[ n ] + 3 δ[ n + 1] = 5 δ[ n − 5] + 9 δ[ n − 3] + 2 δ[ n − 1] + 3 δ[ n + 1] − 6 δ[ n + 3] 2.59 For a filter with complex impulse response, the first part of the proof is same as that for a ∞

filter with real impulse response. Since, y[n] = y[n] =





k =−∞

k =−∞

∑ h[k]x[n − k],

k =−∞

∑ h[k]x[n − k] ≤ ∑ h[k] x[n − k].

Since the input is bounded hence 0 ≤ x[ n ] ≤ Bx . Therefore, y[n] ≤ Bx ∞

So if

∑ h[k] = S < ∞ then



∑ h[k].

k =−∞

y[ n ] ≤ BxS indicating that y[n] is also bounded.

k =−∞

21

To proove the converse we need to show that if a bounded output is produced by a bounded h *[− n] . input then S < ∞ . Consider the following bounded input defined by x[n] = h[− n] ∞



Then y[0] =

k =−∞

h *[k ]h[k ] = h[k ]



∑ h[k] = S.

Now since the output is bounded thus S < ∞ .

k =−∞



Thus for a filter with complex response too is BIBO stable if and only if

∑ h[k] = S < ∞ .

k =−∞

2.60 The impulse response of the cascade is g[n] = h1[n] * h2[n] or equivalently, ∞

g[k ] =

r = –∞





∑ h1[k − r] h 2[r].

g[k ] =

k = –∞



Thus,



 ∞  ∞  h1[k – r ] h 2 [r ] ≤  h1[k ]  h 2 [r] .     k = –∞   r = –∞  k = –∞ r = –∞

∑ ∑



Since h1[n] and h2[n] are stable,



∑ h1[k] < ∞ and ∑ h 2[k] < ∞ . Hence, ∑ g[k] < ∞. k

k

k

Hence the cascade of two stable LTI systems is also stable.

2.61 The impulse response of the parallel structure g[n] = h1[n] + h2[n] . Now, ∑ g[ k ] = ∑ h1[ k ] + h 2 [ k ] ≤ ∑ h1[ k ] + ∑ h 2 [ k ]. Since h1[n] and h2[n] are stable, k

k

k

k

∑ h1[k] < ∞ and ∑ h 2[k] < ∞ . Hence, ∑ g[k] < ∞. Hence the parallel connection of k

k

k

two stable LTI systems is also stable.

2.62 Consider a cascade of two passive systems. Let y1[n] be the output of the first system which is the input to the second system in the cascade. Let y[n] be the overall output of the cascade. ∞

The first system being passive we have





∑ x[n] 2 .

2

y1[n] ≤

n =−∞

n =−∞

Likewise the second system being also passive we have



∑ y[n]

n =−∞

2





∑ y1[n]

n =−∞

2





∑ x[n] 2 ,

n =−∞

indicating that cascade of two passive systems is also a passive system. Similarly one can prove that cascade of two lossless systems is also a lossless system. 2.63 Consider a parallel connection of two passive systems with an input x[n] and output y[n]. The outputs of the two systems are y1[ n ] and y 2 [ n ], respectively. Now, ∞

∑ n =−∞ y1[n]

2



≤ ∑ n =−∞ x[ n ] 2 , and



∑ n =−∞ y2 [n]

2



≤ ∑ n =−∞ x[ n ] 2 .

Let y1[ n ] = y 2 [ n ] = x[ n ] satisfying the above inequalities. Then y[ n ] = y1[ n ] + y 2 [ n ] = 2 x[ n ] ∞





and as a result, ∑ n =−∞ y[ n ] = 4 ∑ n =−∞ x[ n ] 2 > ∑ n =−∞ x[ n ] 2 . Hence, the parallel connection of two passive systems may not be passive. 2

22

M

2.64 Let



k =0

N

p k x[n − k ] = y[n] +

∑ d k y[n − k] be the difference equation representing the causal k =1

IIR digital filter. For an input x[ n ] = δ[ n ] , the corresponding output is then y[n] = h[n], the impulse response of the filter. As there are M+1 {pk} coefficients, and N {dk} coefficients, there are a total of N+M+1 unknowns. To determine these coefficients from the impulse response samples, we compute only the first N+M+1 samples. To illstrate the method, without any loss of generality, we assume N = M = 3. Then , from the difference equation reprsentation we arrive at the following N+M+1 = 7 equations: h[0] = p 0 , h[1] + h[0] d1 = p1, h[2] + h[1] d1 + h[0] d 2 = p 2 , h[3] + h[2] d1 + h[1] d 2 + h[0] d 3 = p3 , h[4] + h[3] d1 + h[2] d 2 + h[1] d 3 = 0, h[5] + h[4] d1 + h[3] d 2 + h[2] d 3 = 0, h[6] + h[5] d1 + h[4] d 2 + h[3] d 3 = 0. Writing the last three equations in matrix form we arrive at h[4]  h[3] h[2] h[1]   d1  0  h[5] + h[4] h[3] h[2] d 2  = 0, h[6]  h[5] h[4] h[3] d  0  3  d1   h[3] and hence, d 2  = – h[4]    h[5] d 3  Substituting these values p 0  h[0]  p   h[1] p 1  = h[2]  2   h[3]  p3  

h[1]  h[2] h[3]

h[2] h[3] h[4]

–1

h[4]  h[5]. h[6]

of {di} in the first four equations written in matrix form we get 0 h[0] h[1] h[2]

0  1  0   d1  0  d 2 . h[0] d   3

0 0 h[0] h[1]

2.65 y[ n ] = y[ −1] + ∑ l= 0 x[l] = y[ −1] + ∑ l= 0 lµ[l] = y[ −1] + ∑ l= 0 l = y[ −1] + n

n

(a) For y[–1] = 0, y[n] =

n( n + 1) . 2

n( n + 1) 2

(b) For y[–1] = –2, y[n] = –2 + 2.66 y( nT ) = y(( n – 1)T ) + ∫

n

nT

( n −1)T

n( n + 1) n2 + n − 4 = . 2 2

x( τ) dτ = y(( n – 1)T ) + T ⋅ x(( n – 1)T ). Therefore, the difference

equation representation is given by y[ n ] = y[ n − 1] + T ⋅ x[ n − 1], where y[ n ] = y( nT ) and x[ n ] = x( nT ).

23

1 n 1 n −1 1 1 n −1 x[l] = ∑ l=1 x[l] + x[ n ], n ≥ 1. y[ n − 1] = x[l], n ≥ 1. Hence, ∑ ∑ l = 1 l =1 n n n n −1 n −1 ∑ l=1 x[l] = (n − 1)y[n − 1]. Thus, the difference equation representation is given by

2.67 y[ n ] =

y[ n ] = 2.68

1  n − 1 y[ n − 1] + x[ n ]. n ≥ 1.  n  n

y[ n ] + 0.5 y[ n − 1] = 2 µ[ n ], n ≥ 0 with y[ −1] = 2. The total solution is given by y[ n ] = y c [ n ] + y p [ n ] where y c [ n ] is the complementary solution and y p [ n ] is the particular solution. y c [ n ] is obtained ny solving y c [ n ] + 0.5 y c [ n − 1] = 0 . To this end we set y c [ n ] = λn , which

yields λn + 0.5 λn −1 = 0 whose solution gives λ = −0.5. Thus, the complementary solution is of the form y c [ n ] = α( −0.5) n . For the particular solution we choose y p [ n ] = β. Substituting this solution in the difference equation representation of the system we get β + 0.5 β = 2 µ[ n ]. For n = 0 we get β(1 + 0.5) = 2 or β = 4 / 3. 4 The total solution is therefore given by y[ n ] = y c [ n ] + y p [ n ] = α( −0.5) n + , n ≥ 0. 3 1 −1 4 Therefore y[–1] = α( −0.5) + = 2 or α = – . Hence, the total solution is given by 3 3 1 4 n y[n] = – ( −0.5) + , n ≥ 0. 3 3 2.69 y[ n ] + 0.1 y[ n − 1] − 0.06 y[ n − 2] = 2 n µ[ n ] with y[–1] = 1 and y[–2] = 0. The complementary solution y c [ n ] is obtained by solving y c [ n ] + 0.1 y c [ n − 1] − 0.06 y c [ n − 2] = 0 . To this end we set y c [ n ] = λn , which yields λn + 0.1 λn −1 – 0.06 λn − 2 = λn − 2 (λ2 + 0.1 λ – 0.06) = 0 whose solution gives λ1 = –0.3 and λ 2 = 0.2 . Thus, the complementary solution is of the form y c [ n ] = α1 ( −0.3) n + α 2 (0.2) n . For the particular solution we choose y p [ n ] = β(2) n . ubstituting this solution in the difference equation representation of the system we get β 2 n + β (0.1)2 n −1 – β (0.06)2 n − 2 = 2 n µ[ n ]. For n = 0 we get β + β (0.1)2 −1 – β (0.06)2 −2 = 1 or β = 200 / 207 = 0.9662 . The total solution is therefore given by y[ n ] = y c [ n ] + y p [ n ] = α1 ( −0.3) n + α 2 (0.2) n +

200 n 2 . 207

200 −1 2 = 1 and 207 10 107 200 −2 and y[ −2] = α1 ( −0.3) −2 + α 2 (0.2) −2 + 2 = 0 or equivalently, – α1 + 5 α 2 = 3 207 207 100 50 α1 + 25 α 2 = – whose solution yields α1 = –0.1017 and α 2 = 0.0356. Hence, the total 9 207 solution is given by y[n] = −0.1017( −0.3) n + 0.0356(0.2) n + 0.9662(2) n , for n ≥ 0.

From the above y[ −1] = α1 ( −0.3) −1 + α 2 (0.2) −1 +

2.70 y[ n ] + 0.1 y[ n − 1] − 0.06 y[ n − 2] = x[ n ] − 2 x[ n − 1] with x[ n ] = 2 n µ[ n ] , and y[–1] = 1 and y[–2] = 0. For the given input, the difference equation reduces to y[ n ] + 0.1 y[ n − 1] − 0.06 y[ n − 2] = 2 n µ[ n ] − 2 (2 n −1 ) µ[ n − 1] = δ[ n ]. The solution of this

24

equation is thus the complementary solution with the constants determined from the given initial conditions y[–1] = 1 and y[–2] = 0. From the solution of the previous problem we observe that the complementary solution is of the form y c [ n ] = α1 ( −0.3) n + α 2 (0.2) n . For the given initial conditions we thus have y[ −1] = α1 ( −0.3) −1 + α 2 (0.2) −1 = 1 and y[ −2] = α1 ( −0.3) −2 + α 2 (0.2) −2 = 0 . Combining these −1 / 0.3 1 / 0.2   α1  1  two equations we get     =   which yields α1 = − 0.18 and α 2 = 0.08. 1 / 0.09 1 / 0.04  α 2  0  Therefore, y[ n ] = − 0.18 ( −0.3) n + 0.08 (0.2) n . 2.71

The impulse response is given by the solution of the difference equation y[ n ] + 0.5 y[ n − 1] = δ[ n ]. From the solution of Problem 2.68, the complementary solution is given by y c [ n ] = α( −0.5) n . To determine the constant we note y[0] = 1 as y[–1] = 0. From the complementary solution y[0] = α(–0.5)0 = α, hence α = 1. Therefore, the impulse response is given by h[ n ] = ( −0.5) n .

2.72 The impulse response is given by the solution of the difference equation y[ n ] + 0.1 y[ n − 1] − 0.06 y[ n − 2] = δ[ n ] . From the solution of Problem 2.69, the complementary solution is given by y c [ n ] = α1 ( −0.3) n + α 2 (0.2) n . To determine the constants α1 and α 2 , we observe y[0] = 1 and y[1] + 0.1y[0] = 0 as y[–1] = y[–2] = 0. From the complementary solution y[0] = α1 ( −0.3)0 + α 2 (0.2)0 = α1 + α 2 = 1, and y[1] = α1 ( −0.3)1 + α 2 (0.2)1 = –0.3 α1 + 0.2α 2 = −0.1. Solution of these equations yield α1 = 0.6 and α 2 = 0.4. Therefore, the impulse response is given by h[ n ] = 0.6( −0.3) n + 0.4(0.2) n . A n +1 K n +1 K 2.73 Let A n = n K (λ i ) n . Then n +1 = λ i . Now lim = 1. Since λ i < 1, there exists An n n →∞ n A 1 + λi ∞ < 1. Hence ∑ n= 0 A n a positive integer N o such that for all n > N o , 0 < n +1 < An 2 converges. 2.74 (a) x[ n ] = {3 −2 0 1 4 5 2} , −3 ≤ n ≤ 3. rxx [l] = ∑ n =−3 x[ n ] x[ n − l] . Note, 3

rxx [ −6] = x[3] x[ −3] = 2 × 3 = 6, rxx [ −5] = x[3] x[ −2] + x[2] x[ −3] = 2 × ( −2) + 5 × 3 = 11, rxx [ −4] = x[3] x[ −1] + x[2] x[ −2] + x[1] x[ −3] = 2 × 0 + 5 × ( −2) + 4 × 3 = 2, rxx [ −3] = x[3] x[0] + x[2] x[ −1] + x[1] x[ −2] + x[0] x[ −3] = 2 × 1 + 5 × 0 + 4 × ( −2) + 1 × 3 = −3, rxx [ −2] = x[3] x[1] + x[2] x[0] + x[1] x[ −1] + x[0] x[ −2] + x[ −1] x[ −3] = 11, rxx [ −1] = x[3] x[2] + x[2] x[1] + x[1] x[0] + x[0] x[ −1] + x[ −1] x[ −2] + x[ −2] x[ −3] = 28, rxx [0] = x[3] x[3] + x[2] x[2] + x[1] x[1] + x[0] x[0] + x[ −1] x[ −1] + x[ −2] x[ −2] + x[ −3] x[ −3] = 59. The samples of rxx [l] for 1 ≤ l ≤ 6 are determined using the property rxx [l] = rxx [ − l] . Thus, rxx [l] = {6 11 2 −3 11 28 59 28 11 −3 2 11 6}, −6 ≤ l ≤ 6. y[ n ] = {0 7 1 −3 4 9 −2} , −3 ≤ n ≤ 3. Following the procedure outlined above we get

25

ryy [l] = {0 −14 61 43 −52 10 160 10 −52 43 61 −14 0}, −6 ≤ l ≤ 6. w[ n ] = {−5 4 3 6 −5 0 1}, −3 ≤ n ≤ 3. Thus,

rww [l] = {−5 4 28 −44 −11 −20 112 −20 −11 −44 28 4 −5}, −6 ≤ l ≤ 6.

(b) rxy [l] = ∑ n =−3 x[ n ] y[ n − l]. Note, rxy [ −6] = x[3] y[ −3] = 0, rxy [ −5] = x[3] y[ −2] + x[2] y[ −3] = 14, rxy [ −4] = x[3] y[ −1] + x[2] y[ −2] + x[1] y[ −3] = 37, rxy [ −3] = x[3] y[0] + x[2] y[ −1] + x[1] y[ −2] + x[0] y[ −3] = 27, rxy [ −2] = x[3] y[1] + x[2] y[0] + x[1] y[ −1] + x[0] y[ −2] + x[ −1] y[ −3] = 4, rxy [ −1] = x[3] y[2] + x[2] y[1] + x[1] y[0] + x[0] y[ −1] + x[ −1] y[ −2] + x[ −2] y[ −3] = 27, rxy [0] = x[3] y[3] + x[2] y[2] + x[1] y[1] + x[0] y[0] + x[ −1] y[ −1] + x[ −2] y[ −2] + x[ −3] y[ −3] = 40, rxy [1] = x[2] y[3] + x[1] y[2] + x[0] y[1] + x[ −1] y[0] + x[ −2] y[ −1] + x[ −3] y[ −2] = 49, rxy [2] = x[1] y[3] + x[0] y[2] + x[ −1] y[1] + x[ −2] y[0] + x[ −3] y[ −1] = 10, rxy [3] = x[0] y[3] + x[ −1] y[2] + x[ −2] y[1] + x[ −3] y[0] = −19, rxy [ 4] = x[ −1] y[3] + x[ −2] y[2] + x[ −3] y[1] = −6, rxy [5] = x[ −2] y[3] + x[ −3] y[2] = 31, rxy [6] = x[ −3] y[3] = −6. Hence, 3

rxy [l] = {0 14 37 27 4 27 40 49 10 −19 −6 31 −6,} , −6 ≤ l ≤ 6. rxw [l] = ∑ n =−3 x[ n ] w[ n − l] = {−10 −17 6 38 36 12 −35 6 1 29 −15 −2 3}, 3

−6 ≤ l ≤ 6.





2.75 (a) x1[ n ] = α n µ[ n ]. rxx [l] = ∑ n =−∞ x1[ n ] x1[ n − l] = ∑ n =−∞ α n µ[ n ] ⋅ α n − lµ[ n − l]  ∞ α −l 2n −l = α , for l < 0, ∑ n = 0 2  ∞ 2n −l − α 1 µ[ n − l] =  = ∑n =0 α l  ∞ α2n −l = α for l ≥ 0. ∑  n = l 1 − α2

Note for l≥ 0, rxx [l] =

αl 1− α

, and for l< 0, rxx [l] = 2

second expression we get rxx [ − l] = of l.

α −( − l)

α −l

1 − α2

. Replacing l with −l in the

αl = = rxx [l]. Hence, rxx [l] is an even function 1 − α2 1 − α2

Maximum value of rxx [l] occurs at l= 0 since α l is a decaying function for increasing l when α < 1. 1, 0 ≤ n ≤ N − 1, 1, l ≤ n ≤ N − 1 + l, N −1 (b) x 2 [ n ] =  rxx [l] = ∑ n = 0 x 2 [ n − l], where x 2 [ n − l] =  otherwise. otherwise. 0, 0,

26

for l < −( N − 1),  0, N + l, for – ( N – 1) ≤ l < 0,  for l = 0, Therefore, rxx [l] =  N, N − l, for 0 < l ≤ N − 1,  for l > N − 1.  0, It follows from the above rxx [l] is a trinagular function of l, and hence is even with a maximum value of N at l = 0  πn  2.76 (a) x1[ n ] = cos where M is a positive integer. Period of x1[ n ] is 2M, hence  M 1 1 2 M −1 2 M −1  πn   π( n + l)  rxx [l] = x1[ n ] x1[ n + l] = cos cos ∑ ∑ = = n 0 n 0    M  2M 2M M 1 1 2 M −1  πn    πn   πl  πn   πl   πl 2 M −1 2  πn  = cos cos cos − sin sin = cos cos .   ∑ n = 0  M  M  M  M   M   2M  M  ∑n =0  M 2M From the solution of Problem 2.16 rxx [l] =

2 M −1

∑n =0

cos2

 πn  2 M = = M. Therefore,  M 2

1  πn  cos .  M 2

(b) x 2 [ n ] = n mod ulo 6 = {0 1 2 3 4 5}, 0 ≤ n ≤ 5. It is a peridic sequence with a period 1 5 6. Thus,, rxx [l] = ∑ n = 0 x 2 [ n ] x 2 [ n + l], 0 ≤ l ≤ 5. It is also a peridic sequence with a period 6. 6 1 55 rxx [0] = ( x 2 [0]x 2 [0] + x 2 [1]x 2 [1] + x 2 [2]x 2 [2] + x 2 [3]x 2 [3] + x 2 [ 4]x 2 [ 4] + x 2 [5]x 2 [5]) = , 6 6 1 40 rxx [1] = ( x 2 [0]x 2 [1] + x 2 [1]x 2 [2] + x 2 [2]x 2 [3] + x 2 [3]x 2 [ 4] + x 2 [ 4]x 2 [5] + x 2 [5]x 2 [0]) = , 6 6 1 32 rxx [2] = ( x 2 [0]x 2 [2] + x 2 [1]x 2 [3] + x 2 [2]x 2 [ 4] + x 2 [3]x 2 [5] + x 2 [ 4]x 2 [0] + x 2 [5]x 2 [1]) = , 6 6 1 28 rxx [3] = ( x 2 [0]x 2 [3] + x 2 [1]x 2 [ 4] + x 2 [2]x 2 [5] + x 2 [3]x 2 [0] + x 2 [ 4]x 2 [1] + x 2 [5]x 2 [2]) = , 6 6 1 31 rxx [ 4] = ( x 2 [0]x 2 [ 4] + x 2 [1]x 2 [5] + x 2 [2]x 2 [0] + x 2 [3]x 2 [1] + x 2 [ 4]x 2 [2] + x 2 [5]x 2 [3]) = , 6 6 1 40 rxx [5] = ( x 2 [0]x 2 [5] + x 2 [1]x 2 [0] + x 2 [2]x 2 [1] + x 2 [3]x 2 [2] + x 2 [ 4]x 2 [3] + x 2 [5]x 2 [ 4]) = . 6 6 (c) x 3[ n ] = ( −1) n . It is a periodic squence with a period 2. Hence, 1 1 1 rxx [l] = ∑ n = 0 x 3[ n ] x 3[ n + l], 0 ≤ l ≤ 1. rxx [0] = ( x 2 [0]x 2 [0] + x 2 [1]x 2 [1]) = 1, and 2 2 1 rxx [1] = ( x 2 [0]x 2 [1] + x 2 [1]x 2 [0]) = −1. It is also a periodic squence with a period 2. 2 2.77 E{X + Y} = ∫∫ ( x + y)p XY ( x, y)dxdy = ∫∫ x p XY ( x, y)dxdy + ∫∫ y p XYy ( x, y)dxdy

(

)

(

)

= ∫ x ∫ p XY ( x, y)dy dx + ∫ y ∫ p XY ( x, y)dx dy = ∫ x p X ( x)dx + ∫ y p Y ( y)dy

27

= E{X} + E{Y}. From the above result, E{2X} = E(X + X} = 2 E{X}. Similarly, E{cX} = E{(c–1)X + X} = E{(c–1)X} + E{X}. Hence, by induction, E{cX} = cE{x}.

{

}

2.78 C = E (X − κ )2 . To find the value of κ that minimize the mean square error C, we

differentiate C with respect to κ and set it to zero. Thus

dC = E{2( X − κ )} = E{2 X} − E{2 K} = 2 E{X} − 2 K = 0. which results in κ = E{X}, and dκ

the minimum value of C is σ 2x . 2.79 mean = m x = E{x} =





−∞

xp X ( x)dx

variance = σ 2x = E{(x − m x )2} =



∫−∞ (x − m x )2 pX (x)dx

α 1  α ∞ xdx x ( a ) p X ( x) =  2 . Since 2 is odd hence the  . Now, m x = 2 π x +α  π −∞ x 2 + α 2 x + α2 integral is zero. Thus m x = 0 .



σ 2x =

2 α ∞ x dx . Since this integral does not converge hence variance is not defined for π −∞ x 2 + α 2



this density function. α α ∞ −α x (b) p x (x) = e −α x . Now, m x = xe dx = 0 . Next, 2 2 −∞   2 −αx ∞ ∞ ∞ 2 −αx 2x −αx  x e 2 α ∞ 2 −α x σx = x e dx = α x e dx = α  + e dx 2 −∞ 0   −α 0 0 α ∞  ∞ 2 −αx  2x e −αx  2  = α 0 + + e dx = 2 . 2 α −α 0 α  α  0











n

(c) p x (x) =

∑  nl pl(1 − p)n − lδ(x − l) .

l= 0 n ∞ n

∫−∞l∑ =0

mx = x

  p l(1 − p)n − lδ(x − l)dx =  l

2 2 2 σ x = E{x } − m x =



Now, n

∑  nl pl(1 − p)n − l= np

l= 0

n

2  n p l(1 − p)n − lδ(x − l)dx − (np)2 ∫−∞x l∑  l =0

n

=

∑ l2  nl pl(1 − p)n − l− n 2 p2 = n p(1− p).

l= 0

(d) p x (x) =





l= 0

e −α α l δ(x − l) . Now, l!

28

∞ ∞

∫−∞l∑ =0

mx = x σ 2x

= E{x

e −α α l δ(x − l)dx = l!

2

} − m 2x

α ∞ 2 = x 2 −∞







e −α α l l = α. l!

l= 0 ∞ −α l



e

l= 0

α δ(x − l) dx − α 2 = l!





l= 0

l2

e −α α l − α2 = α . l!

2 2 x (e) p x (x) = 2 e − x / 2α µ(x) . Now, α 1 ∞ 2 − x 2 / 2α 2 1 ∞ 2 − x 2 / 2α 2 mx = 2 x e x e dx = α π / 2 . µ(x)dx = 2 α −∞ α 0 2 π 1 ∞ 3 − x 2 / 2α 2 α π  = 2 −  α2. σ 2x = E{x 2} − m 2x = 2 x e µ(x)dx −  2 2 α −∞







2.80

Recall that random variables x and y are linearly independent if and only if 2 E  a1x + a 2 y > 0 ∀ a1,a 2 except when a1 = a2 = 0, Now,   2 2 2 2 2 2 2 E  a1 x + E  a 2 y + E (a1 ) * a 2 x y * + E a1(a 2 ) * x * y = a1 E x 2 + a 2 E y > 0     ∀ a1 and a 2 except when a1 = a2 = 0. Hence if x,y are statistically independent they are also linearly independent.

{

{

2.81 σ 2x = E (x − m x )2

} = E{x

2

} {

}

{ }

{ }

}

+ m 2x − 2xm x = E{x 2} + E{m 2x} − 2E{xm x}.

2 2 Since m x is a constant, hence E{m 2x} = m x and E{xm x} = m x E{x} = m x . Thus, 2 2 2 2 2 2 σ x = E{x } + m x − 2m x = E{x } − m x .

2.82

V = aX + bY. Therefore, E{V} = a E{X} + b E{Y} = a m x + b m y . and σ 2v = E{(V − m v )2} = E{(a(X − m x ) + b(Y − m y ))2}. 2 2 2 2 2 Since X,Y are statistically independent hence σ v = a σ x + b σ y .

2.83 v[ n ] = a x[ n ] + b y[ n ]. Thus φ vv [ n ] = E{v[ m + n} v[ m ]} = E a 2 x[ m + n} x[ m ] + b 2 y[ m + n} y[ m ] + ab x[ m + n ] y[ m ] + ab x[ m ] y[ m + n ] . Since x[n] and y[n] are independent,

{

}

{

} {

}

φ vv [ n ] = E a 2 x[ m + n} x[ m ] + E b 2 y[ m + n} y[ m ] = a 2 φ xx [ n ] + b 2 φ yy [ n ] . φ vx [ n ] = E{v[ m + n ] x[ m ]} = E{a x[ m + n ]x[ m ] + b y[ m + n ]x[ m ]} = a E{x[ m + n ]x[ m ]} = a φ xx [ n ]. Likewise, φ vy [ n ] = b φ yy [ n ]. 2.84 φ xy [l]= E{x[n + l] y *[n]}, φ xy [– l]= E{x[n – l] y *[n]}, φ yx [l]= E{y[n + l] x *[n]}. Therefore, φ yx *[l]= E{y *[n + l] x[n]} = E{x[n – l] y *[n]}= φ xy [– l].

29

Hence φ xy [−l] = φ yx *[ll] . Since γ xy [l] = φ xy [l]− m x (m y )* . Thus, γ xy [l] = φ xy [l] − m x (m y )* . Hence, γ xy [l] = φ xy [l] − m x (m y )* . As a result, γ xy *[l] = φ xy *[l] − (m x )*m y . Hence, γ xy [−l] = γ yx *[l]. The remaining two properties can be proved in a similar way by letting x = y.

{ } E{ x[n] } + E{ x[n − l] } − E{x[n]x *[n − l]} − E{x *[n]x[n − l]} ≥ 0

2.85 E x[n] − x[n − l] 2 ≥ 0. 2

2

2φ xx [0] − 2φ xx [l] ≥ 0 φ xx [0] ≥ φ xx [l]

{ } { 2} ≤ E2 {xy} . Hence, φxx[0] φyy[0] ≤ φxy[l]

Using Cauchy's inequality E x 2 E y

2

.

2

One can show similarly γ xx [0] γ yy [0] ≤ γ xy [l] . 2.86 Since there are no periodicities in {x[n]} hence x[n], x[n+ l] become uncorrelated as l→ ∞.. Thus

2

2

lim γ xx [l] = lim φ xx [l] − m x → 0. Hence lim φ xx [l] = m x . l→∞ l→∞ l→∞

2.87 φ XX [l] =

9 + 11 l2 + 14 l4

2 9 + 11 l2 + 14 l4 = 7. = = . Now, m lim [ l ] lim φ X[ n ] XX l →∞ l →∞ 1 + 3 l2 + 2 l4 1 + 3 l2 + 2 l4

(

)

Hence, m X[ n ] = m 7. E X[ n ] 2 = φ XX [0] = 9. Therefore, σ 2X = φ XX [0] − m X

2

= 9 − 7 = 2.

M2.1

L = input('Desired length = '); n = 1:L; FT = input('Sampling frequency = ');T = 1/FT; imp = [1 zeros(1,L-1)];step = ones(1,L); ramp = (n-1).*step; subplot(3,1,1); stem(n-1,imp); xlabel(['Time in ',num2str(T), ' sec']);ylabel('Amplitude'); subplot(3,1,2); stem(n-1,step); xlabel(['Time in ',num2str(T), ' sec']);ylabel('Amplitude'); subplot(3,1,3); stem(n-1,ramp); xlabel(['Time in ',num2str(T), ' sec']);ylabel('Amplitude');

M2.2

% Get user inputs A = input('The peak value ='); L = input('Length of sequence ='); N = input('The period of sequence ='); FT = input('The desired sampling frequency ='); DC = input('The square wave duty cycle = '); % Create signals T = 1/FT;

30

t = 0:L-1; x = A*sawtooth(2*pi*t/N); y = A*square(2*pi*(t/N),DC); % Plot subplot(211) stem(t,x); ylabel('Amplitude'); xlabel(['Time in ',num2str(T),'sec']); subplot(212) stem(t,y); ylabel('Amplitude'); xlabel(['Time in ',num2str(T),'sec']); 10

Amplitude

5 0 -5 -10 0

20

40 60 Time in 5e-05 sec

80

100

40 60 Time in 5e-05 sec

80

100

10

Amplitude

5 0 -5 -10

0

20

M2.3 (a) The input data entered during the execution of Program 2_1 are Type Type Type Type

in in in in

real exponent = -1/12 imaginary exponent = pi/6 the gain constant = 1 length of sequence = 41

31

Real part

1

0.5 Amplitude

Amplitude

0.5 0 -0.5 -1

Imaginary part

1

0 -0.5

0

10

20 Time index n

30

-1

40

0

10

20 Time index n

30

40

(b) The input data entered during the execution of Program 2_1 are Type Type Type Type

in in in in

real exponent = -0.4 imaginary exponent = pi/5 the gain constant = 2.5 length of sequence = 101

Real part

1.5

1 Amplitude

Amplitude

1 0.5 0 -0.5

Imaginary part

1.5

0.5 0

0

M2.4 (a)

10

20 Time index n

30

-0.5

40

0

10

20 Time index n

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)]);

(b)

32

30

40

ω = 0.14π o

2

Amplitude

1 0 -1 -2

0

10

20

30

40

50 60 Time index n

70

80

90

100

ω o = 0.24π

2

Amplitude

1 0 -1 -2 0

5

10

15

20 25 Time index n

30

35

40

ω = 0.68π o

2

Amplitude

1 0 -1 -2

0

10

20

30

40

50 60 Time index n

33

70

80

90

100

ω = 0.75π o

2

Amplitude

1 0 -1 -2

0

5

10

15

20 25 Time index n

30

35

40

M2.5 (a) Using Program 2_1 we generate the sequence x˜ 1[ n ] = e − j 0.4 πn shown below Real part 1

Amplitude

0.5 0 -0.5 -1 0

5

10

15

20 Time index n

25

30

35

40

25

30

35

40

Imaginary part 1

Amplitude

0.5 0 -0.5 -1 0

(b)

5

10

15

20 Time index n

Code fragment used to generate x˜ 2 [ n ] = sin(0.6 πn + 0.6 π ) is: x = sin(0.6*pi*n + 0.6*pi);

34

2

Amplitude

1 0 -1 -2 0

5

10

15

20 25 Time index n

30

35

40

(c) Code fragment used to generate x˜ 3[ n ] = 2 cos(1.1πn − 0.5π ) + 2 sin(0.7πn ) is

x = 2*cos(1.1*pi*n - 0.5*pi) + 2*sin(0.7*pi*n); 4

Amplitude

2 0 -2 -4 0

5

10

15

20 25 Time index n

30

35

40

(d) Code fragment used to generate x˜ 4 [ n ] = 3 sin(1.3πn ) − 4 cos(0.3πn + 0.45π ) is: x = 3*sin(1.3*pi*n) - 4*cos(0.3*pi*n+0.45*pi);

6

Amplitude

4 2 0 -2 -4 -6 0

(e)

5

10

15

20 25 Time index n

30

35

40

Code fragment used to generate x˜ 5 [ n ] = 5 sin(1.2 πn + 0.65π ) + 4 sin(0.8πn ) − cos(0.8πn ) is:

x = 5*sin(1.2*pi*n+0.65*pi)+4*sin(0.8*pi*n)-cos(0.8*pi*n);

35

10

Amplitude

5 0 -5 -10

(f)

0

5

10

15

20 25 Time index n

30

Code fragment used to generate x˜ 6 [ n ] = n mod ulo 6 is:

35

40

x = rem(n,6);

6

Amplitude

5 4 3 2 1 0 -1 0

5

10

15

20 25 Time index n

30

35

40

M2.6 t = 0:0.001:1; fo = input('Frequency of sinusoid in Hz = '); FT = input('Samplig 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 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 n = 0:1:8; gs = cos(0.6*pi*n); plot(n/8.5,gs,'o');hold off M2.8

As the length of the moving average filter is increased, the output of the filter gets more smoother. However, the delay between the input and the output sequences also increases (This can be seen from the plots generated by Program 2_4 for various values of the filter length.)

36

M2.9 alpha = input('Alpha = '); yo = 1;y1 = 0.5*(yo + (alpha/yo)); while abs(y1 - yo) > 0.00001 y2 = 0.5*(y1 + (alpha/y1)); yo = y1; y1 = y2; end disp('Square root of alpha is'); disp(y1) M2.10

alpha = input('Alpha = '); yo = 0.3; y = zeros(1,61); L = length(y)-1; y(1) = alpha - yo*yo + yo; n = 2; while abs(y(n-1) - yo) > 0.00001 y2 = alpha - y(n-1)*y(n-1) + y(n-1); yo = y(n-1); y(n) = y2; n = n+1; end disp('Square root of alpha is'); disp(y(n-1)) m=0:n-2; err = y(1:n-1) - sqrt(alpha); stem(m,err); axis([0 n-2 min(err) max(err)]); xlabel('Time index n'); ylabel('Error'); title(['\alpha = ',num2str(alpha)]) The displayed output is Square root of alpha is 0.84000349056114 α = 0.7056 0.06

Error

0.04 0.02 0 -0.02 -0.04 0

5

10 15 Time index n

20

25

M2.11 N = input('Desired impulse response length = '); p = input('Type in the vector p = '); d = input('Type in the vector d = '); [h,t] = impz(p,d,N); n = 0:N-1; stem(n,h); xlabel('Time index n');ylabel('Amplitude');

37

1.5

Amplitude

1 0.5 0 -0.5 -1 0

10

20 Time index n

40

x = [3 −2 0 1 4 5 2] y = [0 7 1 −3 4 9 −2] , w = [ −5 4 3 6 −5 0 1].

M2.12 (a)

rxx [ n ] = [6

11

2

ryy [ n ] = [0 -14 rww [ n ] = [–5

-3

61 4

11

28

43 -52

59

28

10 160

11

-3

10 -52

2 43

11 6], 61 -14 0],

28 –44 –11 –20 112 –20 –11 –44

60

28

4 –5].

150

50

rxx[n]

30 20

50 0

10 0 -6

-4

-2

0 2 Lag index

4

ryy[n]

100 Amplitude

40

-50 -6

6

-4

100

Amplitude

Amplitude

30

(b)

rxy [ n ] = [ –6

-2

r

ww

0 2 Lag index

4

[n]

50 0 -50 -6

-4

31

–6 –19

-2

0 2 Lag index

10

38

49

40

4

27

6

4

27

37

14 0].

6

rxw [ n ] = [3 –2 –15

29

1

6 –35

12

36

38

6 –17 –10].

50

50 0 -50 -6

M2.13

r

rxy[n]

Amplitude

Amplitude

100

-4

-2

0 2 Lag index

4

-4

-2

0 2 Lag index

N = input('Length of sequence = '); n = 0:N-1; x = exp(-0.8*n); y = randn(1,N)+x; n1 = length(x)-1; r = conv(y,fliplr(y)); k = (-n1):n1; stem(k,r); xlabel('Lag index');ylabel('Amplitude'); gtext('r_{yy}[n]'); 30 r [n]

Amplitude

20

yy

10 0 -10 -30

-20

-10

0 Lag index

10

20

30

M2.14 (a) n=0:10000; phi = 2*pi*rand(1,length(n)); A = 4*rand(1,length(n)); x = A.*cos(0.06*pi*n + phi); stem(n(1:100),x(1:100));%axis([0 50 -4 4]); xlabel('Time index n');ylabel('Amplitude'); mean = sum(x)/length(x) var = sum((x - mean).^2)/length(x)

39

[n]

0

-50 -6

6

xw

4

6

4

2

2 Amplitude

Amplitude

4

0

-2

-2

20

40 60 Time index n

80

-4 0

100

4

4

2

2 Amplitude

Amplitude

-4 0

0

0

40 60 Time index n

80

100

40 60 Time index n

80

100

0 -2

-2 -4

20

-4

0

20

40 60 Time index n

80

100

0

20

mean = 0.00491782302432 var = 2.68081196077671 From Example 2.44, we note that the mean = 0 and variance = 8/3 = 2.66667. M2.15

n=0:1000; z = 2*rand(1,length(n)); y = ones(1,length(n));x=z-y; mean = mean(x) var = sum((x - mean).^2)/length(x) mean = 0.00102235365812 var = 0.34210530830959

(1 + 1)2 1 1−1 2 = = . It should = 0, and σ X Using Eqs. (2. 129) and (2.130) we get m X = 22 3 2 be noted that the values of the mean and the variance computed using the above MATLAB program get closer to the theoretical values if the length is increased. For example, for a length 100001, the values are mean = 9.122420593670135e-04

40

var = 0.33486888516819

41