47
ECE 531: Detection and Estimation Theory, Spring 2011 Homework 1 ALL SOLUTIONS BY Shu Wang – thanks for submitting latex file in 1st homework! Problem1 (2.1) Solution: E[ ˆ σ 2 ]= E[ 1 N N-1 n=0 x 2 [n]] = 1 N N-1 n=0 E[x 2 [n]] = 1 N 2 = σ 2 So this is an unbiased estimator. V ar( ˆ σ 2 )= V ar( 1 N N-1 n=0 x 2 [n]) = 1 N 2 N-1 n=0 V ar(x 2 [n]) = 1 N 2 N V ar(x 2 [n]) = 1 N V ar(x 2 [n]) According to x[n] is iid, then x 2 [n] is also iid. We know that V ar(x 2 [n]) = E[x 4 [n]] E[x 2 [n]] 2 . And according to central moment: E[(x μ) p ]= 0 if p is odd σ p (p 1)!! if p is even n!! denotes the double factorial, that is the product of every odd number from n to 1. And μ is the mean of x. In this problem, we know that the mean of x is 0. So we can have E[x 4 [n]] = 3σ 4 . So V ar(x 2 [n]) = 3σ 4 σ 4 =2σ 4 . Then we have V ar( ˆ σ 2 )= 1 N 2 N 2σ 4 = 2σ 4 N 1

Kay - Solutions

Embed Size (px)

Citation preview

Page 1: Kay - Solutions

ECE 531: Detection and Estimation Theory, Spring 2011

Homework 1ALL SOLUTIONS BY Shu Wang – thanks for submitting latex file in 1st homework!

Problem1 (2.1)Solution:

E[σ2] = E[1

N

N−1∑

n=0

x2[n]]

=1

N

N−1∑

n=0

E[x2[n]]

=1

NNσ2

= σ2

So this is an unbiased estimator.

V ar(σ2) = V ar(1

N

N−1∑

n=0

x2[n])

=1

N2

N−1∑

n=0

V ar(x2[n])

=1

N2NV ar(x2[n])

=1

NV ar(x2[n])

According to x[n] is iid, then x2[n] is also iid. We know that V ar(x2[n]) = E[x4[n]] − E[x2[n]]2.And according to central moment:

E[(x − µ)p] =

