Docsity

Statistical Signal Processing in Assignment 4 | ECE 567, Assignments of Electrical and Electronics Engineering

Toggle sidebar
bg1
ECE 567 STATISTICAL SIGNAL PROCESSING SPRING 2008
Homework Assignment #4
Solutions
1. (a) With
x= [ x11 · · · xN1x12 ··· xN2]T
we have
p(x;µ, σ2,H0) = (2πσ2)−Nexp Ã−1
2σ2
2
X
j=1
N
X
i=1
(xij −µ)2!
p(x;µ1, µ2, σ2,H1) = (2πσ2)−Nexp Ã−1
2σ2
2
X
j=1
N
X
i=1
(xij −µj)2!
so that the GLRT test with an ML threshold is
(2πˆσ2
1)−Nexp ³−1
2ˆσ2
1P2
j=1 PN
i=1(xij −ˆµj)2´
(2πˆσ2
0)−Nexp ³−1
2ˆσ2
0P2
j=1 PN
i=1(xij −ˆµ)2´
d1
>
<
d0
1.
Using the definition of the estimated parameters, the exponential terms in both
the numerator and the denominator become exp(−N), yielding
µˆσ2
0
ˆσ2
1Nd1
>
<
d0
1
or more simply
ˆσ2
0
ˆσ2
1
d1
>
<
d0
1
as the test.
(b) Note that
N
X
i=1
(xij −ˆµ)2=
N
X
i=1
(xij −ˆµj+ ˆµj−ˆµ)2
=
N
X
i=1
(xij −ˆµj)2+ 2(ˆµj−ˆµ)
N
X
i=1
(xij −ˆµj) +
N
X
i=1
(ˆµj−ˆµ)2
=
N
X
i=1
(xij −ˆµj)2+N(ˆµj−ˆµ)2.
Therefore
2Nˆσ2
0= 2Nˆσ2
1+N
2
X
j=1
(ˆµj−ˆµ)2
pf3
pf4
pf5

Partial preview of the text

Download Statistical Signal Processing in Assignment 4 | ECE 567 and more Assignments Electrical and Electronics Engineering in PDF only on Docsity!

ECE 567 STATISTICAL SIGNAL PROCESSING SPRING 2008

Homework Assignment # Solutions

  1. (a) With x = [ x 11 · · · xN 1 x 12 · · · xN 2 ]T we have

p(x; μ, σ^2 , H 0 ) = (2πσ^2 )−N^ exp

2 σ^2

∑^2

j=

∑^ N

i=

(xij − μ)^2

p(x; μ 1 , μ 2 , σ^2 , H 1 ) = (2πσ^2 )−N^ exp

2 σ^2

∑^2

j=

∑^ N

i=

(xij − μj )^2

so that the GLRT test with an ML threshold is

(2πˆσ 12 )−N^ exp

− (^) 2ˆ^1 σ 2 1

j=

∑N

i=1(xij^ −^ μˆj^ )

2

(2πσˆ^20 )−N^ exp

− (^) 2ˆ^1 σ 2 0

j=

∑N

i=1(xij^ −^ μˆ) 2

d 1

< d 0

Using the definition of the estimated parameters, the exponential terms in both the numerator and the denominator become exp(−N ), yielding ( σˆ^20 σ ˆ^21

)N d 1

< d 0

or more simply σˆ^20 σ ˆ^21

d 1

< d 0

as the test. (b) Note that

∑^ N

i=

(xij − μˆ)^2 =

∑^ N

i=

(xij − μˆj + ˆμj − μˆ)^2

∑^ N

i=

(xij − μˆj )^2 + 2(ˆμj − μˆ)

∑^ N

i=

(xij − μˆj ) +

∑^ N

i=

(ˆμj − μˆ)^2

∑^ N

i=

(xij − μˆj )^2 + N (ˆμj − μˆ)^2.

Therefore

2 N σˆ^20 = 2N σˆ^21 + N

∑^2

j=

(ˆμj − μˆ)^2

and 2 N σˆ^20 2 N σˆ^21

d 1

< d 0

N