{

0 if p is odd

σp(p − 1)!! if p is even

n!! denotes the double factorial, that is the product of every odd number from n to 1. And µ is themean of x. In this problem, we know that the mean of x is 0. So we can have E[x4[n]] = 3σ4. SoV ar(x2[n]) = 3σ4 − σ4 = 2σ4. Then we have

V ar(σ2) =1

N2N2σ4 =

2σ4

N

1

Page 2: Kay - Solutions

And V ar(σ2) → 0 as N → ∞Problem2 (2.3)Solution:

E[A] = E[1

N

N−1∑

n=0

x[n]]

=1

N

N−1∑

n=0

E[x[n]]

=1

NNA = A

V ar(A) = V ar(1

N

N−1∑

n=0

x[n])

=1

N2NV ar(x[n])

=1

Nσ2

=σ2

N

According to x[n] is iid. Gaussian distributed. So we have A ∼ N (A, σ2

N).

Problem3 (2.8)Solution:From 2.3, we know that A ∼ N (A, σ2

N). Then we can have:

limN→∞

Pr{|A − A| > ǫ} = limN→∞

Pr{|A − A|√

σ2

N

σ2

N

}

According to Q-function, we will have

limN→∞

Pr{|A − A|√

σ2

N

σ2

N

} = limN→∞

Q(ǫ

σ2

N

)

= limN→∞

Q(ǫ√

N

σ)

= 0

2

Page 3: Kay - Solutions

So A is consistent.

E[A] = E[1

2N

N−1∑

n=0

x[n]]

=1

2N

N−1∑

n=0

E[x[n]]

=1

2NNA

=A

2

V ar(A) = V ar(1

2N

N−1∑

n=0

x[n])

=1

4N2

N−1∑

n=0

V ar(x[n])

=1

4N2Nσ2

=σ2

4N

According to x[n] is iid white Gaussian. So A ∼ N (A2, σ2

4N). Then we can have:

limN→∞

Pr{|A − A| > ǫ} = limN→∞

Pr{|A − A|√

σ2

4N

σ2

4N

}

Also according to Q-function, we can have:

limN→∞

Pr{|A − A|√

σ2

4N

σ2

4N

} = limN→∞

Q(ǫ

σ2

4N

)

= limN→∞

Q(ǫ√

4N

σ) = 0

A is a biased estimator. It is centered at A2. So A is not consistent.

Problem4 (2.9)

3

Page 4: Kay - Solutions

Solution:

E[θ] = E[(1

N

N−1∑

n=0

x[n])2]

= V ar(1

N

N−1∑

n=0

x[n]) + E[1

N

N−1∑

n=0

x[n]]2

=σ2

N+ A2

6= θ

So this is a biased estimator. E[θ] → A2 as N → ∞, this estimator becomes unbiased. Thisestimator is asymptotically unbiased.

4

Page 5: Kay - Solutions

ECE 531 - Detection and Estimation TheoryHomework 2Solutions

3.3 (Luke Vercimak) The data x[n] = Arn + w[n] for n = 0, 1, . . . , N − 1 are observed, wherew[n] is WGN with variance σ2 and r > 0 is known. Find the CRLB for A. Show that anefficient estimator exists and find its variance. What happens to the variance as N →∞ forvarious values of r

The pdf is:

p(x,A) =1

(2πσ2)N2

exp

[−12σ2

N−1∑n=0

[x[n]−Arn]2]

∂ ln p(x,A)∂A

=−12σ2

N−1∑n=0

2 [x[n]−Arn] (−1)rn

∂ ln p(x,A)∂A

=−1σ2

N−1∑n=0

[x[n]rn +Ar2n

]∂2 ln p(x,A)

∂A2=−1σ2

N−1∑n=0

r2n

I(A) = −E

[−1σ2

N−1∑n=0

r2n

]

I(A) =1σ2

N−1∑n=0

r2n

I(A) =1σ2

r2N − 1r2 − 1

CRLB(A) =σ2

Nif r=1,

σ2(r2 − 1)r2N − 1

otherwise

If r ≥ 1, A→ A. If r < 1, A→∞.

3.11 (Luke Vercimak) For a 2× 2 Fisher information matrix

I (θ) =[a bb c

]which is positive definite, show that[

I−1 (θ)]11

=c

ac− b2≥ 1a

=1

[I (θ)]11

1

Page 6: Kay - Solutions

What does this say about estimating a parameter when a second parameter is either knownor unknown? When does equality hold and why?

I (θ) =[a bb c

]is positive definite ⇒

All principal minors are positive ⇒

det[a] = a > 0,det[a bb c

]= ac− b2 > 0⇒

ac ≥ ac− b2 ⇒c

ac− b2≥ 1a

This shows that the variance of a parameter estimate when estimating two parameters willbe less than or equal to estimating only the single parameter. The equality holds when b = 0.This implies that the first and second parameters are uncorrelated.

3.15 (Shu Wang) We know that x[n] ∼ N (0,C), and x[n]’s are independent. If we suppose i(ρ)is the fisher information of x[n]. Then we can have I(ρ) = Ni(ρ). According to equation 3.32of textbook, we can get:

i(ρ) = [∂µ(ρ)∂ρ

]TC−1(ρ)[∂µ(ρ)∂ρ

] +12tr[(C−1(ρ)

∂C(ρ)∂ρ

)2]

=12tr[(C−1(ρ)

∂C(ρ)∂ρ

)2]

According to x[n] ∼ N (0,C). Also because

C =(

1 ρρ 1

)Then we can have

∂C(ρ)∂ρ

=(

0 11 0

)Also we can get

C−1(ρ) =1

1− ρ2

(1 −ρ−ρ 1

)Then we can have

(C−1(ρ)∂C(ρ)∂ρ

)2 =1

(1− ρ2)2

(1 + ρ2 −2ρ−2ρ 1 + ρ2

)So 1

2 tr[(C−1(ρ)∂C(ρ)

∂ρ )2] = 1+ρ2

(1−ρ2)2. Then I(ρ) = N(1+ρ2)

(1−ρ2)and CRLB = 1

I(ρ) = (1−ρ2)2

N(1+ρ2)

2

Page 7: Kay - Solutions

ECE 531 - Detection and Estimation TheoryHomework 3

4.6 (Correction – Shu Wang) In this problem, we only have a single component. So θ =[ak, bk]T .According to Example 4.2, we have

C =

(2σ2

N 00 2σ2

N

)So ak ∼ N (ak, 2σ2

N ) and bk ∼ N (bk, 2σ2

N ). Also ak and bk are independent.

E[P ] = E[a2k + b2k

2]

= E[a2k

2] + E[

b2k2

]

=12

(E[a2k] + E[b2k])

=12

[V ar(ak) + E2[ak] + V ar(Bk) + E2[Bk]]

=12

[2σ2

N+ a2

k +2σ2

N+ b2k]

=2σ2

N+a2k + b2k

2

Suppose P = a2k+b

2k

2 . So E[P ] = 2σ2

N + P . Then E2[P ] = (2σ2

N + P )2.

V ar(P ) = V ar(a2k + b2k

2)

=14

[V ar(a2k) + V ar(b2k)]

According to textbook page38. Eq 3.19:If ξ ∼ N (µ, σ2), then

E[ξ2] = µ2 + σ4

E[ξ4] = µ4 + 6µ2σ2 + 3σ4

V ar(ξ2) = 4µ2σ2 + 2σ4

So V ar(a2k) = 4a2

k2σ2

N + 2(2σ2

N )2 and V ar(b2k) = 4b2k2σ2

N + 2(2σ2

N )2. Then we can have:V ar(P ) = (a2

k + b2k)(2σ2

N ) + (2σ2

N )2 = (2σ2

N )[2P + 2σ2

N ]

1

Page 8: Kay - Solutions

So

E2[P ]V ar(P )

=(2σ2

N + P )2

(2σ2

N )[2P + 2σ2

N ]

= 1 +(2P )2N2

4[2PN2σ2 + 4σ4]

If ak = bk = 0⇒ P = 0⇒ E2[P ]

V ar(P )= 1.

But if P >> 2σ2

N , then E2[P ]

V ar(P )= P 2

P 4σ2

N

= P4σ2

N

>> 1. Then signal will be easily detected.

4.13 (Shu Wang) In practice we sometimes encounter the “linear model” x = Hθ + w but Hcomposed of random variables. Suppose we ignore this difference and use our usual estimator

θ = (HTH)−1HTx

where we assume that the particular realization of H is known to us. Show that if H and ware independent, the mean and covariance of θ are

E(θ) = θ

Cθ = σ2EH[(HTH)−1

]where EH denotes the expectation with respect to the PDF of H. What happens if theindependence assumption is not made?

E[θ] = E[(HTH)−1HTx]

= E[(HTH)−1HT (Hθ + w)]

= E[(HTH)−1HTHθ] + E[(HTH)−1HTw]

According to H and w are independent. Also w has zero mean. Then we can have:

E[θ] = E[θ] + E[(HTH)−1HT ]E[w]= E[θ]= θ

2

Page 9: Kay - Solutions

Cθ = E[(θ − θ)(θ − θ)T ]

= E[((HTH)−1HTx− θ)((HTH)−1HTx− θ)T ]

= E[((HTH)−1HTx− (HTH)−1HTHθ)((HTH)−1HTx− (HTH)−1HTHθ)T ]

= E[((HTH)−1HT (x−Hθ))((HTH)−1HT (x−Hθ))T ]

= E[((HTH)−1HTw)((HTH)−1HTw)T ]

= EHw[(HTH)−1HTwwTH(HTH)−1]

= EH|wEw[(HTH)−1HTwwTH(HTH)−1]

= EH|w[(HTH)−1HTσ2IH(HTH)−1]

= EH|w[σ2(HTH)−1]

= σ2EH [(HTH)−1]

According to H and w are independent.If H and w are not independent. Then E[θ] may not equal to θ, so θ may be biased.

5.3 (Luke Vercimak) The IID observations x[n] for n = 0, 1, . . . , N − 1 have the exponentialPDF

p(x[n];λ) ={λ exp (−λx[n]) x[n] > 0

0 x[n] < 0

Find a sufficient statistic for λ

Since the observations are IID, the joint distribution is

p(x;λ) = λn exp

[N−1∑n=0

−λx[n]

]

=

(λn exp

[−λ

N−1∑n=0

x[n]

])(1)

= (λn exp [−λT (x)]) (1)= g(T (x), λ)h(x)

By the Neyman-Fisher Factorization theorem,

T (x) =N−1∑n=0

x[n]

is a sufficient statistic for λ

5.9 (Luke Vercimak) Assume that x[n] is the result of a Bernoulli trial (a coin toss) with

Pr{x[n] = 1} = θ

Pr{x[n] = 0} = 1− θ

and that N IID observations have been made. Assuming the Neyman-Fisher factorizationtheorem holds for discrete random variables, find a sufficient statistic for θ. Then, assuming

3

Page 10: Kay - Solutions

completeness, find the MVU estimator of θ

Let p = number of times x = 1 or∑N−1

n=0 x[n]. Since each observation is IID,

Pr [x] =N−1∏n=0

Pr [x[n]]

= θp(1− θ)N−p

=θp(1− θ)N

(1− θ)p

=(

θ

1− θ

)p(1− θ)N

=

[(θ

1− θ

)T (x)

(1− θ)N]

[1]

= g(T (x), θ)h(x)

By the Neyman-Fisher Factorization theorem,

T (x) = p =N−1∑n=0

x[n]

is a sufficient statistic for θ.

To get a MVUE statistic, the RBLS theorem says that we need to prove:

1. T (x) is complete. This is given in the problem statement.2. T (x) is unbiased:

E[T (x)] = E

[N−1∑n=0

x[n]

]

=N−1∑n=0

E [x[n]]

=N−1∑n=0

[Pr(x[n] = 1)x[n] + Pr(x[n] = 0)x[n]]

=N−1∑n=0

[θ(1) + (1− θ)(0)]

= Nθ

Therefore an unbiased estimator of θ is

θ =1N

N−1∑n=0

x[n]

4

Page 11: Kay - Solutions

By the RBLS theorem, this is also the MVUE.

5

Page 12: Kay - Solutions

ECE 531 - Detection and Estimation TheoryHomework 4February 5, 2011

6.7 (Shu Wang) Assume that x[n] = As[n] + w[n] for n = 0, 1, . . . , N − 1 are observed, wherew[n] is zero mean noise with covariance matrix C and s[n] is a known signal. The ampli-tude of A is to be estimated using a BLUE. Find the BLUE and discuss what happens ifS = [s[0]s[1] . . . s[N − 1]]T is an eigenvector of C. Also, find the minimum variance.

E[x[n]] = As[n], because s[n]’s are known. So A = sTC−1xsTC−1s

. And the minimum varianceis var(A) = 1

sTC−1s. From the problem we know that s is an eigenvector of C. According to

the property of eigenvectors:If s is an eigenvector of C corresponding to the eigenvalue λ and C is invertible, the s is aneigenvector of C−1 corresponding to the eigenvalue 1

λ .proof:

Cs = λs

C−1Cs = C−1λs = λC−1s

s = λC−1s⇒ 1λs = C−1s

So 1λ is the eigenvalue of C−1. So var(A) = 1

sTC−1s= 1

sT 1λs

= λsTs

.

So var(A) = λ.In this case, since s is an eigenvector, no pre-whitening filter is needed!

6.9 (Luke Vercimak) OOK communication system. Given:

x[n] = A cos(2πf1n) + w[n] n = 0, 1, . . . , N − 1 C = σ2I E[w[n]] = 0

Find he BLUE for A (A) and interpret the resultant detector. FInd the best frequency in therange of 0 ≤ f1 ≤ 1

2 to use at the transmitter.

x[n] = A cos(2πf1n) + w[n]x = HA + w

Where:

H =

1

cos(2πf1)cos(2πf12)

...cos(2πf1(N − 1))

1

Page 13: Kay - Solutions

A =[A]

C−1 =1σ2

I

Using the Gauss-Markov Theorem,

A =(HTC−1H

)−1HTC−1x

=

(1σ2

N−1∑n=0

cos2(2πf1n)

)−1

HTC−1x

=

(1σ2

N−1∑n=0

cos2(2πf1n)

)−1(1σ2

N−1∑n=0

cos(2πf1n)x[n]

)

=∑N−1

n=0 cos(2πf1n)x[n]∑N−1n=0 cos2(2πf1n)

The detector is the ratio of the cross correlation between the carrier and the received signal tothe autocorrelation of the carrier signal. It is a measurement of how much the received signalis like the carrier signal. The value chosen for γ would be A/2 since this would minimize boththe number of false positive and false negatives.

The best frequency range to use for the carrier would reduce the variance of A the most.

CA =(HTC−1H

)−1

=

(1σ2

N−1∑n=0

cos2(2πf1n)

)−1

=σ2∑N−1

n=0 cos2(2πf1n)

Maximizing the denominator will reduce CA the most. If f1 was chosen to be 0 (no carrier)or chosen to be 1

2 with the added constraint that the transmitting clock and sampling clockwere phase aligned with no phase shift, the variance would be minimum.

7.3 (Luke Vercimak) We observe N IID samples from the PDFs:

1. Gaussian

p(x;µ) =1√2π

exp[−1

2(x− µ)2.

]2. Exponential

p(x;λ) ={λ exp(−λx) x > 0

0 x < 0

In each case find the MLE of the unknown parameter and be sure to verify that it indeedmaximizes the likelihood function. Do the estimators make sense?

2

Page 14: Kay - Solutions

p(x;µ) =1√2π

exp

[−1

2

N−1∑n=0

(x[n]− µ)2]

ln p(x;µ) = −12

ln [2π]− 12

N−1∑n=0

(x[n]− µ)2

∂ ln p(x;µ)∂µ

=N−1∑n=0

(x[n]− µ)

0 =N−1∑n=0

(x[n]− µ)

Nµ =N−1∑n=0

x[n]

µ =1N

N−1∑n=0

x[n]

∂2 ln p(x;µ)∂µ2

= −N

The curvature is negative at the critical point of the first derivative. Therefore, the setting thefirst derivative to 0 indeed finds the maximum. The estimator calculated for the maximumis the sample mean and is what would be expected.

p(x;λ) = λN exp(−λN−1∑n=0

x[n])

ln p(x;λ) = N ln[λ]− λN−1∑n=0

x[n]

∂ ln p(x;λ)∂λ

=N

λ−N−1∑n=0

x[n]

0 =N

λ−N−1∑n=0

x[n]

λ =1

1N

∑N−1n=0 x[n]

∂2 ln p(x;λ)∂λ2

=−Nλ2

The curvature is negative at the critical point of the first derivative. Therefore, the setting thefirst derivative to 0 indeed finds the maximum. The estimator calculated for the maximum is

3

Page 15: Kay - Solutions

the inverse of the sample mean. Since E[x] = 1λ for an exponential distribution, this estimator

makes sense.

7.14 (Luke Vercimak + book images)

# Title: EE 531 Detection and estimation theory HW prob 7.14

# Author: Luke Vercimak

# Date: 2/6/2011

# Description:

# Performs a monte-carlo analysis on the distribution of the

# sample mean of standard normally distributed random variables.

import matplotlib.mlab as mlabimport matplotlib.pyplot as pltimport numpy as np

# Caculates the sample mean and variance for

# N IID samples from a standard normal distribution

def CalcStats(N):x = np.random.randn(N)m = sum(x)/Ns2 = sum(pow((x-m),2))/N

return (m,s2)

# Runs a monte-carlo analysis on the std mean and variance estimators

# computed on N samples from a standard normal distribution. Results

# are displayed in figure fig

def MonteCarlo(fig, N):# Number of monte-carlo interations (to get nice histograms)

N_monte_carlo = 10000

# Create a vector N’s to feed through the CalcStats routine.

points = [N]*N_monte_carlo

# Run the CalcStats subroutine N_monte_carlo times and store each result

# in stats

stats = map(CalcStats, points)

# Stats is a list of tuples, each tuple is (mean, variance). Rearrange

# This structure into two lists, one of sample means, one of samp. variances

m,s2 = zip(*stats)

# Normalize the results to compute the histogram

d = m/(np.sqrt(s2)/np.sqrt(N))

4

Page 16: Kay - Solutions

# Open a new figure to display the results

plt.figure(fig)

# Draw the histogram, use 50 bins and normalize the bin height

n, bins, patches = plt.hist(d, 50, normed=1, facecolor=’green’)

# Draw the theoretical result over the histogram so that

# a comparison can be made

y = mlab.normpdf( bins, 0, 1)l = plt.plot(bins, y, ’r--’, linewidth=1)

# Label the graph and clean it up

plt.ylabel(’Normalized Bin count’)plt.title(r’$\mathrm{Histogram\ of\ } ’ +

r’\bar{x} / \left( \hat{\sigma}/ \sqrt{N} \right) ’+", N = %d $" % N)

plt.axis([-6.5, 6.5, 0, 0.5])plt.grid(True)

# Finally show the graph

plt.show()

# Perform the monte-carlo analysis using 10 samples for the estimators

# in figure 1

MonteCarlo(1, 10)

# Repeat with 100 samples for figure 2

MonteCarlo(2, 100)

5

Page 17: Kay - Solutions

6

Page 18: Kay - Solutions

ECE 531 - Detection and Estimation TheoryHomework 5February 22, 2011

7.18 (Luke Vercimak) Newton-Raphson

g(x) = exp

[

−1

2x2

]

+ 0.1 exp

[

−1

2(x − 10)2

]

g′(x) = exp

[

−1

2x2

]

(−x) + 0.1 exp

[

−1

2(x − 10)2

]

(10 − x)

g′′(x) = exp

[

−1

2x2

]

(x2)−exp

[

−1

2x2

]

+0.1 exp

[

−1

2(x − 10)2

]

(10−x)2−0.1 exp

[

−1

2(x − 10)2

]

The Newton-Raphson method finds the zeros of a function:

xk+1 = xk − f(xk)

f ′(xk)

We want to find the zeros of g′. Therefore:

xk+1 = xk − f ′(xk)

f ′′(xk)

Using a computer to compute:

k x g(x) g′(x) g′′(x)

0 0.5000 0.8825 −0.4412 −0.66191 −0.1667 0.9862 0.1644 −0.95882 0.0048 1.0000 −0.0048 −1.00003 −0.0000 1.0000 0.0000 −1.00004 0.0000 1.0000 −0.0000 −1.0000

k x g(x) g′(x) g′′(x)

0 9.5000 0.0882 0.0441 −0.06621 10.1667 0.0986 −0.0164 −0.09592 9.9952 0.1000 0.0005 −0.10003 10.0000 0.1000 −0.0000 −0.1000

It is important for the initial guess of this method to be closer to the critical point that wewish to estimate. Otherwise it will converge to the closest maxima or minima to the initialguess.

7.20 (Luke Vercimak) Given x[n] = s[n] + w[n], determine the MLE estimator of s[n]. (w[n] ∼N(0, σ2)) Since nothing is known about s[n], we cannot determine anything about s[n + k]from x[n]. Since we cannot take advantage of any information about the relationship of the

1

Page 19: Kay - Solutions

values of s[n] the best we can do is assume that each x[n] is independent, giving us a worstcase estimate. (The joint distribution will not give any additional information over the singledistribution.)

ln p(x[n]) = − ln(√

2πσ2

)

− 1

2σ2(x[n] − s[n])2

Differentiating this and setting the result equal to 0, we obtain the following results:

s[n] = x[n]

This makes sense due to the fact that we don’t have any more information about s[n] otherthan x[n]. The measurement will have the following PDF: s[n] ∼ N (s[n], σ2)

1. Is the MLE asymptotically unbiased? The estimator doesn’t improve with increasing N.Therefore it is either biased or unbiased.

E[s[n]] = E[x[n]] = E[s[n] + w[n]] = s[n] + E[w[n]] = s[n]

Therefore the estimator is unbiased.

2. Is the MLE asymptotically efficient? The estimator doesn’t depend on N, therefore it iseither asymptotically efficient or not.

∂ ln p(x[n])

∂s[n]=

1

σ2(x[n] − s[n]) = I(θ)(g(x) − θ)

Therefore x[n] is a efficient estimator for s[n]

3. Is the MLE asymptotically gaussian? x[n] is gaussian because it is the sum of a constantand a gaussian RV. Therefore the MLE in this case is gaussian.

4. Is the MLE asympotically consistent? The estimate does not converge as N → 0. Insteadthe variance stays the same. Therefore the estimate is not consistent.

8.5 (Luke Vercimak + Natasha Devroye) “DCT” EstimationGiven:

s[n] =

p∑

i=1

Ai cos 2πfin

Determine:

1. Find the LSE normal equations The model above is a linear model and can be put intothe form s = Hθ Therfore,

H =

1 1 . . . 1cos 2πf1(1) cos 2πf2(1) . . . cos 2πfp(1)

......

......

cos 2πf1(N − 1) cos 2πf2(N − 1) . . . cos 2πfp(N − 1)

θ =

A1

A2

...Ap

2

Page 20: Kay - Solutions

Per the book’s results, the normal equations would be:

HTHθ = HTs

2. Given that the frequencies are fi = i/N , explicitly find the LSE and the minimum LSEerror.

H =

1 1 . . . 1cos 2π 1

N(1) cos 2π 2

N(1) . . . cos 2π p

N(1)

......

......

cos 2π 1

N(N − 1) cos 2π 2

N(N − 1) . . . cos 2π p

N(N − 1)

The columns of this matrix are orthogonal. Because of this:

HTH =

N2

0 . . . 0

0 N2

. . . 0...

......

...

0 0 . . . N2

=N

2

1 0 . . . 00 1 . . . 0...

......

...0 0 . . . 1

Solving the normal equations for θ, we get

θ = (HTH)−1HTs

=2

NIHTs

=2

NHTs

Converting this back into scalar form results in the LSE estimator:

Ai =2

N

N−1∑

n=0

[

cos 2πin

N

]

s[n]

To find the minimum LSE error, use the results found in eq 8.13:

Jmin = sT(s − Hθ)

= sTs− sTHθ

= sTs− sTH2

NHTs

= sTs− 2

NsTHHTs

= sTs− 2

NsT

N

2Is

= sTs− sTs

= 0

Because the signal model was linear to begin with, the LSE gives exact estimates of theparameters and is able to reconstruct the signal in its entirety.

3

Page 21: Kay - Solutions

3. Finally if x[n] = s[n] + w[n], where w[n] is WGN with variance σ2 determine the PDFof the LSE assuming the given frequencies.Because of the above result for Jmin, any error in the estimate is entirely due to w[n].The estimator wouldn’t change in this case and would be:

Ai =2

N

N−1∑

n=0

[

cos 2πin

N

]

x[n]

=2

N

N−1∑

n=0

[

cos 2πin

N

]

(s[n] + w[n])

=2

N

N−1∑

n=0

[

cos 2πin

N

]

s[n] +2

N

N−1∑

n=0

[

cos 2πin

N

]

w[n]

E[Ai] =2

N

N−1∑

n=0

[

cos 2πin

N

]

s[n] +2

N

N−1∑

n=0

[

cos 2πin

N

]

E[w[n]]

=2

N

N−1∑

n=0

[

cos 2πin

N

]

s[n] +2

N

N−1∑

n=0

[

cos 2πin

N

]

0

=2

N

N−1∑

n=0

[

cos 2πin

N

]

s[n]

= Ai

var[Ai] = var

[

2

N

N−1∑

n=0

[

cos 2πin

N

]

w[n]

]

=4

N2

[

N−1∑

n=0

cos2(2πin

N)var[w[n]]

]

=4σ2

N2

[

N−1∑

n=0

1 + cos(2πi nN

)

2

]

=2σ2

N

Furthermore, cov(Ai, Aj) = δij . The estimate Ai is the sum of a constants signal and a

number of gaussian RVs. Therefore the distribution of A is gaussian, N(

A, 2σ2

NI)

.

8.10 (Shu Wang) Prove ‖s‖2 + ‖x − s‖2 = ‖x‖2

We suppose that s = Hθ. Then we can have:

4

Page 22: Kay - Solutions

||s||2 = sT s = θTHT Hθ

||x − s||2 = (x − Hθ)T (x − Hθ) = xT x − xTHθ − θTHT x + θTHT Hθ

||x||2 = xT x

||s||2 + ||x − s||2 = xT x + [θT HT Hθ − xT Hθ − θT HT x + θTHT Hθ]

= xT x − [xT Hθ + θTHT x − 2θT HT Hθ]

= xT x − [(xT − θTHT )Hθ + θTHT (x − Hθ)]

= xT x − [(x − Hθ)T Hθ + θTHT (x − Hθ)]

We know that (x − Hθ)T H = 0 and HT (x − Hθ) = 0.So ||s||2 + ||x − s||2 = xT x = ||x||2

5

Page 23: Kay - Solutions

ECE 531: Detection and Estimation Theory, Spring 2011

Homework 6

Problem 1. (8.20) (Shu Wang)

Solution:From the problem, we know that:

H =

1r...

rN−1

So we have h[n] = rn. According to 8.46, we have:

A(n) = A(n − 1) + K[n](x[n] − h[n]T A(n − 1))

= A(n − 1) + K[n](x[n] − rnA(n − 1))

From the problem, we know that σ2 = 1. According to 8.45, we have V ar(A(n)) = Σ[n]. We canget K[n] by using 8.47:

V ar(A(n)) =V ar(A(n − 1))h[n]

1 + h[n]T V ar(A(n − 1))h[n]

=V ar(A(n − 1))rn

1 + r2nV ar(A(n − 1))

Also according to 8.48, we have:

V ar(A(n)) = (1 − K[n]h[n]T )V ar(A(n − 1))

= (1 −V ar(A(n − 1))r2n

1 + r2nV ar(A(n − 1)))V ar(A(n − 1))

=V ar(A(n − 1))

1 + r2nV ar(A(n − 1))

Let σ2 = 1 = V ar(A(0)). Then we can have:

1

Page 24: Kay - Solutions

V ar(A(1)) =1

1 + r2

V ar(A(2)) =1

1+r2

1 + r4 1

1+r2

=1

1 + r2 + r4

Then we can conclude that V ar(A(n)) = 1P

N

n=0r2n

.

Problem 2. (8.27) (Luke Vercimak)

Solution:The model is x[n] = exp(θ) + w[n]

1. Newton-Raphson

We will assume that the signal model is:

s[n] = exp(θ)

s = exp(θ)1

We want to minimize:J = (x − s(θ))T (x − s(θ))

To do this we want to solve:∂s(θ)

∂θ(x− s(θ)) = 0

Using results 8.59 and 8.60 from the book:

g(θ) = exp θ

θk+1 = θk +

(

exp(2θ) −

N−1∑

i=0

[exp(θ) (x[n] − exp(θ))]

)−1 N−1∑

i=0

[exp(θ) (x[n] − exp(θ))]

θk+1 = θk +

∑N−1

i=0[exp(θ) (x[n] − exp(θ))]

exp(2θ) −∑N−1

i=0[exp(θ) (x[n] − exp(θ))]

θk+1 = θk +

∑N−1

i=0[exp(θ) (x[n] − exp(θ))]

exp(2θ) −∑N−1

i=0[exp(θ) (x[n] − exp(θ))]

2

Page 25: Kay - Solutions

2. AnalyticallyChanging the model to vector form:

x = exp(θ)1 + w

We will assume that the signal model is:

s[n] = exp(θ)

This model can be transformed to a linear model by the transformation:

α = exp(θ) = g(θ)

Therefore (since g(θ) is invertible):

s(θ) = s(g−1(α))

The signal model now becomes:s = Hα = 1α

Using the linear model results from the book to find the LSE:

LSE(α) = (HTH)−1Hx

= (1T1)−11Tx

=1

N

N−1∑

n=0

x[n]

= x

LSE(θ) = g−1(LSE(α))

= ln(LSE(α))

= ln(x)

Problem 3. (10.3) (Shu Wang)

Solution:Because x[n] are conditional independent of θ. Then we can have:

3

Page 26: Kay - Solutions

p(x|θ) = exp[−N−1∑

n=0

(x[n] − θ)]U(min(x[n]) − θ)

p(x, θ) = p(x|θ)p(θ)

= exp[−

N−1∑

n=0

x[n] + (N − 1)θ]U(min(x[n]) − θ)

p(x) =

∫ min(x[n])

0

p(x, θdθ

=

∫ min(x[n])

0

exp[−

N−1∑

n=0

x[n] + (N − 1)θ]dθ

= exp[−N−1∑

n=0

x[n]]1

N − 1(exp[(N − 1)min(x[n])] − 1)

p(θ|x) =p(x, θ)

p(x)

=exp[(N − 1)θ]U(min(x[n]) − θ)1

N−1(exp[(N − 1)min(x[n])] − 1)

E(θ|x) =

∫ min(x[n])

0

θp(θ|x)dθ

= (N − 1)1

exp[(N − 1)min(x[n])] − 1

∫ min(x[n])

0

θexp[(N − 1)θ]dθ

By using partial integration, we have:

θMMSE =min(x[n])

1 − exp[−(N − 1)min(x[n])]−

1

N − 1

4

Page 27: Kay - Solutions

ECE 531 - Detection and Estimation Theory

Homework 7March 10, 2011

11.3 (MMSE and MAP estimation) (Luke Vercimak)

1. MMSE

θ = E [θ|x]

=

x

θp(θ|x)dθ

=

x

θ exp [−(θ − x)] dθ

= [(−θ − 1) exp [− (θ − x)]]∞x= x + 1

2. MAP

θ = arg maxθ

p(θ|x)

θ = arg maxθ

exp [−(θ − x)]

= x

12.1 (LMMSE) (Luke Vercimak)

Given:θ = ax2[0] + bx[0] + c

x[0] ∼ U[

−1

2, 1

2

]

. Find the LMMSE estimator and the quadratic estimator if θ = cos 2πx[0].Also, compare the minimum MSEs.

1. Quadratic

BMSE[θ] = E[

(θ − θ)2]

= E[

(

θ −(

ax2[0] + bx[0] + c))2

]

= E[

(

θ − ax2[0] − bx[0] − c)2

]

We need to find the minimum of BMSE. To do this, we take its derivative with respect

1

Page 28: Kay - Solutions

to each parameter and set to 0.

0 =∂BMSE [θ]

∂a

0 =∂BMSE [θ]

∂b

0 =∂BMSE [θ]

∂c

0 = E[

2(

θ − ax2[0] − bx[0] − c)

(−x2[0])]

0 = E[

2(

θ − ax2[0] − bx[0] − c)

(−x[0])]

0 = E[

2(

θ − ax2[0] − bx[0] − c)

(−1)]

E[θx2[0]] = E[

ax4[0] + bx3[0] + cx2[0]]

E[θx[0]] = E[

ax3[0] + bx2[0] + cx[0]]

E[θ] = E[

ax2[0] + bx[0] + c]

In matrix form (and assuming x = x[0]:

E

θ

x2

x

1

= E

x4 x3 x2

x3 x2 x

x2 x1 1

a

b

b

Since the distribution on x and θ are known (using integration),

E[x] = 0

E[x2] =1

12E[x3] = 0

E[x4] =1

80

E[θx2] =−1

2π2

E[θx] = 0

E[θ] = 0

E[θ2] =1

2

Substituting the expectations into the matrix equation above and solving for a, b, c it isfound that:

a

b

b

=

−90

π2

015

2π2

2

Page 29: Kay - Solutions

Therefore

θ =−90

π2x2[0] +

15

2π2

Computing the MSE

BMSE[θ] = E[

(θ − θ)2]

= E

[

(

cos(2πx[0]) − θ)2

]

= E[

cos2(2πx[0]) − 2θ cos(2πx[0]) + θ2

]

=1

2− 2E

[

θ cos(2πx[0])]

+ 0

=1

2− 2E

[

(−90

π2x2[0] +

15

2π2) cos(2πx[0])

]

=1

2− 2E

[

−90

π2cos(2πx[0])x2[0]

]

− 2E

[

15

2π2cos(2πx[0])

]

=1

2− 2(

−90

π2)E

[

cos(2πx[0])x2[0]]

− 2(15

2π2)E [cos(2πx[0])]

=1

2− 2(

−90

π2)E

[

θx2[0]]

− 2(15

2π2)E [θ]

=1

2− 2(

−90

π2)−1

2π2− 0

=1

2−

90

π4

2. LinearModifying the results of the quadratic:

0 =∂BMSE [θ]

∂b

0 =∂BMSE [θ]

∂c

0 = E [2 (θ − bx[0] − c) (−x[0])]

0 = E [2 (θ − bx[0] − c) (−1)]

E[θx[0]] = E[

bx2[0] + cx[0]]

E[θ] = E [bx[0] + c]

In matrix form:

E

[[

x2 x

x 1

]] [

b

c

]

= E

[

θ

[

x

1

]]

Using the expectations from above it is found that: b = 0, c = 0, θ = 0

3

Page 30: Kay - Solutions

Computing the MSE

BMSE[θ] = E[

θ2]

= E[

cos2(2πx[0])]

=1

2

The MSE of the quadratic estimator is less.

12.11 (Whitening) (Shu Wang)

If we want Cyy = I, then y1, y2, y3 must be orthonormal. We use Gram-Schmidt orthogonal-ization procedure to solve this problem.

y1 =x1

||x1||= x1

z2 = x2 − (x2, y1)y1 = x2 − (x2, x1)x1 = x2 − E[x2x1]x1 = x2 − ρx1

y2 =z2

||z2||

||z2|| =√

E[(z2)2] =√

1 − ρ2

y2 =x2 − ρx1√

1 − ρ2

z3 = x3 − (x3, y2)y2 − (x3, y1)y1 = x3 − (x3,x2 − ρx1√

1 − ρ2)x2 − ρx1√

1 − ρ2− (x3, x1)x1

= x3 − E[x3

x2 − ρx1√

1 − ρ2]x2 − ρx1√

1 − ρ2− E[x3x1]x1

= x3 − ρ2x1 − [x2ρ − ρ2x1

1 − ρ2−

x2ρ3 − ρ4x1

1 − ρ2]

= x3 − ρx2

y3 =z3

||z3||=

x3 − ρx2√

1 − ρ2

Then we can have:

y1

y2

y3

=

1 0 0− ρ√

1−ρ2

1√1−ρ2

0

0 − ρ√1−ρ2

] 1√1−ρ2

x1

x2

x3

So

A =

1 0 0− ρ√

1−ρ2

1√1−ρ2

0

0 − ρ√1−ρ2

] 1√1−ρ2

4

Page 31: Kay - Solutions

Because x is zero mean, and Cyy = E[yyT ]. Then Cyy = E[AxxT AT ] = ACxxAT = I. soCxx = A−1(AT )−1 = (AT A)−1. So C−1

xx = AT A.

5

Page 32: Kay - Solutions

ECE 531: Detection and Estimation Theory, Spring 2011Homework 8

Problem1. (13.4) (Shu Wang)Solution:From eq 13.5, we have:

Cs[m,n] = am+n+2σ2s + σ2

uam−n

n∑k=0

a2k

= am−n(a2n+2σ2s + σ2

u

n∑k=0

a2k)

From eq 13.6, we know that

var(s[n]) = Cs[n, n] = a2n+2σ2s + σ2

u

n∑k=0

a2k

So Cs[m,n] = am−nCs[n, n].

Problem2. (13.12) (Shu Wang)Solution:K[n] = M [n|n−1]

σ2n+M [n|n−1]

, if σ2n = 0, then K[n] = 1. We will have:

s[n|n] = s[n|n− 1] +K[n](x[n]− s[n|n− 1]) = x[n]⇒ s[n|n− 1] = as[n− 1|n− 1] = ax[n− 1]

1

Page 33: Kay - Solutions

Innovation sequence:

x[n] = x[n]− x[n|n− 1]= x[n]− s[n|n− 1]= s[n]− s[n|n− 1]= s[n]− as[n− 1|n− 1]= s[n]− ax[n− 1]= s[n]− as[n− 1]= u[n]

So it is white, because of u[n] is white.

Problem13.15 (Optimal l-step predictor) (Luke Vercimak)We’ll use the Kalman filtering equations:Prediction:

s[n|n− 1] = as[n− 1|n− 1]

Kalman Gain:K[n] =

M [n|n− 1]σ2n +M [n|n− 1]

Correction:s[n|n] = s[n|n− 1] +K[n] (x[n]− s[n|n− 1])

If σ2n → ∞ the Kalman filter will not use the observed data and will generate its output solely

based on the previous input.

K[n] =M [n|n− 1]

σ2n +M [n|n− 1]

=M [n|n− 1]

∞+M [n|n− 1]= 0

The correction equation then becomes:

s[n|n] = s[n|n− 1] + 0 (x[n]− s[n|n− 1]) = s[n|n− 1]

The prediction equation can then be expanded:

s[n+ 1|n] = as[n|n]

s[n+ 2|n] = as[n+ 1|n] = a2s[n|n]

s[n+ 3|n] = as[n+ 2|n] = a2s[n+ 1|n] = a3s[n|n]

s[n+ l|n] = als[n|n]

2

Page 34: Kay - Solutions

ECE 531: Detection and Estimation Theory, Spring 2011Homework 9ALL THANKS TO Shu Wang

Problem1. (3.4)Solution:According to example 3.2, we have

PD = Q(Q−1(PFA)−√NA2

σ2

⇒ Q−1(PD) = Q−1(PFA)−√NA2

σ2

⇒√NA2

σ2= Q−1(PFA)−Q−1(PD)

⇒ NA2

σ2= (Q−1(PFA)−Q−1(PD))2

Since 10 log10A2

σ2 = −30dB ⇒ A2

σ2 = 10−3, we have:

N =(Q−1(PFA)−Q−1(PD))2

10−3

= 36546

According to Appendix 2C, we can use Matlab to calculate Q−1.

Problem2. (3.6)

H0 : µ = 0

H1 : µ = A1

L(x) =

1

(2πσ2)N2e[−

12σ2

PN−1n=0 (x[n]−A)2]

1

(2πσ2)N2e[−

12σ2

PN−1n=0 (x[n])2]

> γ

⇒ − 12σ2

(−2AN−1∑n=0

x[n] +NA2) > lnγ

⇒ A

σ2

N−1∑n=0

x[n] > lnγ +NA2

2σ2

1

Page 35: Kay - Solutions

Since A < 0:

1N

N−1∑n=0

x[n] <σ2

NAlnγ +

A

2= γ′

x < γ′ → H1

x > γ′ → H0

T (x) ∼

{N (0, σ

2

N ) under H0

N (A, σ2

N ) under H1

PFA = Pr{T (x) < γ′;H0}= 1− Pr{T (x) > γ′;H0}

= 1−Q(γ′√σ2

N

)

PD = Pr{T (x) < γ′;H1}

= 1−Q(γ′ −A√

σ2

N

)

1− PFA = Q(γ′√σ2

N

)

⇒ γ′ =

√σ2

NQ−1(1− PFA)

Q−1(x) = −Q−1(1− x)

⇒ γ′ = −√σ2

NQ−1(PFA)

PD = 1−Q(−Q−1(PFA)− A√σ2

N

)

Q(−x) = 1−Q(x)

⇒ PD = Q(Q−1(PFA) +A√σ2

N

)

Since A < 0

2

Page 36: Kay - Solutions

PD = Q(Q−1(PFA)− |A|√σ2

N

)

= Q(Q−1(PFA)−√A2N

σ2)

This is same as A > 0.

Problem3. (3.12)If we want to have a perfect detector, the PDF of H0 and mathcalH1 cannot overlap as the figurebelow. So that means 1− c > c⇒ c < 1

2 .

Problem4. (3.18)

H0 : x[0] ∼ N (0, 1)H1 : x[0] ∼ N (0, 2)

We decide H1 if

3

Page 37: Kay - Solutions

P (H1|x) > P (H0|x)⇒ P (x|H1)P (H1) > P (x|H0)P (H0)

⇒ P (x|H1)P (x|H0)

>P (H0)P (H1)

= γ

P (x|H1)P (x|H0)

=1√4πe−

14x2[0]

1√2πe−

12x2[0]

=1√2e

14x2[0] > γ

⇒ x2[0] > 4ln(√

2γ)⇒ |x[0]| > 2√ln(√

2γ)

For P (H0) = 12 , we have P (H1) = 1

2 . Then γ = P (H0)P (H1) = 1 ⇒ |x[0]| > 2

√ln(√

2) = 1.1774 ≈ 1.18.We can have the decision region as follow:

4

Page 38: Kay - Solutions

For P (H0) = 34 , we have P (H1) = 1

4 . Then γ = P (H0)P (H1) = 3⇒ |x[0]| > 2

√ln(√

2 ∗ 3) = 2.4043 ≈ 2.4.We can have the decision region as follow:

5

Page 39: Kay - Solutions

ECE 531: Detection and Estimation Theory, Spring 2011

Homework 10

Problem 1 (4.6 – Luke Vercimak)

The this is a known signal in WGN. Per eq 4.3, the test statistic will be:

T (x) =N−1∑

n=0

x[n]s[n] > γ′

In this case (s[n] = Arn):

E =N−1∑

n=0

s2[n] = A2

N−1∑

n=0

r2n

For 0 < r < 1:

= A2

N−1∑

n=0

r2n →A2

1 − r2as N → ∞

Therefore as we gain additional samples, the detector performance will approach a constant. (ob-tained by plugging E into 4.14).

For r = 1:

= A2

N−1∑

n=0

r2n = NA2 → ∞ as N → ∞

Per Eq 4.14, PD will approach 1 as N → ∞

For r > 1:

= A2

N−1∑

n=0

r2n → ∞ as N → ∞

Per Eq 4.14, PD will approach 1 as N → ∞

For all cases, the detector threshold γ′ can be determined by plugging E into:

γ′ =√

σ2EQ−1(PFA)

Problem 2 (4.10 – Shu Wang)

1

Page 40: Kay - Solutions

V T CV = Λ

V T = V −1

C = V ΛV −1 = V ΛV T

C−1 = V Λ−1V T

C−1 = DT D

⇒ D =√

Λ−1V T

First, we need to calculate the eigenvalues of C. det(λI −C) = 0, it is easy to get λ = 1± ρ. Thenit is easy to find the matrix of eigenvectors.

V T = V =

(

1√

2

1√

21√

2− 1

2

)

√Λ−1 =

(

1√

1+ρ0

0 1√

1−ρ

)

D =

1√2(1+ρ)

1√2(1+ρ)

1√2(1−ρ)

−1√2(1−ρ)

Problem 3 (4.19 – Siyao Gu)

Since s0[0] = s1[0] = 1, we can concentrate planning the decision regions around s0[1] and s1[1].The test can be simplified to

T ∼

{

N (−1, σ2) under H0

N (1, σ2) under H1

(1)

The NP test becomes

p(x;H1)

p(x;H0)

H0

≶H1

P (H0)

P (H1

= γ (2)

p(x;H1)

p(x;H0)=

1√

2πexp(− (x[1]−1)2

2)

1√

2πexp(− (x[1]+1)2

2)

(3)

= exp

[

−(x2[1] − 2x[1] + 1)

2−

−(x2[1] + 2x[1] + 1)

2

]

(4)

p(x;H1)

p(x;H0)= exp[2x[1]]

H0

≶H1

P (H0)

P (H1)(5)

2

Page 41: Kay - Solutions

x[1]H0

≶H1

1

2ln

P (H0)

P (H1)(6)

Thus the line running through x[1] and perpendicular to the line running between s0 and s1 is thechosen decision boundary. This would be a 0-slope line. If P (H0) = P (H1), the boundary wouldbe x[1] = 0.

Problem 4 (4.24 – Shu Wang)

According to the text book, we have Ti(x) =∑N−1

n=0x[n]si[n]− 1

2εi. We need to choose Hi to make

Ti(x) to be the maximum statistic. The block diagram of the optimal receiver is on page 120, figure4.13.When M = 2, according to eq 4.25, we have:

Pe = Q(

ε(1 − ρs)

2σ2)

If we want to minimize Pe, we need to minimize ρs.

ρs =sT1s0

1

2(sT

1s1 + sT

0s0)

=NA0A1

1

2(A2

0+ A2

1)

|ρs| ≤ 1

So when A0 = −A1, ρs = −1 is minimum. Then Pe is minimum.

3

Page 42: Kay - Solutions

ECE 531: Detection and Estimation Theory, Spring 2011Homework 11 Solutions

Problem1. (5.14 – Shu Wang)From Eq 5.5 and 5.6, we have:

T (x) = xTCs(Cs + σ2I)−1x

s = Ah

Cs = E[ssT ] = E[AhAhT ] = E[AA]hhT = σ2Ahh

T

⇒ T (x) = xTσ2Ahh

T (σ2Ahh

T + σ2I)−1x

By using matrix inversion lemma, we have:

(A+BCD)−1 = A−1 −A−1B(DA−1B + C−1)−1DA−1

Here we set A = σ2I, B = σ2Ah, C = I and D = hT . Then we will get:

(σ2I + σ2Ahh

T )−1 =1σ2I − 1

σ2(

σ2Aσ2 h

Th

1 + hThσ2

Aσ2

)

⇒ T (x) = xTσ2Ahh

T (1σ2I − 1

σ2(

σ2Aσ2 h

Th

1 + hThσ2

Aσ2

))x

= xThhT (σ2A

σ2−σ2A

σ2(

σ2Aσ2 h

Th

1 + hThσ2

Aσ2

))x

= (hTx)T (hTx)(σ2A

σ2Ah

Th+ σ2) > γ

⇒ T ′(x) = (hTx)2 > γ′ =γσ2

A

σ2Ah

T h+σ2

x ∼

{N (0, σ2I) under H0

N (0, Cs + σ2I) under H1

⇒ hTx ∼

{N (0, σ2hTh) under H0

N (0, σ2A(hTh)2 + σ2hTh) under H1

1

Page 43: Kay - Solutions

According to chapter2, under H0, we can easily get:

(hTx)2

σ2hTh∼ X 2

1

PFA = Pr{T ′(x) > γ′;H0}

= Pr{ T′(x)

σ2hTh>

γ′

σ2hTh;H0}

Also from Chapter2, we know that QX 21 (x) = 2Q(

√x). Then we have PFA = 2Q(

√γ′

σ2hT h).

Similar to H0, we can have:

(hTx)2

σ2A(hTh)2 + σ2hTh

∼ X 21

PD = Pr{T ′(x) > γ′;H1}

= Pr{ T ′(x)σ2A(hTh)2 + σ2hTh

>γ′

σ2A(hTh)2 + σ2hTh

;H1}

PD = 2Q(

√γ′

σ2A(hTh)2 + σ2hTh

)

2

Page 44: Kay - Solutions

Problem 5.16 for Avinash (book)

3

Page 45: Kay - Solutions

Problem2. (5.17 – Yao Feng)

Deflection coefficient is defined as

d2 =(E(T ;H1)− E(T ;H0))2

V ar(T ;H0)

E(T ;H1) =N−1∑n=0

E (Acos(2πf0n+ φ) + w[n])Acos2πf0n)

= cosφN−1∑n=0

A2cos22πf0n− sinφN−1∑n=0

A2cos2πf0nsin2πf0n

=NA2

2cosφ

E(T ;H0) =N−1∑n=0

E(w[n]Acos2πf0n) = 0

V ar(T ;H0) = V ar(N−1∑n=0

w[n]Acos2πf0n)

=N−1∑n=0

V ar(w[n]Acos2πf0n)

= σ2N−1∑n=0

A2cos22πf0n

=NA2

2σ2

So,

d2 =(NA

2

2 cosφ)2

NA2

2 σ2=NA2

2σ2cos2φ

We can see that if φ = 0, which means our assumption is right, then we get the maximum d2, hencethe maximum PD; if φ = π, which mean our truley sent signal is −Asin2πf0n, then we get theminimum PD

4

Page 46: Kay - Solutions

Problem3. (6.2 – Shu Wang)

L(x) =P (x[0], x[1] : H1)P (x[0], x[1] : H0)

=λ2e−λ(x[0]+x[1])

λ20e−λ0(x[0]+x[1])

> γ

⇒ e−(λ−λ0)(x[0]+x[1]) >γλ2

0

λ2

⇒ −(λ− λ0)(x[0] + x[1]) > ln(γλ2

0

λ2)

If λ > λ0, we decide H1.

⇒ T (x) = x[0] + x[1] < −ln(γλ

20

λ2 )λ− λ0

= γ′

PFA = Pr{T (x) < γ′;H0}

The region of T (x) < γ′ is shown in the following figure:

5

Page 47: Kay - Solutions

PFA =∫ γ′

0

∫ γ′−x[0]

0λ2

0e−λ0(x[0]+x[1])dx[1]dx[0]

=∫ γ′

0−λ0e

−λ0(x[0]+x[1])|γ′−x[0]

0 dx[0]

=∫ γ′

0λ0e

λ0x[0] − λ0eλ0γ′

dx[0]

= 1− e−λ0γ′ − γ′λ0e−λ0γ′

For given PFA, the threshold is not depend on unknown parameter λ. So the UMP test exists.

6