j=1(ˆμj^ −^ μˆ) 2

2 N ˆσ 12

d 1

< d 0

The right hand side is SSgr SSres

d 1

< d 0

  1. We have

p(x; α, σ^2 , H 1 ) = (2πσ^2 )−N/^2 exp

2 σ^2

n (^0) ∑+N − 1

n=n 0

(x(n) − αs(n − n 0 ))^2

p(x; σ^2 , H 0 ) = (2πσ^2 )−N/^2 exp

2 σ^2

n (^0) ∑+N − 1

n=n 0

x^2 (n)

As we have seen previously,

ˆσ^20 =

N

n (^0) ∑+N − 1

n=n 0

x^2 (n).

(a) We have

ln

p(x; α, σ^2 , H 1 )

N

ln(2πσ^2 ) −

2 σ^2

n (^0) ∑+N − 1

n=n 0

(x(n) − αs(n − n 0 ))^2

∂ ln(p) ∂α

2 σ^2

n 0 +∑N − 1

n=n 0

2 (x(n) − αs(n − n 0 )) (−s(n − n 0 ))

σ^2

n (^0) ∑+N − 1

n=n 0

s(n − n 0 ) (x(n) − αs(n − n 0 )).

Setting this equal to zero and solving for α yields

αˆ =

∑n 0 +N − 1 n=n 0 x(n)s(n^ −^ n^0 ) ∑n 0 +N − 1 n=n 0 s (^2) (n − n 0 )

(b) We have

p(x; H 1 ) = (2πσˆ^21 )−N/^2 exp

2ˆσ 12

n (^0) ∑+N − 1

n=n 0

(x(n) − αsˆ (n − n 0 ))^2

= (2πσˆ^21 )−N/^2 exp

N ˆσ 12 2ˆσ^21

= (2πσˆ^21 )−N/^2 exp

N

Part (ii) results in the following plot.

0 5 10 15 20 25

1

n 0 / 10^4

LG

(x) at n

0

Signal D

There are three peaks, corresponding to the presence of three occurrences of the call in this signal. We determine from the plot that they occur at 2.3, 3.9, and 8.1 seconds. Matlab code that produces the plots appears below and on the following pages.

% Load in the signals. load hw4signals

% implement the GLRT using the ML threshold to each of the four signals

call = call’ ; % the code below uses call as a column vector N = length(call);

% apply first to signal_A signal = signal_A ; M = length(signal); LR = zeros(1,(M-N)+1); for k=1:(M-N)+1, x = (signal(k:k+N-1))’ ; sig_0 = (x’x)/N ; alpha = (x’call)/(call’*call) ;

sig_1 = (x-alphacall)’(x-alpha*call)/N ; LR(k) = sig_0/sig_1 ; end LR_A = LR ;

% apply to signal_B LR = zeros(1,(M-N)+1); signal = signal_B ; for k=1:(M-N)+1, x = (signal(k:k+N-1))’ ; sig_0 = (x’x)/N ; alpha = (x’call)/(call’call) ; sig_1 = (x-alphacall)’(x-alphacall)/N ; LR(k) = sig_0/sig_1 ; end LR_B = LR ;

% apply to signal_C LR = zeros(1,(M-N)+1); signal = signal_C ; for k=1:(M-N)+1, x = (signal(k:k+N-1))’ ; sig_0 = (x’x)/N ; alpha = (x’call)/(call’call) ; sig_1 = (x-alphacall)’(x-alphacall)/N ; LR(k) = sig_0/sig_1 ; end LR_C = LR ;

% plot the results figure(1) time = [0:length(LR)-1]/10000 ; % time in sample number, normalized subplot(131) plot(time,log(LR_A.^(N/2))) axis([0 6 ylim]) title(’Signal A’) xlabel(’n_0 / 10^4’) ylabel(’ln(L_G(x)) at n_0’) subplot(132) plot(time,log(LR_B.^(N/2))) axis([0 6 ylim]) title(’Signal B’) xlabel(’n_0 / 10^4’) subplot(133) plot(time,log(LR_C.^(N/2)))