SolutionsManual-Statistical and Adaptive Signal Processing
SolutionsManual-Statistical and Adaptive Signal Processing
for
Statistical and Adaptive Signal Processing
This page is intentionally left blank.
ii
Preface
This solutions manual provides solutions to the problems contained in the first
edition of our book STATISTICAL AND ADAPTIVE SIGNAL PROCESSING.
The solutions have been prepared and written by David Marden and ourselves. We
have attempted to provide very detailed solutions to the problems with notation
consistent with that used in the book. Where applicable, we have also given a
printout of Matlab code and figures for the problem solution.
Despite our efforts, however, you may find that some of the solutions may be less
detailed and refined than others. Inevitably through the use of this solutions man-
ual, omissions and errors will be discovered. Our goal is to continually improve
upon this manual using your comments. Periodically, we will issue changes to the
solutions manual and new problems to you upon request. In this respect, we would
appreciate any feedback including improved solutions, suggestions for new prob-
lems, corrections which can be sent to Prof. Vinay K. Ingle at [email protected]
or at
Thank you.
Dimitris G. Manolakis
Vinay K. Ingle
Stephen K. Kogon
iii
This page is intentionally left blank.
iv
Chapter 2
Discrete-Time Signals and Systems
(a) Continuous-time signal xc (t) = 2 cos(40π t + π /3) has frequency of 20 Hz. Hence
40π n
x(n) = xc (t)|t =n/Fs = 2 cos + π /3
100
1
H (e j ω ) =
1 − 0.8e− j ω
Since ω0 = 2π /5, the system response at ω0 is
1
H (e j ω ) = = 0.9343 e− j 0.2517π
1 − 0.8e− j 2π/5
Hence yss (n) = 2(0.9343) cos(2π n/5 + π /3 − 0.2517π ), or
(c) Any xc (t) that has the same digital frequency ω0 after sampling and the same phase shift as above will
have the same steady state response. Since Fs = 100 sam/sec, the two other frequencies are 120 and 220
Hz.
X (e j ω ) = F [ A cos(ω0 n) wR (n)]
= ( A/2) F e j ω0 wR (n) + (A/2) F e− j ω0 wR (n) (1)
N−1
sin(ωN/2)
F [wR (n)] = e− j ωn = e− j ω(N−1)/2 (2)
n=0
sin(ω/2)
and the fact that complex exponential causes a translation in the frequency domain (1) can be written
after a fair amount of algebra and trigonometry as
X (e j ω ) = X R (e j ω ) + j X I (e j ω )
1
2 Statistical and Adaptive Signal Processing - Solution Manual
15 10
5
10
0
5
−5
0
−10
−5 −15
−4 −2 0 2 4 −4 −2 0 2 4
Figure 2.2bc: Real and Imaginary DTFT and DFT Plots(ω0 = π/4)
where
A sin[(ω − ω0 )N/2]
X R (e j ω ) = cos[(ω − ω0 )(N − 1)/2]
2 sin[(ω − ω0 )/2]
A sin{[ω − (2π − ω0 )]N/2}
+ cos[(ω + ω0 )(N − 1)/2] (3)
2 sin{[ω − (2π − ω0 )]/2}
and
A sin[(ω − ω0 )N/2]
X R (e j ω ) = − sin[(ω − ω0 )(N − 1)/2]
2 sin[(ω − ω0 )/2]
A sin{[ω − (2π − ω0 )]N/2}
− sin[(ω + ω0 )(N − 1)/2] (4)
2 sin{[ω − (2π − ω0 )]/2}
(b) N = 32 and ω0 = π /4. The DTFT plots are shown in Figure 2.2bc.
(c) The DFT samples are shown in Figure 2.2bc.
(d) N = 32 and ω0 = 1.1π /4. The plots are shown in Figure 2.2d.
The added spectrum for the second case above (ω0 = 1.1π /4) is a result of the periodic extension of the
DFT. For a 32-point sequence, the end of each extension does not line up with the beginning of the next
extension. This results in sharp edges in the periodic extension, and added frequencies in the spectrum.
(a) The 16-point DFT is shown in the top-left plot of Figure 2.3.
(b) The 32-point DFT is shown in the top-right plot of Figure 2.3.
(c) The 64-point DFT is shown in the bottom plot of Figure 2.3.
(d) The zero padding results in a lower frequency sampling interval. Hence there are more terms in the DFT
representation. The shape of the DTFT continues to fill in as N increases from 16 to 64.
15 10
5
10
0
5
−5
0
−10
−5 −15
−4 −2 0 2 4 −4 −2 0 2 4
Figure 2.2d: Real and Imaginary DTFT Plots (ω0 = 1.1π /4)
7 7
6 6
5 5
4 4
3 3
2 2
1 1
0 0
0 π/4 π/2 3π/4 π 5π/4 3π/2 7π/4 0 π/4 π/2 3π/4 π 5π/4 3π/2 7π/4
64−point DFT
8
0
0 π/4 π/2 3π/4 π 5π/4 3π/2 7π/4
Figure 2.3: The 16, 32, and 64-point DFTs of x(n) = cos(π n/4)
4 Statistical and Adaptive Signal Processing - Solution Manual
nx = length(x); x = reshape(x,nx,1);
nh = length(h); h = reshape(h,nh,1);
X = toeplitz([x; zeros(nh-1,1)],[x(1) zeros(1,nh-1)]);
y = X*h;
(c) Verification:
(d) The three plots appear to be identical. However, the conv function gives the largest error since both
sequences are truncated. The filter function would be best suited for infinite length sequences.
3 3 3
2 2 2
1 1 1
0 0 0
0 20 40 60 80 100 0 20 40 60 80 100 0 20 40 60 80 100
2.6 Hap (n) is a causal and stable all-pass system with input x(n) and output y(n). Then we have
∞
∞
|y(n)|2 = |x(n)|2
n=0 n=0
Consider
Then
∞
∞
|y0 (n) + y1 (n)| 2
= |x0 (n) + x1 (n)|2
n=0 n=0
∞
∞
∞
∞
∞
|y0 (n)| +
2
|y1 (n)| +
2
|y0 (n)y1(n)| = |x0 (n)| + 2
|x1 (n)|2
n=0 n=0 n=0 n=0 n=0
∞
∞
∞
|y0 (n)|2 + |y0 (n)y1(n)| = |x0 (n)|2
n=0 n=0 n=0
Hence
∞
∞
|y0 (n)| ≤ 2
|x0 (n)|2
n=0 n=0
n0
n0
|y(n)|2 ≤ |x(n)|2
n=0 n=0
p − z −1
H (z) = , | p| < 1
1 − p z −1
6 Statistical and Adaptive Signal Processing - Solution Manual
Then
sin ω sin ω
] H (e ) = arctan
jω
− arctan
cos ω − 1/ p cos ω − p
which is negative for | p| < 1 . This proves that ] H (e j ω ) decreases monotonically from ] H (e j 0 ) = π
to ] H (e j 2π ) = −π.
(b) A real second-order (complex-conjugate pole-pair) system: The system function is
(r ]θ) − z −1 (r ]θ )∗ − z −1
H (z) = , 0<r <1
1 − (r ]θ)∗ z −1 1 − (r ]θ ) z −1
Consider the term
(r ]θ) − z −1
H1 (z) ,
1 − (r ]θ) z −1
Then angle calculations are similar to those for the real first-order case if we rotate the coordinate system
by the angle θ, that is,
sin ω sin ω
] H1(e ) = arctan
jω
+ θ − arctan +θ
cos ω − 1/r cos ω − r
sin ω sin ω
= arctan − arctan
cos ω − 1/r cos ω − r
Thus following the arguments in (a), we conclude that ] H1 (e j ω ) decreases monotonically from ] H1 (e j 0 )
to ] H1 (e j 0 ) − π . Similarly, consider
(r ]θ) − z −1
H2 (z) ,
1 − (r ]θ ) z −1
] H1(e j ω ) = ] H1(e j ω ) + ] H2 (e j ω )
we conclude that ] H (e j ω ) decreases monotonically from ] H (e j 0) to ] H (e j 0) − 2π .
(c) Generalizing the above result for a real, causal, and stable PZ-AP system with P pole-zero pairs, we can
show that ] H (e j ω ) decreases monotonically from ] H (e j 0) to ] H (e j 0 ) − 2π P.
1
Hmix
0 Hmin
−1
0 0.2 0.4 0.6 0.8 1
Normalized frequency (Nyquist == 1)
(a)
1 − 2.5z −1 + z −2
R y (z) =
1 − 2.05z −1 + z −2
(1 − 12 z −1 )(1 − 2z −1 )
=
(1 − 45 z −1 )(1 − 54 z −1 )
(1− 21 z −1 ) (1−2z −1 )
Hence the minimum phase component is (1− 54 z −1 )
and the maximum phase component is (1− 54 z −1 )
.
(b)
3z 2 − 10 + 3z −2
R y (z) =
3z 2 + 10 + 3z −2
(1 − 13 z −2 )(1 − 3z −2 )
=
(1 + 13 z −2 )(1 + 3z −2 )
(1− 31 z −2 ) (1−3z −2 )
Hence the minimum phase component is (1+ 31 z −2 )
and the maximum phase component is (1+3z −2 )
.
1 − αz −1
Hap (z) = , |α| < 1
z −1 − α ∗
(a)
∗
|Hap (z)|2 = Hap (z)Hap (z)
1 − αz −1 1 − α ∗ z −1∗
= ( )( −1∗ )
z −1 − α ∗ z −α
∗ z
1 − αz −1 1 − α |z|2 z
= ( −1 ∗
)( ) where z −1∗ = 2
z −α z
|z|2
−α |z|
|z|2 − αz −1 |z|2 − α ∗ z − |α|2
=
1 − α ∗ z − αz −1 |z|2 + |α|2 |z|2
8 Statistical and Adaptive Signal Processing - Solution Manual
−3
x 10
1
−0.5
−1
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Normalized frequency (Nyquist == 1)
400
300
100
0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Normalized frequency (Nyquist == 1)
jω
Figure 2.11: Frequency Response of H (e )
(b)
(c) Using the result from part 2 above (for |α| < 1),
|Hap (z)| > 1 when (D|H |2 (z) − A|H |2 (z)) > 0 ⇒ |z| > 1
|Hap (z)| = 1 when (D|H |2 (z) − A|H |2 (z)) > 0 ⇒ |z| = 1
|Hap (z)| < 1 when (D|H |2 (z) − A|H |2 (z)) > 0 ⇒ |z| < 1
a + b z −1 + c z −2
H (z) =
c + b z −1 + a z −2
(a) Magnitude of the frequency response function:
|H (e j ω )|2 = H (e j ω )H (e− j ω )
a + b e− j ω + c e−2 j ω a + b e j ω + c e2 j ω
= ( )( )
c + b e− j ω + a e−2 j ω c + b e j ω + a e2 j ω
Simplifying
(b) Magnitude and phase response plots are shown in Figure 2.11.
Emax
Emin
5000
4000
Energy
3000
2000
1000
0
0 1 2 3 4
n
(a) Therefore, an FIR system with three zeros results in eight (23 ) FIR systems with identical magnitude
responses. They are obtained by reflecting each zero about the unit circle and applying the appropriate
Zero@ z1 z2 z3 Gain System
Hmax (z) -2.5 -1.33 1.5 12 12 + 28z − 29z −2 − 60z −3
−1
1 + z −1 − 6z −2
H (z) =
1 + 14 z −1 − 18 z −2
(1 + 3z −1 )(1 − 2z −1 )
H (z) =
(1 + 12 z −1 )(1 − 14 z −1 )
Hence
6 − z −1 − z −2
Hmin (z) =
1 + ( 14 )z −1 − ( 18 )z −2
10 Statistical and Adaptive Signal Processing - Solution Manual
0.5 0.5
-1
x(n) z y(n)
-0.5
0.5
-1
z
1/3
-1
z
-1/3
Figure 2.14: Parallel Structure of two AP systems
(c) This system is a Maximum-phase system since all zeros are outside the unit circle.
The direct form coefficients {ak }40 can be computed using the lat2dir function. The corresponding system
function is
1
H (z) =
1+ 0.76z −1 _0.731z −2 + 0.787z −3 + 0.7z −4
Using partial fraction expansion we obtain
x(n) + y(n)
-1
z
-0.76
+
-1
z
-0.731
+
-1
z
-0.787 x(n)
+ + + +
+
-0.7 -0.5 -0.3 -0.2
(a) Density plot for a = 1: f x (x) = e−x u(x) is shown in Figure 3.1
f (x)=e−xu(x)
x
1
0.8
0.6
0.4
0.2
0
0 2 4 6 8 10
Figure 3.1: Exponential density function
(b) Moments:
∞
i. Mean: µx = x f x (x)dx = 1/a = 1
−∞
∞
ii. Variance: σ 2x
= −∞ (x − µx )2 f x (x)dx = (1/a)2 = 1
iii. Skewness: The third central moment is given by
∞
(3)
3 ∞
γx = x − µx f x (x) dx = (x − 1)3 (e−x )dx = 2
−∞ 0
Hence
1 (3)
skewness = γ = 2 (⇒ leaning towards right)
σ 3x x
iv. Kurtosis: The fourth central moment is given by
∞ ∞
(4)
4
γx = x − µx f x (x) dx = (x − 1)4 (e−x )dx = 9
−∞ 0
Hence
1 (4)
kurtosis = γ −3= 9−3 =4
σ 4x x
which means a much flatter shape compared to the Gaussian shape.
(c) Characteristic function:
∞ ∞ 1
1 −x( 1 −s) 1
x = E{e s x(ξ)
}= f x (x)e dx =
sx
e a dx = a
=
−∞ 0 a 1
a
−s 1 − as
12
Statistical and Adaptive Signal Processing - Solution Manual 13
2
fx(x)=xe−x u(x)
0.5
0.4
0.3
0.2
0.1
0
0 2 4 6 8 10
Figure 3.2: Rayleigh density function
x −x 2 /(2σ 2 )
3.2 Rayleigh density : f x (x) = σ2
e u(x)
2
iii. Skewness: The third central moment is given by
∞ ∞ 3
(3)
3 1 √
3 3 √
x − π /2 (x e−x /2 )dx = √
2
γx = x − µx f x (x) dx = π −√ π
−∞ 0 2 2
Hence
√
3 √
1 √1 π − √32 π
skewness = 3 γ (3) = 2
3 = . 631 11 (⇒ leaning towards right)
σx x π
2−
2
iv. Kurtosis: The fourth central moment is given by
∞ ∞ 4
(4)
4 3π 2
x − π /2 (x e−x /2 )dx = 8 −
2
γx = x − µx f x (x) dx =
−∞ 0 4
: Hence
2
1 (4) 8 − 3π4
kurtosis = 4 γ x − 3 = − 3 = 0.2451
σx π 2
2−
2
which means a flatter but almost a Gaussian shape.
(c) Characteristic function (σ = 1):
∞ y
xe−x es x dx
2
x (s) = E{e s x(ξ)
}= f x (x)e dx =
sx
−∞ 0
1 √ 1 s2 1 1 √ 1 s2 1
= s πe 4 + + s π e erf
4 s
4 2 4 2
14 Statistical and Adaptive Signal Processing - Solution Manual
Similarly
m
m
r x(m) = E{( x(ζ ) − µx + µx ) } = E m
y(ζ ) k
µm−k
k=0
k x
y(ζ )
m
m
= µkx E{y(ζ )k }
k=0
k
m
m k (n−k)
r x(m) = µx γ x
k=0
k
where
¯ x (s) = ln
¯ x (s) = ln E es x(ζ ) = ln [x (s)]
and
∞
s m (m)
x (s) = r
m=0
m! x
Thus
1 dx (s)
κ (1) =
x
x (s) ds
!∞ s m (m+1)
s=0
r
= m=0 m! x
!∞ s m (m) = r x(1) = µx = 0 [ * zero mean x(ζ )]
rx
m=0 m! s=0
Similarly
!∞
s m (m+1)
d m=0 m! r x
κ (2) = !∞ s m (m)
x
ds
m=0 m! r x s=0
!∞ sm (m+2)
!∞ s m (m)
!∞
s m (m+1) 2
m=0 m! r x m=0 m! r x − r
m=0 m! x
= ! 2
∞ s m (m)
m=0 m! r x (1)
s=0,rx =0
= r x(2) = σ 2x
Statistical and Adaptive Signal Processing - Solution Manual 15
!∞ s m (m+2)
!∞ s m (m)
!∞
s m (m+1) 2
d m=0 m! r x m=0 m! r x − r
κ (3) = ! 2
m=0 m! x
x
ds ∞ s m (m)
m=0 m! r x (1)
s=0,rx =0
= γ (3)
x
3.6 Let x(ζ ) be a Gaussian random vector with mean vector µx and covariance matrix x , then the characteristic
function is
x (ξ ) = exp j ξ T µx − 21 ξ T x ξ
Let y(ζ ) = Ax where A is a non-singular matrix. Its characteristic function is given by
" T # " T #
y (ξ ) = E e j ξ y = E e j ξ Ax
" # $
T
T
%
= E e j (A ξ ) x = exp j AT ξ µx − 12 AT ξ x AT ξ
T T
= exp j ξ T Aµx − 12 ξ T A x AT ξ
which is a characteristic function of a Gaussian random vector with mean vector Aµx and covariance matrix
A x AT .
3.7 Sum of independent exponential random variables xk (ζ ): f xk (x) = e−x u(x).
(a) y2 (ζ ) = x1 (ζ ) + x2 (ζ ). Hence
x
−s s−x
f y2 (x) = f x1 (x) ∗ f x2 (x) = e e ds u(x)
0
= xe−x u(x)
The plot of this density is shown in Figure 3.7(a).
16 Statistical and Adaptive Signal Processing - Solution Manual
(b) y3 (ζ ) = y2 (ζ ) + x3 (ζ ). Hence
x
−s s−x
f y3 (x) = f y2 (x) ∗ f x3 (x) = se e ds u(x)
0
1 2 −x
= x e u(x)
2
The plot of this density is shown in Figure 3.7(b).
(c) y4 (ζ ) = y3 (ζ ) + x4 (ζ ). Hence
x
1 2 −s s−x
f y4 (x) = f y3 (x) ∗ f x4 (x) = s e e ds u(x)
2 0
1 3 −x
= x e u(x)
6
The plot of this density is shown in Figure 3.7(c).
y1 = x1 y2 = x1+x2
1 1
f1(y1)
f2(y2)
0.5 0.5
0 0
0 5 10 15 0 5 10 15
y1 y2
y3 = x1+x2+x3 y4 = x1+x2+x3+x4
1 1
f3(y3)
f4(y4)
0.5 0.5
0 0
0 5 10 15 0 5 10 15
y y
3 4
Figure 3.7: Sums of IID exponentially distributed random variables
(d) As k increases, the distribution of yk (ζ ) approaches a Gaussian distribution, with a mean equal to the sum
of the exponential distribution means.
(a) x(n, ζ ) = A(ζ ), where random variable A(ζ ) is uniformly distributed between 0 and 1. Now
1
µx (n) = E {x(n, ζ )} = E {A(ζ )} =
2
Statistical and Adaptive Signal Processing - Solution Manual 17
and
1
r x (n 1 , n 2 ) = E {x(n 1 , ζ )x(n 2 , ζ )} = E A2 (ζ ) =
3
Hence the process is WSS. Consider
1 N
1 N
1
E x(n, ζ ) = E {x(n, ζ )} = E {A(ζ )} = = µx
2N + 1 −N 2N + 1 −N 2
However, the computed mean remains at the observed value of x(n, ζ 0 ) , a0 and does not converge to
the true mean of 1/2. Hence the process is not m.s. ergodic in the mean.
(b) x(n, ζ ) = A(ζ ) cos ω0 n, where random variable A(ζ ) is a unit Gaussian random variable. Then
and
r x (n 1 , n 2 ) = E {x(n 1 , ζ )x(n 2 , ζ )} = E A2 (ζ ) cos ω0 n 1 cos ω0 n 2
= cos ω0 n 1 cos ω0 n 2
Thus the process is not WSS. Therefore, the m.s. ergodicity cannot be determined because the process
must be WSS.
(c) x(n, ζ ) is Bernoulli process with Pr [x(n, ζ ) = 1] = p and Pr [x(n, ζ ) = −1] = 1 − p. Then
and
&
(2 p − 1)2 , n 1 = n 2
r x (n 1 , n 2 ) = (5)
1, n1 = n2
!N
Hence it is WSS. Consider the random variable x(n, ζ ) N = 1
2N+1 −N x(n, ζ )
1 N
E x(n, ζ ) N = E {x(n, ζ )} = 2 p − 1 = µx (n)
2N + 1 −N
1 N N
= r x (n 1 , n 2 )
(2N + 1)2 −N −N
Thus
$
2 % "
2 # 2
var x(n, ζ ) N = E x(n, ζ ) N
− E x(n, ζ ) N
1 2
= 2
M + M − M (2 p − 1) 2
− (2 p − 1)2
M
1 2
≈ 2
M (2 p − 1)2 − (2 p − 1)2 for large M
M
$
2 %
Thus var x(n, ζ ) N → 0 as N → ∞. Hence the process is m.s. ergodic in the mean.
!N
3.9 Harmonic process: x(n) = k=1 Ak cos(ωk n + φ k ), φ k uniformly distributed over [0, 2π ]
(a) Mean:
M
M
E{x(n)} = E{ Ak cos(ωk n + φ k )} = Ak E{cos(ωk n + φ k )}
k=1 k=1
2π
1
M
= Ak cos(ωk n + φ k ) dφ k = 0
2π k=1 0
(b) Autocorrelation:
M
x(n) = Ak cos(ωk n + φ k )
k=1
1
M
F
⇔ X (ω) = Ak (δ(ω − ωk )e− j φk + δ(ω + ωk )e j φk )
2 k=1
1
M
|·|2
⇔ Rx (e j ω ) = |Ak |2 (δ(ω − ωk ) + δ(ω + ωk ))
4 k=1
1
M
F −1
⇔ r x (l) = |Ak |2 cos ωk l
2 k=1
3.10 Harmonic process with φ k distributed as f φk (φ k ) = 1 + cos φ k /2π , −π ≤ φ k ≤ π . Consider the mean
sequence
M
M
E{x(n)} = E{ Ak cos(ωk n + φ k )} = Ak E{cos(ωk n + φ k )}
k=1 k=1
π
1
M
= Ak cos(ωk n + φ k ) 1 + cos φ k dφ k = (cos ωk n) π
2π k=1 −π
1+ 13 z −1
3.12 LTI system: y(n) = 12 y(n − 1) + x(n) + 13 x(n − 1) ⇒ H (z) = 1− 12 z −1
, |z| < 1
2
3
Input process: zero-mean, WSS with r x (l) = 0.5|l| ⇒ Rx (z) = 5 1
4
−1
, 1
< |z| < 2
4 − 2 (z+z )
2
(b) Cross-correlation and cross-PSD between the input and output: Consider
Rx y (z) = H ∗ 1/z ∗ Rx (z) = H z −1 Rx (z)
( )( )
1 + 13 z 3
1
= 4
, < |z| < 2
1 − 2z
1 5
4
1 −1
− 2 (z + z ) 2
14 20 2
= + +
9 (2z − 1) 3 (z − 2) 2 9 (z − 2)
7 −1 1 10 −1 2z −1 2 −1 1
= z
+ z
2 + z
9 1 − 2z1 −1 3 1 − 2z −1 9 1 − 2z −1
1+1.25z −1
3.13 LTI system: y(n) = 0.6y(n − 1) + x(n) + 1.25x(n − 1) ⇒ H (z) = 1−0.6z −1
, |z| < 0.6
Input process: WSS with PSD Rx (e j ω ) = 1.64+1.6
1
cos ω
R y (e j ω ) = |H (e j ω )|2 Rx (e j ω ) = H (e j ω )H ∗ (e j ω )Rx (e j ω )
= H (e j ω )H (e− j ω )Rx (e j ω )
1 + 1.25e− j ω 1 + 1.25e j ω
= Rx (e j ω )
1 − 0.6e− j ω 1 − 0.6e j ω
2.5625 + 2.5 cos ω 1
=
1.36 − 1.2 cos ω 1.64 + 1.6 cos ω
19. 531
=
17 − 15 cos ω
(a) Valid
(b) Valid
(c) Not Valid since det R3 < 0
(d) Not Valid since non-Hermitian: R4 = R4T
R · R · R · . . . R · qi = R · R · R
· . . . R· λi qi
k k−1
= λi R · R · R
· . . . R· qi (since λi is a scalar)
k−1
= λi R · R · R
· . . . R· λi qi
k−2
= λ2i R · R · R
· . . . R· qi
k−2
..
.
R k q = λk q
3.17 Trace of R:
tr(R) = tr(QQH )
= tr(QQH )
= tr(I)
= tr() = λi
3.18 Determinant of R:
det R = |R|
= |QQH |
= |Q| || |QH |
*
= || = λi (since Q is orthonormal)
i
22 Statistical and Adaptive Signal Processing - Solution Manual
(a) From Rx above, the matrix is Hermitian, that is, ri j = r ∗j i , Toeplitz since ri, j = ri− j , and nonnegative
definite since it is correlation matrix of a random vector.
(b) To determine the correlation matrix of x̄ = [x(0) x(1) x(2) x(3)], we need r x (1) which is not available.
3.22 Nonnegative definiteness of r x (l): Using the nonnegativeness of E{|α 1 x(1) + · · · + α M x(M)|2 }, we have
(a) Autocorrelation r x (n 1 , n 2 ): First consider the crosscorrelation between x(n 1 ) and w(n 2 ), n 1 , n 2 ≥ 0
E x(n 1 )w ∗ (n 2 ) = E [αx(n 1 − 1) + w(n 1 )] w ∗ (n 2 )
= αr xw (n 1 − 1, n 2 ) + rw (n 1 , n 2 ), n 1 , n 2 ≥ 0
r xw (n 1 , n 2 ) = αr xw (n 1 − 1, n 2 ) + σ 2w δ(n 1 − n 2 ), n 1 , n 2 ≥ 0 (6)
Statistical and Adaptive Signal Processing - Solution Manual 23
or
σ 2w z 1−n2
Rxw (z 1 , n 2 ) = ⇒ r xw (n 1 , n 2 ) = σ 2w α n1 −n2 u(n 1 − n 2 ), n 1 , n 2 ≥ 0 (7)
1 − αz 1−1
which as (n 1 , n 2 ) → ∞ tends to
r xw (n 1 − n 2 ) = r xw (l) = σ 2w α l u(l), l = (n 1 − n 2 )
r x (n 1 , n 2 ) = αr x (n 1 , n 2 − 1) + r xw (n 1 , n 2 ), n 1 , n 2 ≥ 0 (8)
subject to r x (n 1 , −1) = E {x(n 1 )x ∗ (−1)} = 0. From (7), since r xw (n 1 , n 2 ) = 0 for n 2 > n 1 , first consider
the interval 0 ≤ n 2 ≤ n 1 . Taking unilateral z-transform of (8) with respect to n 2 , we have
Rx (n 1 , z 2 ) = αz 2−1 Rx (n 1 , z 2 ) + Z σ 2w α n1 −n2 u(n 1 − n 2 )
or
α n1 1 z 2−1 z 2−n1
1− αz 2−1 Rx (n 1 , z 2 ) = σ 2w −
1 − α1 z 2−1 α 1 − α1 z 2−1
or
σ2 −n −1
σ 2w α n1 w
α 2
z 1
Rx (n 1 , z 2 ) =
−
(9)
1 − αz 2−1 1 − α1 z 2−1 1 − αz 2−1 1 − α1 z 2−1
which after inverse z-transformation yields [note that the second term in (9) does not contribute in the
interval 0 ≤ n 2 ≤ n 1 ]
σ 2w n1 −n2
r x (n 1 , n 2 ) = α − α 2 α n1 +n2 , 0 ≤ n 2 ≤ n 1 (10)
1 − α2
Now consider the interval 0 ≤ n 1 < n 2 < ∞. In this interval, r xw (n 1 , n 2 ) = 0 for n 1 < n 2 , the partial
difference equation (8) has no forcing function part, that is, the partial difference equation is
σ 2w
r x (n 1 , n 1 ) = 1 − α 2 α 2n1
1 − α2
24 Statistical and Adaptive Signal Processing - Solution Manual
σ 2w
r x (n 1 , n 2 ) = 1 − α 2 α 2n1 α n2 −n1 u(n 2 − n 1 ), n 1 ≥ 0 (12)
1 − α2
Finally, combining (10) and (12), we obtain
2
σw
α n1 −n2 − α 2 α n1 +n2 , 0 ≤ n2 ≤ n1
r x (n 1 , n 2 ) = σ 2w
1−α 2 (13)
1−α 2
1 − α 2 α 2n1 α n2 −n1 , n2 > n1 ≥ 0
1−α 2
α n2 −n1 , n 2 > n 1 ≥ 0 ⇒ l < 0
or
σ 2w
αl ,l ≥ 0 σ 2w
r x (n 1 , n 1 − l) = 1−α 2
σw 2 = α |l| (14)
α −l ,l < 0 1 − α2
1−α 2
−2 −1 0 1 2 3 4
Figure 3.25: Sigma Concentration Ellipses
Similarly
r x (M) = a M r x (0)
(c) Let
1 0 ··· 0 0
−a 1 · · · 0 0
.. .. . . .. ..
Lx = . . . . .
0 0 ··· 1 0
0 0 ··· −a 1
26 Statistical and Adaptive Signal Processing - Solution Manual
Then
1 −a · · · 0 0 1 a ··· a M−1
0 1 ···
0 0 a 1 ··· a M−2
σ 2w .. .. .. .. .. .. .. .. ..
LTx Rx Lx = . . . . . . . . .
1 − a2
..
−a a a M−3 · · ·
M−2
0 0 . 1 a
0 0 ··· 0 1 a M−1
a M−2 · · · 1
1 0 ··· 0 0
−a 1 · · · 0 0
.. .. . . .. ..
× . . . . .
0 0 ··· 1 0
0 0 ··· −a 1
= σ 2w I
(d) Plots of the DKLT and the DFT is shown in Figure 3.26d. The PSD points approach the eigenvalues as
2
M=8 (Diamond=eigenvalues) a=0.95 1
M=8 (Diamond=eigenvalues) a=0.5
10 10
1
10
0 0
10 10
−1
10
−2 −1
10 10
0 2 4 6 8 0 2 4 6 8
3
M=16 (Diamond=eigenvalues) a=0.95 1
M=16 (Diamond=eigenvalues) a=0.5
10 10
2
10
1
10
0
10
0
10
−1
10
−2 −1
10 10
0 5 10 15 0 5 10 15
3
M=32 (Diamond=eigenvalues) a=0.95 1
M=32 (Diamond=eigenvalues) a=0.5
10 10
2
10
1 0
10 10
0
10
−1 −1
10 10
0 10 20 30 40 0 10 20 30 40
0.2
0.2
0.1
0
0 0
−0.1
−0.2
−0.2
−0.3
0.2
0.2 0.1
0.1
0
0 0
−0.1
−0.2
−0.2 −0.1
−0.3
0.2
0.2
0.1
0
0 0
−0.1
−0.2
−0.2
−0.3
UDL Triangularization
1
1 0.9375 0 1 0
Rx = Ux D(x)
U Ux
H
= 4
0 1 0 1 1 14
w ∼ N(0, D(x)
U ), x = Ux w
(a) Given that x(n) = w(n) + b w(n − 1) with w(n)˜WN(0, σ 2w ), the complex PSD is
Rx (z) = σ 2w 1 + b z −1 (1 + b z) = σ 2w b z + (1 + b2 ) + b z −1
28 Statistical and Adaptive Signal Processing - Solution Manual
0.2
0.2
0.1
0
0 0
−0.1
−0.2
−0.2
−0.3
0.2 0.2
0.4
0.1 0.1
0.2
0 0
0 −0.1 −0.1
−0.2 −0.2
−0.2
−0.3 −0.3
0.2
0.2
0.1
0
0 0
−0.1
−0.2
−0.2
−0.3
0.2 0.1 0
0 2 4 6 8 0 5 10 15 20 0 10 20 30 40
with
π (1)
λ = σ 2w 1 + b2 = σ 2w 1 + b2 + 2b cos(π /2) = Rx (e j ω1 ), ω1 = π /2 =
1+1
π (1)
qn(1) = 1 = sin π n/2 = sin ω1 n; n = 1, ω1 = π /2 =
1+1
Statistical and Adaptive Signal Processing - Solution Manual 29
Consider M = 2: Then
1 + b2 b
Rx = σ 2w
b 1 + b2
λk = Rx (e j ωk ); ωk = π k/(M + 1), k = 1, 2, . . . , M
and
Rx(ejω)
0
0 0.1111 0.2222 0.3333 0.4444 0.5556 0.6667 0.7778 0.8889 1
ω/π
(b) Assume M = 8, b = 0.9, and σ 2w = 1. The Matlab script is shown below and the plot is shown in
Figure 3.28.
var_w = 1; M = 8; b = 0.9;
r = var_w*[(1+b*b),b,zeros(1,M-2)];
R = toeplitz(r);
Lambda = eig(R); Lambda = flipud(sort(Lambda));
k = 1:M;
omg_k = pi*k/(M+1);
omg = (0:500)*pi/500;
PSD = var_w*((1+b*b)+2*b*cos(omg));
Hf_1 = figure(’units’,SCRUN,’position’,SCRPOS,...
’paperunits’,PAPUN,’paperposition’,[0,0,5,3]);
set(Hf_1,’NumberTitle’,’off’,’Name’,’Pr0328b’);
3.30 Let x(n) be a stationary random process with mean µx and covariance γ x (l). Let µ̂x be the sample mean
estimator of µx given by
1
N−1
µ̂x = x (n)
N n=0
1 1
N−1 N−1
E[µ̂x ] = E[x (n)] = µ = µx
N n=0 N n=0 x
1 1 1 ∗
N−1 N−1 N−1 N−1
∗ ∗
= 2
E x (n) x (m) − E [x (n)] µ x − E x (m) µx + µx µ∗x
N n=0 m=0 N n=0 N m=0
1
N−1
2 1 2
N−1 N−1 N−1 N−1 N−1
= E x (n) x ∗
(m) − µ x = 1 E x (n) x ∗
(m) − µ
N 2 n=0 m=0 N 2 n=0 m=0 N 2 n=0 m=0 x
1 " 2 #
N−1 N−1 N−1
N−1
= E x (n) x ∗
(m) − µ x = 1 γ (n − m)
N 2 n=0 m=0 N 2 n=0 m=0 x
Thus
1
N−1 N−1
var µ̂x = 2 γ (n − m) (15)
N n=0 m=0 x
32 Statistical and Adaptive Signal Processing - Solution Manual
Using chamge of variables n − m = l, we can reduce double summation into a single summation
N
1 |l|
var µ̂x = 1− γ x (l)
N l=−N N
|l|
Since 1 − N
≤ 1,
1 1
N N
var µ̂x ≤ γ x (l) ≤ γ x (l)
N l=−N N l=−N
Since for a real-valued random process ρ x (l) = ρ x (−l) and using symmetry of |l|, we obtain
−1 N
σ 2x −l l
var µ̂x = 1− ρ x (−l) + 1 + 1− ρ x (l)
N l=−N N l=1
N
N
σ 2x l
= 1+2 1− ρ x (l)
N l=1
N
N
σ 2x l
= 1 + N (ρ x ) , N (ρ x ) , 2 1− ρ x (l)
N l=1
N
σ 2x
(c) When x(n)˜WN µx , σ 2x , then ρ x (l) = δ(l) or N (ρ x ) = 0. Hence var µ̂x = N
.
3.31 Let x(n) be a stationary random process with mean µx and covariance γ x (l). Let σ̂ 2x be the sample variance
estimator of σ 2x given by
1 2
N−1
σ̂ 2x = x (n) − µ̂x
N n=0
1 $ 2 % 1 $ 2 %
N−1 N−1
E[σ̂ 2x ] = E x (n) − µ̂x = E x (n) − µx − µ̂x + µx
N n=0 N n=0
1 $
2 %
N−1
= E x (n) − µx − µ̂x − µx
N n=0
1 $ 2
2 %
N−1
= E x (n) − µx − x (n) − µx µ̂∗x − µ∗x − x ∗ (n) − µ∗x µ̂x − µx + µ̂x − µx
N n=0
1
N−1
= σ 2x + var µ̂x − E x (n) − µx µ̂∗x − µ∗x + x ∗ (n) − µ∗x µ̂x − µx (16)
N n=0
Statistical and Adaptive Signal Processing - Solution Manual 33
Consider
$ 2 %
E x (n) − µx µ̂∗x − µ∗x = E x (n) µ̂∗x − x(n)µ∗x − µx µ̂∗x + µx
2 2 2 2
= E x (n) µ̂∗x − µx − µx + µx = E x (n) µ̂∗x − µx (17)
Similarly,
2
E x ∗ (n) − µ∗x µ̂x − µx = E x ∗ (n) µ̂x − µx (18)
Consider
1
N−1
1
N−1
E x (n) µ̂∗x = E x(n) ∗
x (m) = E x(n)x ∗ (m)
N m=0
N m=0
1 $ 2 % 1 2
N−1 N−1
= γ x (n − m) + µx = γ x (n − m) + µx (19)
N m=0 N m=0
and
1 $ ∗ 2 % 1 ∗ 2
N−1 N−1
E x ∗ (n) µ̂x = γ x (n − m) + µx = γ x (n − m) + µx (20)
N m=0 N m=0
Substituting (17), (18), (19), and (20) in (16), we obtain
1 1 ∗
N−1 N−1 N−1 N−1
E[σ̂ 2x ] = σ 2x + var µ̂x − 2 γ x (n − m) − 2 γ (n − m) (21)
N n=0 m=0 N n=0 m=0 x
But from (15) in Problem 3.30
1 1 ∗
N−1 N−1 N−1 N−1
var µ̂x = 2 γ x (n − m) = 2 γ (n − m) (22)
N n=0 m=0 N n=0 m=0 x
Substituting (22) in (21), we obatin
N
1 |l|
E[σ̂ 2x ] = σ 2x − var µ̂x = σ x −
2
1− γ x (l)
N l=−N N
The last equality follows from Problem 3.30.
σ 2x
(b) When x(n)˜WN µx , σ 2x , then γ x (l) = σ 2x δ(l). Hence E[σ̂ 2x ] = σ 2x − N
= (N − 1) σ 2x /N .
1 1 1 !N
3.32 Cauchy distribution with mean µ: f x (x) = . The mean estimator is µ̂(ζ ) = xk (ζ ). Then
π 1_ (x − µ)2 N k=1
the mean of µ̂(ζ ) = µ and
2
var(µ̂) = E{ µ̂ − µ } = E{µ̂2 − 2µµ̂ + µ2 |}
1
N
= E{µ̂2 } − 2µ E{µ̂} + µ2 = E{( xk (ξ ))2 } − µ2
N k=1
1
N
= E{xk (ξ )2 } − µ2
N 2 k=1
E{x(ξ )2 }
= − µ2 = 0 as N → ∞
N
Therefore, µ̂(ζ ) is not a consistent estimator.
Chapter 4
4.1 Show that a second-order pole pi contributes the term npin u(n) and a third-order pole the terms npin u(n) +
n 2 pin u(n) to the impulse response of a causal PZ model.
The general expression for a PZ model with double poles in the z-domain is
D(z) k=1Q
(1 − z k z −1 )
H (z) = = d0 ; Q < P, |z| > max (| pk |) , max | pk | < 1
A(z) (1 − p0 z −1 )2 k=1
P−2
(1 − pk z −1 )
Using partial fraction expansion on this expression and only keeping the double term simplifies to
A1 z −1 A2 B(z)
H (z) = + + P−2
(1 − p0 z −1 )2 (1 − p0 z −1 ) k=1 (1 − pk z −1 )
where B(z) is a polynomial of order less than P − 2. After taking inverse z-transform,
B(z)
h(n) = A1 n p0n u(n) + A2 p0n u(n) + Z −1
k=1
P−2
(1 − pk z −1 )
Similarly, for a third-order pole, we can write
A1 z −2 A2 z −1 A3 B(z)
H (z) = + + P−3
(1 − p0 z ) (1 − p0 z )
−1 3 −1 2 (1 − p0 z ) k=1 (1 − pk z −1 )
−1
34
Statistical and Adaptive Signal Processing - Solution Manual 35
(b) The autocorrelation sequence r x (l) can be found using the factorization of Rx (z):
9 1 + 13 z 1 + 13 z −1
Rx (z) =
32 1 + 14 z 1 + 14 z −1
3 11 11 1
= −
+
, < |z| < 4
8 120 1 + 4 z 1 −1 120 1 + 4z −1 4
Hence
3 11 1 |l|
r x (l) = δ(l) − −
8 120 4
1
|l|
|l|
4.3 A sequence with an autocorrelation r x (l) = 2
+ − 12 .
(a) From the autocorrelation, we can see that x(n) has no dependence with x(n−1) but does have a dependence
on x(n − 2). We can assume x(n) to have the following form
which results in a = 1
4
and b = 15
8
Checking to see that x(n) has no dependence on x(n − 1)
Therefore,
1 15
x(n) = x(n − 2) + w(n)
4 8
(b) A pdf of the realization of the process is shown in Figure 4.3b. The dotted line represents a true Gaussian
pdf.
(c) The true and estimated autocorrelation are shown in Figure 4.3c.
4.4 Computing the autocorrelations directly for the two systems, where w(n) ∼ WGN(0,1)
80 1
0.8
60
0.6
40 0.4
0.2
20
0
0 −0.2
−5 0 5 0 2 4 6 8 10
Figure 4.3bc: Gaussian Process
Comparing these two autocorrelation, they both have the same ratio of dependence on the previous two inputs.
4.5 Investigate how well the all-zero systems approximate the single pole system
The single pole system with a pole at a has a system function of
∞
1
H (z) = −1
= a n z −n
1 − az n=0
N
HN (z) = a n z −n
n=0
The Figure 4.5.1 shows the pole-zero plots, magnitude plots, and impulse response for a single pole system
with the poles located at a = 0.7 and 0.95 respectively.
Figure 4.5.2 shows the pole-zero plots, magnitude plots and impulse response for a = 0.7 and N = 8 Figure
4.5.3 shows the pole-zero plots, magnitude plots and impulse response for a = 0.7 and N = 16 Figure 4.5.4
shows the pole-zero plots, magnitude plots and impulse response for a = 0.7 and N = 64 Figure 4.5.5 shows
the pole-zero plots, magnitude plots and impulse response for a = 0.95 and N = 8 Figure 4.5.6 shows the
pole-zero plots, magnitude plots and impulse response for a = 0.95 and N = 16 Figure 4.5.7 shows the
pole-zero plots, magnitude plots and impulse response for a = 0.95 and N = 64
Clearly from these figures, it can be seen that an all zero system can approximate a single pole system. The
number of zeroes necessary depends on how close to the unit circle the pole lies. As the pole moves closer to
the unit circle, more zeroes are needed to have the same magnitude response.
Statistical and Adaptive Signal Processing - Solution Manual 37
a=0.7, N=∞
a=0.7 a=0.7
1
3.5 1
3
0.5 0.8
Imaginary part
2.5
0 0.6
2
0.4
−0.5 1.5
1 0.2
−1
−1 −0.5 0 0.5 1 0.5 0
Real part 0 0.2 0.4 0.6 0.8 1 0 20 40 60 80 100
a=0.95, N=∞
a=0.95
1 20
a=0.95
1
0.5 0.8
15
Imaginary part
0 0.6
10
0.4
−0.5
5
0.2
−1
−1 −0.5 0 0.5 1 0 0
Real part 0 0.2 0.4 0.6 0.8 1 0 20 40 60 80 100
a=0.7, N=8
1
a=0.7, N=8 a=0.7, N=8
3.5 1
0.5 3
0.8
Imaginary part
2.5
0 0.6
2
0.4
−0.5 1.5
0.2
1
−1
−1 −0.5 0 0.5 1 0.5 0
Real part 0 0.2 0.4 0.6 0.8 1 0 2 4 6 8
a=0.7, N=16
1
a=0.7, N=16 a=0.7, N=16
3.5 1
0.5 3
0.8
Imaginary part
2.5
0 0.6
2
0.4
−0.5 1.5
0.2
1
−1
−1 −0.5 0 0.5 1 0.5 0
Real part 0 0.2 0.4 0.6 0.8 1 0 5 10 15 20
a=0.7, N=64
1
a=0.7, N=64 a=0.7, N=64
3.5 1
0.5 3
0.8
Imaginary part
2.5
0 0.6
2
0.4
−0.5 1.5
0.2
1
−1
−1 −0.5 0 0.5 1 0.5 0
Real part 0 0.2 0.4 0.6 0.8 1 0 20 40 60 80
a=0.95, N=8
a=0.95, N=8
1 8
a=0.95, N=8
1
0.5 6 0.8
Imaginary part
0 0.6
4
0.4
−0.5
2
0.2
−1
−1 −0.5 0 0.5 1 0 0
Real part 0 0.2 0.4 0.6 0.8 1 0 2 4 6 8
a=0.95, N=16
a=0.95, N=16 a=0.95, N=16
1 12 1
10
0.5 0.8
Imaginary part
8
0 0.6
6
0.4
−0.5 4
2 0.2
−1
−1 −0.5 0 0.5 1 0 0
Real part 0 0.2 0.4 0.6 0.8 1 0 5 10 15 20
a=0.95, N=64
a=0.95, N=64 a=0.95, N=64
1 20 1
0.5 0.8
15
Imaginary part
0 0.6
10
0.4
−0.5
5
0.2
−1
−1 −0.5 0 0.5 1 0 0
Real part 0 0.2 0.4 0.6 0.8 1 0 20 40 60 80
Hence
−a1 = ρ 1 + ρ 1 a2 = ρ 1 (1 + a2 )
−a2 = ρ 1 a1 + ρ 2
or
& '
a1 1 + a2 0 ρ1 1 0 a2 0 ρ1
−a = − = = + = Aρ
a2 a1 1 ρ2 a1 1 0 0 ρ2
Thus the matrix A is a sum of triangular Toeplitz and triangular Hankel matrices. Consider (4.2.33) for P = 3:
ρ1 1 ρ1 ρ2 a1 a1 + ρ 1 a2 + ρ 2 a3
− ρ 2 = ρ 1 1 ρ 1 a2 = ρ 1 a1 + a2 + ρ 1 a3
ρ3 ρ2 ρ1 1 a3 ρ 2 a1 + ρ 1 a2 + a3
Hence
−a1 = ρ 1 + ρ 1 a2 + ρ 2 a3 = ρ 1 (1 + a2 ) + ρ 2 a3
−a2 = ρ 1 a1 + ρ 2 + ρ 1 a3 = ρ 1 (a1 + a3 ) + ρ 2
−a3 = ρ 2 a1 + ρ 1 a2 + ρ 3 = ρ 1 a2 + ρ 2 a1 + ρ 3
or
a1 (1 + a2 ) a3 0 ρ1
−a = − a2 = (a1 + a3 ) 1 0 ρ2
a3 a2 a1 1 ρ3
1 0 0 a2 a3 0 ρ1
= a1 1 0 + a3 0 0 ρ 2 = Aρ
a2 a1 1 0 0 0 ρ3
Again the matrix A is a sum of triangular Toeplitz and triangular Hankel matrices. Similarly for P = 4, we
obtain
ρ1 1 ρ1 ρ2 ρ3 a1 a1 + ρ 1 a2 + ρ 2 a3 + ρ 3 a4
ρ 2 ρ 1 1 ρ 1 ρ 2 a2 ρ 1 a1 + a2 + ρ 1 a3 + ρ 2 a4
−
ρ 3 = ρ 2 ρ 1 1 ρ 1 a3 = ρ 2 a1 + ρ 1 a2 + a3 + ρ 1 a4
ρ4 ρ3 ρ2 ρ1 1 a4 ρ 3 a1 + ρ 2 a2 + ρ 1 a3 + a4
or
a1
1 0 0 0 a2 a3 a4 0 ρ
a2 1
a1 1 0 0 a3 a4 0 0 ρ
−a = − = + 2 = Aρ
a3
a2 a1 1 0 a4 0 0 0
ρ3
a4 a3 a2 a1 1 0 0 0 0 ρ4
Hence for a general case, the matrix A is given by the sum of triangular Toeplitz and triangular Hankel matrices.
40 Statistical and Adaptive Signal Processing - Solution Manual
4.7 To determine the autocorrelation and partial autocorrelation coefficients of the following two AR models, we
can use the Yule-Walker equations
Rx a = −rx
Therefore the autocorrelation coefficients are r x (0) = 12.9, r x (1) = 12.01 and r x (3) = 10.4 with the
partial autocorrelation coefficients equal to a1(1) = −0.931 and a2(2) = 0.456.
(a) To find ρ x (1) first solve for the first two autocorrelation coefficients
ρ x (l) = ρ x (l − 1) − 0.5ρ x (l − 2)
(c) The plot of ρ x (l) is shown in the left plot of Figure 4.8cd.
(d) The corresponding PSD of the model is shown in the right plot of Figure 4.8cd.
PSD of rho(l)
rho(l) 4
1
0.8
3
0.6
0.4 2
0.2
0 1
−0.2
−0.4 0
0 5 10 15 0 0.2 0.4 0.6 0.8 1
Figure 4.8cd: Period of ρ(l)
The period (T ) shown in the plot of ρ(l) is approximately 8. Thus, the frequency is 0.125(1/T ). This is
approximately the frequency peak in the PSD plot.
42 Statistical and Adaptive Signal Processing - Solution Manual
4.9 The ACS can be computed directly by rearranging terms and using the matrix inverse
r x (0) r x (1) r x (2) r x (3) 1 |d0 |2
r x (1) r x (0) r x (1) r x (2) a1 0
r x (2) r x (1) r x (0) r x (1) a2 = 0
r x (3) r x (2) r x (1) r x (0) a3 0
1 a1 a2 a3 r x (0) |d0 |2
a1 1 + a2 a3 0 r x (1)
= 0
a2 a1 + a3 1 0 r x (2) 0
a3 a2 a1 1 r x (3) 0
−1
r x (0) 1 a1 a2 a3 |d0 |2
r x (1)
= a1 1 + a2 a3 0 0
r x (2) a2 a1 + a3 1 0 0
r x (3) a3 a2 a1 1 0
Substituting in the values for the parameters from Example 4.2.3 results in the correct values for the ACS.
r x (0) 2.8840 2.0011 0.0003 0.4508 0.6937 2.0
r x (1) 1.6
= 2.3074 2.5236 0.1444 0.3607 0 =
r x (2) 1.7309 2.1813 1.1534 0.2705 0 1.2
r x (3) 1.4426 1.6588 1.0093 1.2255 0 1.0
Note: this problem can also be solved using Cramer’s rule. The solution for Problem 4.12 shows how to use
Cramer’s rule.
(a) In order to plot the PSD of x(n) first compute the ACS
1200
200
1000
150
800
600 100
400
50
200
0 0
0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1
Figure 4.10ab: Power Spectral Density
0.8
100
0.6
0.4
50
0.2
0 0
0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1
Figure 4.10cd: Power Spectral Density
(d) The PSD of y(n) is computed in a similar manner as x(n) above. It is shown in the left plot of Figure
4.10cd. The right plot of Figure 4.10cd shows the magnitude response of the system H (z) = Y (z)/x(z)
Clearly, H (z) is a notch filter, with the frequency notches corresponding to the peak frequency of the PSD
of x(n). This filter removes the strong correlation found in x(n) and generates an uncorrelated signal
found in part (c) above.
(a) The normalized autocorrelation sequence, for each of the two models, can be found directly as follows
i. x(n) = 0.6x(n − 1) + 0.3x(n − 2) + w(n):
Thus r x (0) = σ 2x = 4.146, and r x (1) = 3.553. Therefore, the normalized autocorrelation sequence
is
Thus r x (0) = σ 2x = 1.863 and r x (1) = 0.994. Therefore, the normalized autocorrelation sequence
is
rho1(l) rho2(l)
1 1
0.8
0.8
0.6
0.6
0.4
0.4 0.2
0
0.2
−0.2
0 −0.4
0 5 10 15 0 5 10 15
Figure 4.11b: AR(2) System
(b) Figure 4.11b shows the normalized autocorrelation sequences of the two models respectively. From these
plots, x(n) = 0.6x(n − 1) + 0.3x(n − 2) + w(n) does not show any pseudo-periodic behavior, while
x(n) = 0.8x(n − 1) − 0.5x(n − 2) + w(n) does show pseudo-periodic behavior.
(c) Figure 4.11c shows the PSD of the two models. Clearly, the first model has no fundamental frequency.
While the second system does indeed have a large no zero frequency component.
4.12 The PACS for an AP(3) model can be derived from the Yule-Walker equations and Cramer’s rule.
Statistical and Adaptive Signal Processing - Solution Manual 45
1.5
6
4
1
0 0.5
0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1
Figure 4.11c: AR(2) System
Rx a = −rx
Cramer’s rule is used to determine vector values without having to compute the inverse of the entire
matrix. If x = A−1 b then the j th component of x can be computed using the determinants of two
det B
matrices x j = det Aj where B j is the A matrix with the j th column replaced with the b vector
a1,1 · · · a1, j −1 b1 a1, j +1 · · · a1,n
..
B j = ... ..
.
..
.
..
. .
an,1 · · · an, j −1 bn an, j +1 · · · an,n
Using Yule-Walker and Cramer’s rule, the PACS can be computed using
(M)
detRx(m)
am(M) =
detRx(M)
where
r x (0) r x (1) r x (2)
Rx(M) = r x∗ (1) r x (0) r x (1)
r x∗ (2) r x∗ (1) r x (0)
r x (1)
(M) ..
and Rx(m) = Rx(M) with the j th column replaced with r x = .
r x (M)
(b) The following MATLAB code can be used to compute the PACS of the AP(3) model in Example 4.2.3
MATLAB Code:
r0=2; r1=1.6; r2=1.2; r3=1;
R=det([r0 r1 r2; r1 r0 r1; r2 r1 r0])
a1 = -det([r1 r1 r2; r2 r0 r1; r3 r1 r0])/R
a2 = -det([r0 r1 r2; r1 r2 r1; r2 r3 r0])/R
a3 = -det([r0 r1 r1; r1 r0 r2; r2 r1 r3])/R
46 Statistical and Adaptive Signal Processing - Solution Manual
4.13 To show that the spectrum of any PZ model with real coefficients has zero slope at ω = 0 and ω = π, the
first derivative of the PSD of the model is computed and found to be equal to zero at ω = 0 and ω = π. The
general expression for a PZ model in the z-domain is
!
α i z −i
H (z) = !
β i z −i
Its squared-magnitude is
! ! !
| α i z −i |2 n αm αn z
−m+n
|H (z)|2 = ! = !m
!
| β i z −i |2 k l β k βl z
−k+l
Replacing z = e− j ω gives the following general expression for the PSD of a PZ model
! !
jω 2 α m α n e− j (m−n)ω
|H (e )| = !m !n − j (k−l)ω
k l β k βl e
d|H (e j ω )|2
= ( β k β l e− j (k−l)ω )( α m α n (− j )(m − n)e− j (m−n)ω )
dω k l m n
− j (m−n)ω
−( αm αn e )( β k β l (− j )(k − l)e− j (k−l)ω )
m n k l
= α m α n β k β l (− j )((m − n) − (k − l))e− j (k−l+m−n)ω
k l m n
= −j α m α n β k β l (m − n − k + l)e− j (k−l+m−n)ω
k l m n
At ω = 0
d|H (e j ω )|2
= −j α m α n β k β l (m − n − k + l) = 0
dω k l m n
and at ω = π
d|H (e j ω )|2
= j α m α n β k β l (m − n − k + l) = 0
dω k l m n
4.14 Derive the equations for the minimum-phase region of the AP(2) model, which are
p1 < 1
p1 ( p2 − 1) > p2 − 1
p1 p2 − p1 − p2 > −1
a2 + a1 > −1
Similarly,
p1 > −1
p1 ( p2 + 1) > − p2 − 1
p1 p2 + p1 + p2 > −1
a2 − a1 > −1
Lastly, with the magnitude of both p1 and p2 less then 1, there product is also less then one, and |a2 | < 1.
(b) |k1 | < 1 and |k2 | < 1:
Given k2 = a2 , then |a2 | < 1. With
a1
k1 =
1 + a2
and direct substitution into |k1 | < 1 the equations can be derived as follows
a1
1 + a < 1
2
and
(a) Show that the spectrum of an AP(2) model with real coefficients can be obtained by the cascade connection
of two AP(1) models with real coefficients.
First, the general equation for the denominator of the spectrum of an AP(2) model with real coefficients
is computed. Starting in the z-domain
A2 (z) = (1 + p1 z −1 )(1 + p2 z −1 )
Cascading two systems multiplies their corresponding spectra. In the case of AP models, it results in the
multiplication of their two denominators.
Using the trigonometric identity cos 2α = 2 cos2 α − 1 and completing the above multiplication, results
in the Therefore being equal.
0.8 2
0.6
1
0.4
0.2 0
0
−1
−0.2
−0.4 −2
0 20 40 60 80 100 0 20 40 60 80 100
Spectrum of AP(2) (p1=06, p2=−0.9)
PACS of AP(2) (p1=0.6, p2=−0.9) 7
0.8
6
0.6
5
0.4 4
3
0.2
2
0
1
−0.2 0
0 1 2 3 4 5 0 0.2 0.4 0.6 0.8 1
Figure 4.15.1: AP(2) System
(b) Figure 4.15.1 and 4.15.2 show the impulse response, ACS, PACS, and spectrum of an AP(2) model.
Figure 4.15.1 has two real poles located at p1 = 0.6 and p2 = −0.9. Figure 4.15.2 has a double pole
located at p = 0.9.
Statistical and Adaptive Signal Processing - Solution Manual 49
250
3
200
2 150
100
1
50
0 0
0 20 40 60 80 100 0 20 40 60 80 100
0.2
80
0
60
−0.2
−0.4 40
−0.6
20
−0.8
−1 0
0 1 2 3 4 5 0 0.2 0.4 0.6 0.8 1
Figure 4.15.2: AP(2) System with double poles
4.16 Prove Equation 4.2.89 which states that the peak of the spectrum in an AP(2) system with complex conjugate
poles is
(1 + r 2 )
cos ωc = cos θ
2r
This can be solved directly from the spectrum of an AP(2) system with complex conjugate poles
d02
R(e j ω ) =
[1 − 2r cos(ωc − θ) + r 2 ][1 − 2r cos(ωc + θ) + r 2 ]
Taking the derivative of the denominator and setting it equal to zero results in
Using the following trigonometric identity sin 2α = 2 sin α cos α and simplifying finishes the proof. Figure
4.16 shows the spectrum for various values of r and θ. The vertical line is computed using Equation 4.2.89
50 Statistical and Adaptive Signal Processing - Solution Manual
50
15
40
10 30
20
5
10
0 0
0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1
r=0.5 theta=pi/4 r=0.9 theta=3pi/4
4 60
50
3
40
2 30
20
1
10
0 0
0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1
r=0.5 theta=3pi/4
4
r=0.5 theta=5pi/8
2.5
3 2
1.5
2
1
1
0.5
0 0
0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1
r=0.9 theta=7pi/8
r=0.9 theta=pi 200
10000
8000 150
6000
100
4000
50
2000
0 0
0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1
and is a contour that includes all the zeros of A(z). This equation then simplifies to
= 2Re(log[A(∞)]) = 2Re[log(1)]
A(z) = 1 + a1 z −1 + a2 z −2
Using the quadratic formula, this system has complex poles when
subplot(1,2,1);
fill([-1,1,1,-1,-1],[-1,-1,1,1,-1],[0.5,0.5,0.5]); hold on;
fill(k1,k2,[0.8,0.8,0.8]);
52 Statistical and Adaptive Signal Processing - Solution Manual
Complex poles
0.5 0.5
ρ(2)
k2
0 0
−1 −1
−1 −0.5 0 0.5 1 −1 −0.5 0 0.5 1
k1 ρ(1)
Figure 4.18: Minimum-phase and positive definiteness regions for the AP(2) model
plot([-1,1],[0,0],’w:’,[0,0],[-1,1],’w:’);
set(gca,’xtick’,[-1:0.5:1],’ytick’,[-1:0.5:1]);
xlabel(’k_1’,’fontsize’,label_fontsize);
ylabel(’k_2’,’fontsize’,label_fontsize);
axis([-1,1,-1,1]); axis(’square’);
text(-0.3,-0.5,’Real poles’);
text(-0.45,0.8,’Complex poles’);
text(-0.65,0.2,’Real and equal poles’);
title(’(a) (k_1,k_2) space’,’fontsize’,title_fontsize);
hold off;
(b) The Matlab script file to plot Figure 4.8b is given below and the plot is shown in Figure 4.18b.
% (b) Plot in Figure 4.8b
rho1 = -1:0.01:1;
rho2 = 2*rho1.*rho1-1;
subplot(1,2,2);
fill([rho1,-1],[rho2,1],[0.8,0.8,0.8]); hold on;
plot([-1,1],[0,0],’w:’,[0,0],[-1,1],’w:’);
set(gca,’xtick’,[-1:0.5:1],’ytick’,[-1:0.5:1]);
xlabel(’\rho(1)’,’fontsize’,label_fontsize);
ylabel(’\rho(2)’,’fontsize’,label_fontsize);
axis([-1,1,-1,1]); axis(’square’);
title(’(b) (\rho(1),\rho(2)) space’,’fontsize’,title_fontsize);
hold off;
4.19 Given an AR(2) process x(n) with d0 = 1, a1 = −1.6454, a2 = 0.9025, and w(n) ∼ WGN(0,1)
â = − R̂x−1r̂ x
Statistical and Adaptive Signal Processing - Solution Manual 53
Realization of x(n)
10
−5
−10
0 20 40 60 80 100
Figure 4.19a:
hat
rho (l) rho(l)
1 1
0.5 0.5
0 0
−0.5 −0.5
−1 −1
0 5 10 15 20 0 5 10 15 20
Figure 4.19b:
4.20 Find a minimum-phase model with autocorrelation ρ(0) = 1, ρ(±1) = 0.25, and ρ(l) = 0 for |l| ≥ 2. Using
Equation 4.3.13
1 l=0
ρ(l) =
d1
1+d 2
l = ±1
0 1 |l| ≥ 2
Clearly,
d1
= 0.25
1 + d12
and solving for d1 results in d1 = 0.2679. Inserting d1 into the general model equation generates a minimum-
phase model of
hat
a (l)
1
0.5
−0.5
−1
−1.5
−2
0 5 10 15 20
Figure 4.19c:
8 8
6 6
4 4
2 2
0 0
0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1
Figure 4.19d:
0 |l| > 3
Statistical and Adaptive Signal Processing - Solution Manual 55
PACS of AP(2)
1
0.5
−0.5
−1
0 1 2 3 4 5 6
Figure 4.19e:
The partial autocorrelation sequence can be computed using the Yule-Walker equations and Cramer’s
rule. Where the PACS is
|Pm(m) |
am(m) = −
|Pm |
and Pm(m) and Pm are defined below as
ρ x (0) ρ x (1) ··· ρ x (m − 1) ρ x (1)
ρ ∗ (1) ρ x (0) · ρ x (m − 2) ρ x (2)
x
Pm(m) = .. .. .. .. ..
. . . . .
ρ ∗x (m) ρ ∗x (m − 1) · · · ρ x (1) ρ x (m + 1)
ρ x (0) ρ x (1) ··· ρ x (m)
ρ ∗x (1) ρ x (0) · ρ x (m − 1)
Pm = .. .. .. ..
. . . .
ρ ∗x (m) ρ ∗x (m − 1) · · · ρ x (0)
Using the above equation, the first five coefficients of the PACS are
am(m) = [0.1140, −0.1803, −0.0402, 0.0321, 0.0113]
and Figure 4.21c shows the first 20 coefficients.
PACS of MA(2)
0.15
0.1
0.05
−0.05
−0.1
−0.15
−0.2
0 5 10 15 20
Figure 4.21c:
i. The first four coefficients of the ACS for x(n) = 0.6x(n − 1) + w(n) − 0.9w(n − 1) are
Substituting these values into the above equations for the PACS, the resulting PACS coefficients are
km = [−0.6, 0, 0]
Statistical and Adaptive Signal Processing - Solution Manual 57
ii. The first four coefficients of the ACS for x(n) = 1.4x(n − 1) − 0.6x(n − 2) + w(n) − 0.8w(n − 1)
are
Substituting these values into the above equations for the PACS, the resulting PACS coefficients are
km = [−0.8753, 0.6017, 0]
2 0.8
1 0.6
0 0.4
−1 0.2
−2 0
−3 −0.2
−4 −0.4
0 20 40 60 80 100 0 5 10 15 20
Figure 4.22c.1:
ii. Figure 4.22c.2 shows a realization of x(n) = 1.4x(n − 1) − 0.6x(n − 2) + w(n) − 0.8w(n − 1) and
ρ̂(l)
1
0.5
0
−1
0
−2
−3
−4 −0.5
0 20 40 60 80 100 0 5 10 15 20
Figure 4.22c.2:
(d) Figure 4.22d shows the estimate of kˆm . The left and right plot correspond to x(n) = 0.6x(n − 1) +
w(n) − 0.9w(n − 1) and x(n) = 1.4x(n − 1) − 0.6x(n − 2) + w(n) − 0.8w(n − 1) respectively.
PACS PACS
0.4 0.6
0.4
0.3
0.2
0.2 0
0.1 −0.2
−0.4
0
−0.6
−0.1 −0.8
0 5 10 15 20 0 5 10 15 20
Figure 4.22d:
(a) Show that the impulse response of an AZ(Q) model can be recovered from its response 3
h(n) to a periodic
train with period L if L > Q
Assume the x(n) has the general form
The impulse response to a periodic input is 3 h(n). Since the model is an AZ(Q) model, the impulse
response will be zero for each point beyond Q taps. If the period of the periodic input pulses is greater
then the order of the model, then the system response to each periodic impulse is
q
L
3
h(n) = dk h(n − k) + 0
k=0 k=q+1
Since 3 rh (l) is also periodic. The ACS is similar to convolution, with a signal being
h(n) is periodic, 3
convolved with itself. As long as the period of the periodic impulses is greater then the aliasing point
of the convolution, then the signal can be completely recovered. In order for there to be no overlap, the
period must be greater then twice the length of the filter plus one. This can be seen by substituting directly
into the above equation
∞
q
L
q
L
rh (l) =
3 ( dk h(n − k) + 0)( dk h(n − l − k) + 0)
n=−∞ k=0 k=q+1 k=0 k=q+1
and that
1 ρ(1) 0 ··· 0 0
ρ(1) 1 ρ(1) · ·· 0 0
.
0 ρ(1) 1 .. 0 0
Rm = . . .. .. .. .. (24)
.. .. . . . .
..
0 0 0 . 1 ρ(1)
0 0 0 ··· ρ(1) 1
is an m × m matrix and that the PACS (or the reflection coefficients) are computed using (4.2.23), that is,
(m)
a1 ρ(1)
a (m) 0
2
Rm . = − . (25)
.. ..
km 0
using (23).
• m = 2: Then from (24) and (25)
1 ρ(1) a1(2) ρ(1)
=−
ρ(1) 1 k2 0
or
1 −ρ(1) 2
ρ(1) 0 ρ (1)
2
d1
1+d12 d12
k2 = = = =
1 ρ(1) 1 − ρ 2 (1) 2
1 + d12 + d14
1 − 1+d d1
ρ(1) 1
2
1
1 − d12 (−d1 )2 1 − d12 (−d1 )2 1 − d12 (−d1 )2
=
= = (27)
1 − d12 1 + d12 + d14 1 − d16 1 − d12(2+1)
or
1 ρ(1) −ρ(1)
ρ(1) 1 0 3
0 ρ(1) 0 ρ (1)
3 − d1
1+d1 2 −d13
k3 = =− = =
1 ρ(1) 0 1 − 2ρ 2 (1) 2
1 + d 4
1 + d 2
1 − 2 1+d 2d1 1 1
ρ(1) 1 ρ(1)
1
0 ρ(1) 1
1 − d12 (−d1 )3 1 − d12 (−d1 )3 1 − d12 (−d1 )3
=
= = (28)
1 − d12 1 + d14 1 + d12 1 − d18 1 − d12(3+1)
where the first determinant is of (m − 1) × (m − 1) matrix Rm−1 and the second determinant is of (m − 2) ×
(m − 2) matrix Rm−2 . Hence
Also from (25) [and from (26), (27), and (28)], we have
−ρ m (1)
km = (30)
det Rm
Dividing (29) by −ρ m (1) and using (30), we have
1 1 1 1
= − , m≥3 (31)
km −ρ (1) km−1 km−2
which is a recursive relation with initial conditions
d1 ρ 2 (1) d12
k1 = −ρ(1) = − and k 2 = = (32)
1 + d12 1 − ρ 2 (1) 1 + d12 + d14
Statistical and Adaptive Signal Processing - Solution Manual 61
Since the AZ(1) model is minimum phase, |d1 | < 1 which implies that the roots of the difference equation (31)
in k1m are real. Using p(n) = k1m , n ≥ 0 with p(−1) = k12 , p(−2) = k11 , and using the unilateral z-transform
approach along with fair amount of algebra, we obtain
1 − d12 (−d1 )m
km = , m ≥ 1.
1 − d12(m+1)
The validity for a particular d1 for lower values of m is established in (26) through (28). Follow that approach
for H (z) = 1 − 0.8 z −1 .
4.26 Prove Equation (4.3.24) that describe minimum-phase region of the AZ(2) model. Equation (4.3.24) is
Using Equation (4.3.22) and direct substitution into ρ(2) + ρ(1) > −0.5 yields
d2 d1 (1 + d2 )
+ > −0.5
1 + d1 + d2
2 2
1 + d12 + d22
(d1 + d2 )2 + 2(d1 + d2 ) + 1 > 0
Clearly, in order for the above equation to hold, d1 + d2 > −1, which is the minimum-phase region described
in Equation (4.3.21).
Using Equation (4.3.22) and direct substitution into ρ(2) − ρ(1) > −0.5 yields
d2 d1 (1 + d2 )
− > −0.5
1 + d1 + d2
2 2
1 + d12 + d22
(d1 − d2 )2 + 2(d1 − d2 ) + 1 > 0
Clearly, in order for the above equation to hold, d1 − d2 > −1, which is the minimum-phase region described
in Equation (4.3.21).
(a) The upper left plot of Figure 4.27ab shows a realization of x(n) = −0.95x(n −1)+0.9025x(n −2)+w(n)
(b) Figure 4.27ab shows the ACS, PACS, and the spectrum of the model
(c) Repeating parts a and b above with an AP(2) model with poles p1,2 = 0.95e± j π /3 . Figure 4.27c has the
plots for the realization, ACS, PACS, and spectrum to the AP(2) model.
(d) The duality of the AZ(2) and AP(2) is shown in the above figures. The finite ACS for the AZ(2) model
is similar to the finite PACS of the AP(2) model. The periodic nature of the PACS for the AZ(2) also
appears in the ACS of the AP(2) model. Lastly, frequency of notch filter for the AZ(2) corresponds to the
frequency peaks of the AP(2) model.
4.28 Given the autocorrelation sequence relations in (4.4.29) and (4.4.30), that is,
(d1 − a1 ) (1 − a1 d1 )
ρ(1) = (33)
1 + d12 − 2a1 d1
ρ(2) = −a1 ρ(1) (34)
62 Statistical and Adaptive Signal Processing - Solution Manual
5 0.5
0 0
−5 −0.5
−10 −1
0 20 40 60 80 100 0 5 10 15 20
PSD of AZ(2)
PACS of AZ(2) 35
1
30
0.8
25
0.6
0.4
20
0.2 15
0 10
−0.2 5
−0.4 0
0 5 10 15 20 0 0.2 0.4 0.6 0.8 1
Figure 4.27ab: AZ(2) System
Now for the remaining conditions the general approach is the following: first substitute a1 from (36) in (33)
and solve for d1 in terms of ρ(1) and ρ(2); then use (35) to determine conditions on ρ(1) and ρ(2). Consider
(33). After simplification we obtain
5 0.5
0 0
−5 −0.5
−10 −1
0 20 40 60 80 100 0 5 10 15 20
PSD of AP(2)
PACS of AP(2) 10
1
0.5
6
4
0
−0.5 0
0 1 2 3 4 5 6 0 0.2 0.4 0.6 0.8 1
Figure 4.27c: AP(2) System
or
d12 ρ 3 (1) − ρ(1)ρ(2) + d1 2ρ 2 (1)ρ(2) − ρ 2 (1) − ρ 2 (2) + ρ 3 (1) − ρ(1)ρ(2) = 0 (38)
Similarly
:
1
−1 =
2b c − b − c + 4b c + 4b c − 4b c + b − 2b c + c − 4b
2 2 2 4 2 4 2 3 4 2 2 4 6
2 −b3 + bc
and
which are the same conditions as those in (41) and (42). Since |ρ(2)| < 1, we conclude that in (41) ρ(1) must
be greater than 0 and in (42) ρ(1) must be less than 0. Thus we conclude
% Plot
fill(rho1p,rho2p,’g’); hold on;
fill(rho1n,rho2n,’r’);
plot([-1,1],[0,0],’w:’,[0,0],[-1,1],’w:’);
set(gca,’xtick’,[-1:0.5:1],’ytick’,[-1:0.5:1]);
xlabel(’\rho(1)’,’fontsize’,label_fontsize);
ylabel(’\rho(2)’,’fontsize’,label_fontsize);
text(0.2,-0.2,’\rho(2)=\rho(1)[2\rho(1)-1]’);
text(-0.9,-0.2,’\rho(2)=\rho(1)[2\rho(1)+1]’);
text(0.2,0.6,’\rho(2)=\rho(1)’);
text(-0.55,0.6,’\rho(2)=-\rho(1)’);
axis([-1,1,-1,1]); axis(’square’);
Statistical and Adaptive Signal Processing - Solution Manual 65
ρ(2)=−ρ(1) ρ(2)=ρ(1)
0.5
ρ(2)
0
ρ(2)=ρ(1)[2ρ(1)+1] ρ(2)=ρ(1)[2ρ(1)−1]
−0.5
−1
−1 −0.5 0 0.5 1
ρ(1)
Figure 4.28: Minimum-phase and positive definite region for the PZ(1,1) model in the ρ(1) – ρ(2) plane
σ 2w 1
SFMx = = π
σ 2x 1
2π
jω 2
−π |H (e )| dω
or in other words, one over the sum of the squared-magnitude of the impulse response.
H (z) = 1 + b1 z −1 + b2 z −2
66 Statistical and Adaptive Signal Processing - Solution Manual
This is an AZ(2) system. The general equation for the impulse response to an AZ(2) system is
4.30 The WSS process x(n) is zero-mean with PSD Rx (e j ω ). The matrix Rx is an M × M correlation matrix with
eigenvalues {λi }i=1
M
. Szegö’s theorem states that
π
1
M
1
lim g(λi ) = g Rx (e j ω ) dω
M→∞ M 2π −π
i=1
;
M
Using the property of determinant of Rx , namely det (Rx ) = λi , we can write
i=1
M
ln [det (Rx )] = ln (λi ) (44)
i=1
1
Using 1
M
ln [det (Rx )] = ln [det (Rx )] M , we can rewrite (45) as
& π '
1 1 jω
lim [det (Rx )] = exp
M ln Rx (e ) dω
M→∞ 2π −π
4.31 Given the two linear random processes with system functions
1 − 0.81z −1 − 0.4z −2
H1 (z) =
(1 − z −1 )2
and
1 − 0.5z −1
H2 (z) =
(1 − z −1 )
200
20
150
100 0
50
−20
0
−50 −40
0 20 40 60 80 100 0 20 40 60 80 100
Figure 4.31b:
1−0.81z −1 −0.4z −2
i. for H1 (z) = (1−z −1 )2
The system function can be separated into
1−0.5z −1
ii. for H2 (z) = (1−z −1 )
The system function can be separated into
2
2
1
0 0
−1
−2
−2
−4 −3
0 20 40 60 80 100 0 20 40 60 80 100
Figure 4.31c:
(b) Figure 4.31b shows realization of x(n) = 2x(n − 1) − x(n − 2) + w(n) − 0.81w(n − 1) − 0.4w(n − 2)
and x(n) = x(n − 1) + w(n) − 0.5w(n − 1) respectively. Both plots display aspects of non-stationarity.
The left plot shows a random walk type system, with the mean changing with more samples. The second
plot remains zero mean, but its variance is not constant with the number of samples.
68 Statistical and Adaptive Signal Processing - Solution Manual
(c) The first and second difference for the above two systems are shown in Figure 4.31c. Clearly, these two
systems appear stationary. The second difference of x(n) = 2x(n − 1) − x(n − 2) + w(n) − 0.81w(n −
1) − 0.4w(n − 2) is
4.32 Generate and plot 100 samples for each of the following linear processes and then estimate and examine the
values of the ACS and PACS
(a) H (z) = 1
(1−z −1 )(1−0.9z −1 )
: The plots are shown in Figure 4.32a.
rhohat(l)
Realization of x(n) 1
0
−20 0.8
−40
0.6
−60
0.4
−80
0.2
−100
−120 0
0 20 40 60 80 100 0 20 40 60 80
PACS
0.4
0.2
−0.2
−0.4
−0.6
−0.8
−1
0 5 10 15 20
Figure 4.32a:
1−0.5z −1
(b) H (z) = (1−z −1 )(1−0.9z −1 )
: The plots are shown in Figure 4.32b.
4.33 Given y(n) = d0 + d1 n + d2 n 2 + x(n), where x(n) is a stationary process with know autocorrelation r x (l)
Statistical and Adaptive Signal Processing - Solution Manual 69
hat
Realization of x(n) rho (l)
150 1
0.8
100 0.6
0.4
50
0.2
0
0
−0.2
−50 −0.4
0 20 40 60 80 100 0 20 40 60 80
PACS
0.4
0.2
−0.2
−0.4
−0.6
−0.8
−1
0 5 10 15 20
Figure 4.32b:
(a) Show that the process y (2) (n) obtained by passing y(n) through the filter H (z) = (1 − z −1)2 is stationary.
Since H (z) = Y (2)(z)/Y (z), the output of the system is
Y (2)(z) = Y (z)(1 − 2z −1 + z −2 )
Substituting y(n) = d0 + d1 n + d2 n 2 + x(n) back into the above equation and simplifying
Since the output is a linear combination of a stationary system, y (2) (n) is stationary.
(b) The autocorrelation of y (2) (n) can be computed directly
c(n) = Z −1 [C(z)]
Thus
Thus
1 1
1 1
c(3) = − − a1 a2 + −2a2 + a12 a1 = − 2a1 −a2 + a12 − a1 a2
3 3 3 2
1 1
= − (3 − 1) a1 −a2 + a12 + a2 (−a1 )
3 2
1
= − ((3 − 1) a1 c(3 − 1) + (3 − 2) a2 c(3 − 2))
3
1
P=2
= − (n − k) ak c(n − k), n = 3
3 k=1
.. .
. = ..
1
P=2
c(n) = − (n − k) ak c(n − k), n > P
n k=1
Using the property of complex cepstrum of a minimum-phase system which states that if H (z) is minimum-
phase then the complex cepstrum c(n) is causal, we have from (46)
1
n−1
h(n) = (n − k) h(k)c(n − k), n > 0
n k=0
1
n−1
h(n) = h(0)c(n) + (n − k) h(k)c(n − k), n > 0
n k=1
72 Statistical and Adaptive Signal Processing - Solution Manual
h(n) 1
n−1
h(k)
c(n) = − (n − k) c(n − k), n > 0 (47)
h(0) n k=1 h(0)
1
n−1
c(n) = an − (n − k) ak c(n − k), 1 ≤ n ≤ P (49)
n k=1
Note also from (48) that for n > P, h(n) = 0 and the summation ends at P. Thus for n > P
1
P
c(n) = − (n − k) ak c(n − k), n > P (50)
n k=1
Finally, note that for H (z) = 1/ A(z), c(n) → −c(n). Thus in (49) and (50), we have
!
1 n−1
−an − (n − k) ak c(n − k), 1 ≤ n ≤ P
n k=1
c(n) =
1! P
− (n − k) ak c(n − k), n>P
n k=1
(a) Let 0 < α < 1. Since D(z) is minimum phase, we have all zeros of D(z) inside the unit circle. Now
Q
Q
Q
−k −k
D̃(z) = d̃k z = α dk z
k
= dk (z/α)−k = D (z/α)
k=0 k=0 k=0
Note that both c(k) and c̃(k) are causal sequences due to minimum-phase models.
Statistical and Adaptive Signal Processing - Solution Manual 73
(b) To obtain nonminimum-phase model, we need to create zeros that are inside as well as outside the unit
circle. If z i,min = min |z i | and z i,max = max |z i |, then we want
This gives
1 1
<α<
z i,max z i,min
(c) To obtain maximum-phase model, we need to create zeros that are outside the unit circle. If z i,min =
min |z i |, then we want
z i,min α > 1
This gives
1
α>
z i,min
4.36 Prove Equation 4.6.27, which determines the cepstral distance in the frequency and time domains.
The cepstral distance is defined, in (4.6.27), as
π
1
CD ≡ | log R1 (e j ω ) − log R2 (e j ω )|2 dω
2π −π
Using the power series expansion, the cepstral distance can be shown as
π ∞
∞
π ∞
1 − j nω − j nω 2 1
CD = | c1 (n)e − c2 (n)e | dω = | (c1 (n) − c2 (n))e− j nω |2 dω
2π −π n=−∞ n=−∞
2π −π n=−∞
π ∞
∞
1
= (c1 (n) − c2 (n))(c1∗ (m) − c2∗ (m))e− j (n−m) ω)dω
2π −π n=−∞ m=−∞
∞
∞ π
1
= (c1 (n) − c2 (n))(c1∗ (m) − c2∗ (m)) e− j (n−m) ω)dω
n=−∞ m=−∞
2π −π
∞ ∞
∞
= (c1 (n) − c2 (n))(c1∗ (m) − c2∗ (m))δ(n − m) = |c1 (n) − c2 (n)|2
n=−∞ m=−∞ n=−∞
!∞
Therefore, CD = n=−∞ (c1 (n) − c2 (n))2 , which proves (4.6.27).
Chapter 5
Nonparametric Power Spectrum Estimation
5.1 Let xc (t), −∞ < t < ∞, be a continuous-time signal with Fourier transform X c (F), −∞ < F < ∞, and let
x(n) be obtained by sampling xc (t) every T per sampling interval with its DTFT X (e j ω ).
Since the delta train is zero everywhere except the point where n = t
T
, (2) can be written as
∞ ∞
X (e j ω ) = [xc (t)][ δ(t − nT )]e− j 2π f Fs t dt
−∞ n=−∞
This is the Fourier Transform between the product of two signals. The Fourier Transform of the impulse
train is
∞
∞
F
δ(t − nT ) ←→ 2π Fs δ( f Fs − l Fs )
n=−∞ l=−∞
Bringing X c ( f Fs ) inside the summation and using the fact that convolution with a delta result in a shift
in the signal, the above equation results in
∞
X (e j ω ) = Fs X c ( f Fs − l Fs ) (3)
l=−∞
(b) Let
∞
k Fs
X̃ p (k) = X (e j 2πk/N ) = Fs X c( − l Fs ) (4)
l=−∞
N
74
Statistical and Adaptive Signal Processing - Solution Manual 75
1
N−1
2π kn
xp (n) = X̃ p (k)e j N (5)
N k=0
5.2 MATLAB has two built in functions bartlett and triang. They each generate trinagular windows with
slightly different coefficients.
(a) Figure 5.2a shows plots of both the Bartlett Window and the Triangular Window for N = 11, 31, 51.
Bartlett Window Triangular Window
1 1
N=11 N=11
0.5 0.5
0 0
−5 0 5 −5 0 5
1 1
N=31 N=31
0.5 0.5
0 0
−15 −10 −5 0 5 10 15 −15 −10 −5 0 5 10 15
1 1
N=51 N=51
0.5 0.5
0 0
−30 −20 −10 0 10 20 30 −30 −20 −10 0 10 20 30
(b) Figure 5.2b show the magnitude plots for the windows given in Figure 5.2a. The mainlobe of the Triangular
windows are smaller then the mainlobes of the corresponding Bartlett Windows. For each N value, the
higher order lobes are spaced evenly apart for both the Bartlett and Triangular Windows.
(c) A Bartlett Window with N = 100 has approximately the same mainlobe width as a rectangular window
with N = 51. This can be seen in Figure 5.2c. This stands to reason, since a Bartlett Window is triangular
in shape, and two rectangular windows convolved together results in a triangular window. Convolution in
the time domain is multiplication in the frequency domain, which means that the spectrum of a triangular
window is equivalent to the squared spectrum of an appropriate sized rectangular window. Lastly, when
two signals of length N are convolved, the resulting output has a length of 2N −1. Therefore, a rectangular
window of length N and a triangular window of length 2N − 1 will have the smae size mainlobe width.
5.3 This problem deals with the maximum sidelobe heights of the rectangular, Hanning, Hamming, Kaiser and
Dolph-Chebyshev windows. The maximum sidelobe height is an indicator of how much spectral leakage a
certain window will contribute.
76 Statistical and Adaptive Signal Processing - Solution Manual
10
Spectrum of Bartlett Window 10
Spectrum of Triangular Window
10 10
N=11 N=11
0 0
10 10
−10 −10
10 10
0 0.1 0.2 0.3 0.4 0.5 0 0.1 0.2 0.3 0.4 0.5
10 5
10 10
N=31 N=31
0 0
10 10
−10 −5
10 10
0 0.1 0.2 0.3 0.4 0.5 0 0.1 0.2 0.3 0.4 0.5
5 10
10 10
N=51 N=51
0 0
10 10
−5 −10
10 10
0 0.1 0.2 0.3 0.4 0.5 0 0.1 0.2 0.3 0.4 0.5
2
Rectangular vs. Bartlett
10
Rectangular Spectrum (N=51)
1
10
0
10
−1
10
0 0.02 0.04 0.06 0.08 0.1
2
10
Bartlett Spectrum (N=100)
0
10
−2
10
0 0.02 0.04 0.06 0.08 0.1
(a) Figure 5.3a shows magnitude spectrum plots of the rectangular, Hamming and Hanning windows for
N = 11, 31, 51. Clearly the sidelobe height is independent of the window size.
(b) The maximum sidelobe height of the Kaiser window is controlled by β the shape parameter. Figure
5.3b shows three plots for three different β values. Each plot has the magnitude spectrum of the Kaiser
window for N = 11, 31, 51 shown. It is seen that the window length N does not effect the height of the
sidelobe, however, the shape parameter β does.
(c) A Kaiser window can be computed that has the same sidelobe height as the Hamming. Since the sidelobe
height of the Hamming window is fixed, and from Figure 5.3a the maximum sidelobe height for a
Hamming window is approximately −42.5d B. The Kaiser window of β = 5.8 and length N = 51 has a
maximum sidelobe height of approximately −42.5d B. This is seen in Figure 5.3c.
(d) The Dolph-Chebyshev has the same height A in decibels for all of the sidelobes. Figure 5.3d shows the
−3 dB point for three Dolph-Chebyshev windows for sidelobe height A = 40, 50, 60 dB.
−42.5
−3
Figure 5.3c: Kaiser and Hamming Windows Figure 5.3d: Dolph-Chebyshev Windows
Statistical and Adaptive Signal Processing - Solution Manual 77
0 0.05 0.1 0.15 0.2 0.25 0 0.1 0.2 0.3 0.4 0.5
0 0
−13 N=31 N=31
−43
0 0.05 0.1 0.15 0.2 0.25 0 0.1 0.2 0.3 0.4 0.5
0 0
−13 N=51 N=51
−43
0 0.05 0.1 0.15 0.2 0.25 0 0.1 0.2 0.3 0.4 0.5
Hanning Window
0
−32 N=11
Kaiser Window (β = 0)
Kaiser Window (β = 5)
0 N=11 0
N=31 N=11
N=51 N=31
N=51
−13
−37.5
0 0.05 0.1 0.15 0.2 0.25 0 0.05 0.1 0.15 0.2 0.25
Kaiser Window (β = 10)
0
N=11
N=31
N=51
−74
and w(n) is either a rectangular, Hamming, or Blackman window, the goal is to determine the smallest window
length that will allow the two frequencies to be separable in the |X (e j ω )|2 plots.
(a) Figure 5.4a shows the plot of y(n) as well as its true spectrum on the left hand side. The right hand side
show six different rectangular windowed spectra. The top row in Figure 5.4a corresponds to a φ = 0
and the bottom row corresponds to φ = 0.8π . It is seen that a minimum rectangular window of length
N = 27 is required to differentiate between the two frequencies for φ = 0 and N = 55 is required to
separate the frequencies for φ = 0.8π .
Rectangular Window
y(n)=cos(0.25π n) + cos(0.3π n)
2 N=119 N=51
0.2 0.2
1
0.1 0.1
0
0 0
0 0.2 0.4 0 0.2 0.4
−1
N=31 N=27
−2 0.2 0.2
0 20 40 60 80 100 120
Spectrum of y(n) 0.1 0.1
4000
0 0
0 0.2 0.4 0 0.2 0.4
3000
N=26 N=25
2000 0.2 0.2
1000 0.1 0.1
0 0 0
0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0 0.2 0.4
Rectangular Window
y(n)=cos(0.25π n) + cos(0.3π n + 0.8π n) 0.5 0.5
2 N=119 N=71
0
0 0
0 0.2 0.4 0 0.2 0.4
−1 0.5 0.5
N=59 N=57
−2
0 20 40 60 80 100 120
Spectrum of y(n)
4000
0 0
0 0.2 0.4 0 0.2 0.4
3000
0.5 0.5
N=55 N=53
2000
1000
0 0 0
0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0 0.2 0.4
(b) Part (a) above is repeated for the φ = 0.8π signal, and Figure 5.4bc shows the window spectra for the
Hamming and Blackman windows. For Figure 5.4bc it is seen that the Hamming window requires an
approxmate minimum length N = 65 and the Blackman window length N = 69 is required.
5.5 The goal of this problem is to prove that the autocorrelation matrix R̂x is a nonnegative definite matrix, that is,
zH R̂x z ≥ 0 ∀ z = 0
(a) Show that R̂x can be decomposed into the product XH X, where X is called a data matrix.
Statistical and Adaptive Signal Processing - Solution Manual 79
0 0 0 0
0 0.2 0.4 0 0.2 0.4 0 0.2 0.4 0 0.2 0.4
500 500 500 500
N=69 N=67 N=73 N=71
0 0 0 0
0 0.2 0.4 0 0.2 0.4 0 0.2 0.4 0 0.2 0.4
500 500 500 500
N=65 N=63 N=69 N=67
0 0 0 0
0 0.2 0.4 0 0.2 0.4 0 0.2 0.4 0 0.2 0.4
then XH X is
1
N−1
1
X X(k, l) =
H
x(n − k)x ∗ (n − l) = r̂ x (k − l)
N n=0 N
(a) Show that the mean of ř x (l) is equal to r x (l) and determine an approximate expression for the variance
of ř x (l).
The mean can be shown in a straight forward manner as
1
N−l−1
1
N−l−1
∗
E ř x (l) = E x(n + l)x (n) = E x(n + l)x ∗ (n)
N − l n=0 N − l n=0
1
N−l−1
= r x (l) = r x (l)
N − l n=0
The variance of ř x (l) is var ř x (l) = E{ř x (l)ř x∗ (l)} − |r x (l)|2 . Consider
1
N−l−1
1
N−l−1
∗ ∗ ∗
E ř x (l)ř x (l) = E x(n + l)x (n) x (m + l)x(m)
N − l n=0 N − l m=0
1 N−l−1
N−l−1
= E x(n + l)x ∗ (n)x ∗ (m + l)x(m)
(N − l) n=0 m=0
2
Thus
1 N−l−1
N−l−1
var ř x (l) = E x(n + l)x ∗ (n)x ∗ (m + l)x(m) − |r x (l)|2
(N − l) n=0 m=0
2
N−1
= r x (l)e− j ωl
l=−N+1
Statistical and Adaptive Signal Processing - Solution Manual 81
5.7 Let ř x (l) be the unbiased autocorrelation estimator (5.2.13) of a zero-mean white Gaussian process with variance
σ 2x . For simplicity, we will assume a real-valued Gaussian process.
(a) The variance of ř x (l) is var ř x (l) = E ř x (l)ř x∗ (l) − r x2 (l) which from Problem 5.6 is
1 N−l−1
N−l−1
var ř x (l) = E [x(n + l)x(n)x(m + l)x(m)] − r x2 (l) (1)
(N − l) m=0 n=0
2
1 N−l−1
N−l−1
var ř x (l) = r x2 (m − n) + r x (m − n − l)r x (m − n + l)
(N − l) m=0 n=0
2
Assuming stationarity, we can reduce the double summation to one, that is,
1 N−l−1
N−l−1
var ř x (l) = r x2 (m − n) + r x (m − n − l)r x (m − n + l)
(N − l) m=0 n=0
2
1
N−l
|k| 2
= 1− r x (k) + r x (k − l)r x (k + l)
N − l k=−(N−l) N −l
|k|
Now for large values of l and N , 1 − N−l
→ 1 for small enough values of k. Hence
∞
1 2
var ř x (l) & r x (k) + r x (k − l)r x (k + l)
N − l k=−∞
5.8 To be completed.
5.9 The periodogram R̂x (e j ω ) can also be expressed as a DTFT of the autocorreltaion estimate r̂ x (l) given in (5.2.1).
(a) Let v(n) = x(n)wR (n), where wR (n) is a rectangular window of length N . Show that
1
r̂ x (l) = v(l) ∗ v ∗ (−l)
N
This can be shown directly as follows
∞
1 1
N−l−1
r̂ x (l) = x(n + l)x ∗ (n) = x(n + l)wR (n + l)x ∗ (n)w ∗R (n)
N n=0 N n=−∞
∞
1
= v(n + l)v ∗ (n)
N n=−∞
which is the convolution summation between v(l) and v ∗ (−l). Therefore, r̂ x (l) = 1
N
v(l) ∗ v ∗ (−l).
(b) Show that
N−1
R̂x (e j ω ) = r̂ x (l)e− j ωl
l=−N+1
N−1
R̂x (e j ω ) = r̂ x (l)e− j ωl
l=−N+1
5.10 Consider the following simple windows over 0 ≤ n ≤ N − 1: rectangular, Bartlett, Hanning, and Hamming.
Inserting this directly into the equation for the DTFT gives the following
∞
N−1
jω − j ωn 1 − e− j ωN
WR (e ) = wR (n)e = e− j ωn =
n=−∞ n=0
1 − e− j ω
ω sin(ωN/2)
WR (e j ω ) = e− j 2 (N−1)
sin(ω/2)
ii. Bartlett:
Statistical and Adaptive Signal Processing - Solution Manual 83
N−1 j 2πn − j 2πn
− 14 (e N−1 − e N−1 )e− j ωn
n=0
N−1
− j (ω−
2π
)n
N−1
− j (ω+
2π
n)
− 14 e N−1 + 1
4
e N−1
n=0 n=0
1 − exp − j (ω ± 2π
)N
± 14 N−1
1 − exp − j (ω ± N−1
2π
)
Combining all of the above pieces, the spectrum for the Hanning window WHn (e j ω ) is
sin( (ω − )N )
ω 1 2π
WHn (e j ω ) = 1 − j 2 (N
e − 1) sin(ωN/2) − 1 e− j 21 (ω − 2π
N−1
)(N − 1) 2 N−1
sin( (ω − N − 1)
4 sin(ω/2) 4 1 2π
2 )
It is easily seen that the only difference between the Hamming and Hanning windows are the multi-
plicative constants. The spectrum for the Hamming window is the same as for the Hanning window
84 Statistical and Adaptive Signal Processing - Solution Manual
except for the change in the constant values. Therefore, the spectrum for the Hamming window
W H m (e j ω ) is
− 1) sin( 2 (ω − N−1 )N )
ω 1 2π
− j (ω − )(N
WHm (e j ω ) = (0.27)e− j 2 (N − 1) sin(ωN/2)
1 2π
− (0.23)e 2 N−1
sin( (ω − ))
sin(ω/2) 1 2π
2 N−1
− 1) sin( 2 (ω + N−1 )N )
1 2π
−j
1
(ω + 2π
)(N
+(0.23)e 2 N−1
sin( (ω + ))
1 2π
2 N−1
(b) Figure 5.10bc shows the DTFT plots calculated by Matlab for the rectangular, Bartlett, Hanning and
Hamming windows of length N = 31. On the same plots for each window are the DTFT plots determined
analytically above.
0
−13 Rectangular Window (N=31)
−50
0 0.05 0.1 0.15 0.2 0.25
0
−27 Bartlett Window (N=31)
−80
0 0.05 0.1 0.15 0.2 0.25
0
Hanning Window (N=31)
−32
−80
0 0.05 0.1 0.15 0.2 0.25
0
Hamming Window (N=31)
−43
−80
0 0.05 0.1 0.15 0.2 0.25
−20
0
0 5 10 15 20 0 0.15 0.25 0.5
1
0
L=10 −3 L=10
0.5 −10
−20
0
0 5 10 15 20 0 0.08 0.25 0.5
1
0
L=20 −3 L=20
0.5 −10
−20
0
0 5 10 15 20 0 0.04 0.25 0.5
20
15
10
0
0 50 100 150
(a) Figure 5.12a shows the plot of E ω as a function of L for the rectangular, Bartlett, Hanning, Hamming,
and Parzen windows.
(b) From Figure 5.12a, the slope of E ω for each window for L ' 1 can be computed. The slopes for each
window approach the values in the following table:
Window Name Variance Reduction Ratio
Rectangular 2L/N
Bartlett 0.667L/N
Hanning 0.75L/N
Hamming 0.7948L/N
Parzen 0.539L/N
function rx = autocfft(x,L);
% Autocorrelation sequence computation using FFT
% rx = autocfft(x,L)
% Inputs:
86 Statistical and Adaptive Signal Processing - Solution Manual
N = length(x); x = x - mean(x);
if L > (N-1); error(’*** L must be <= N-1 ***’); end;
x = reshape(x,N,1); x = [x; zeros(N,1)];
Nfft = 2^ceil(log10(2*N-1)/log10(2));
Rx = (1/N)*(abs(fft(x,Nfft)).^2);
rx = ifft(Rx);
%rx = [flipud(rx(end:-1:end-L+1));rx(1:1:L+1)];
rx = rx(1:1:L);
if isreal(x); rx = real(rx); end;
For comparison between and autocfft.m execution time consider the following Matlab script.
Clearly the autocfft.m function is more efficient for larger values of lag l.
Let x(n) be real valued. Then two real-valued sequences can be combined into one complex-valued sequence
K
gr (n) = x2r (n) + j x2r+1 (n) n = 0, 1, ..., L − 1, r = 0, 1, ..., −1
2
Statistical and Adaptive Signal Processing - Solution Manual 87
Working out this multiplication directly results in the following cross terms
∗ ∗
r.h.s. = | X̃ 2r (k)|2 + | X̃ 2r+1 (k)|2 − j X̃ 2r (k) X̃ 2r+1 (k) + j X̃ 2r+1 (k) X̃ 2r (k)
+| X̃ 2r (L − k)|2 + | X̃ 2r+1 (L − k)|2
∗ ∗
− j X̃ 2r (L − k) X̃ 2r+1 (L − k) + j X̃ 2r+1 (L − k) X̃ 2r (L − k)
∗
This can be simplified using the fact that for real-valued x2r , X̃ 2r (L − k) = X̃ 2r (k). Most of the cross
terms cancel, leaving
This can be further simplified since for real-valued x2r the following is true
∗ ∗
| X̃ 2r (L − k)|2 = ( X̃ 2r (L − k))( X̃ 2r (L − k)) = ( X̃ 2r (k))( X̃ 2r (k)) = | X̃ 2r (k)|2
(b) The expression for R̂x( P A) (k) in terms of G̃(k) is shown below
K −1
K
−1
1 1 2
R̂x( P A) (k) = |X i (k)| =
2
(| X̃ 2i (k)|2 + | X̃ 2i+1 (k)|2 )
K L i=0 K L i=0
K
−1
1 2
= (|G̃ r (k)|2 + |G̃ r (L − k)|2 )
K L i=0
˜ (PA)
The IDFT of R̂ x (k) is
FFT −1
N FFT −1
N
(PA) 1 ˜ (PA) 1
r̂˜ x (l) = R̂ x (k)e j 2πkl/NFFT = R̂x(PA) (e j 2πk/NFFT )e j 2πkl/NFFT
NFFT k=0
N FFT k=0
2π $ N −1
1 % FFT
2π k
= R̂x(PA) (e j ω )e j ωl δ ω− dω
NFFT 0 k=0
NFFT
This is the convolution between r̂ x(PA) (l) and an impulse train. Using the identity that convolution with an
(PA)
impulse train results in aliased version of the signal, therefore r̂˜ (l) is x
FFT −1
N
(PA)
r̂˜ x (l) = r̂ x(PA) (l − k NFFT )
k=0
(b) Since R̂x(PA) (e j ω ) is obtained by averaging periodograms, each of which, according to (5.3.6), is a DTFT
(PA)
of length (2L − 1) autocorrelation estimates r̂ x,i (l). Clearly then R̂x(PA) (e j ω ) is also a DTFT of length
(2L − 1) autocorrelation estimates r̂ x(PA) (l). Hence to avoid aliasing, NFFT ≥ (2L − 1).
|Rx y (e j ω )|2
Gx2y =
Rx (e j ω )R y (e j ω )
Show that it is invariant under linear transformation x1 = h 1 (n) ∗ x(n) and y1 = h 2 (n) ∗ y(n).
Start with the definition of the coherence function
|Rx1 y2 (e j ω )|2
Gx21 y1 =
Rx1 (e j ω )R y2 (e j ω )
Substitute into the above equation the following appropriate filtered autocorrelation relations
Therefore
|Rx1 y2 (e j ω )|2 [H1∗ (e j ω )H2 (e j ω )Rx y (e j ω )][H1 (e j ω )H2∗ (e j ω )Rx∗y (e j ω )]
Gx21 y1 = =
Rx1 (e j ω )R y2 (e j ω ) H1 (e j ω )H1∗ (e j ω )Rx (e j ω )H2 (e j ω )H2∗ (e j ω )R y (e j ω )
|Rx y (e j ω )|2
=
Rx (e j ω )R y (e j ω )
Statistical and Adaptive Signal Processing - Solution Manual 89
Consider L = 1: Then
1 H jω
u (e )R̂x,i u(e j ω ) = [1] r̂ x,i (0) [1] = (0) r̂ x,i (−1)e j ω + (1) r̂ x,i (0) + (0) r̂ x,i (1)e− j ω
1
1 1
− j ωl 1 − |l|
= r̂ x,i (l) (1 − |l|) e = r̂ x,i (l) e− j ωl
l=−1 l=−1
1
1
= r̂ x,i (l) wB (l) e− j ωl
l=−1
Consider L = 2:
1 H jω 1 r̂ x,i (0) r̂ x,i (−1) 1
u (e )R̂x,i u(e j ω ) = 1 e− j ω
2 2 r̂ x,i (1) r̂ x,i (0) e jω
1
= r̂ x,i (0) + e− j ωr̂ x,i (1) + r̂ x,i (−1) + e− j ωr̂ x,i (0) e j ω
2
1
= (0) r̂ x,i (−2)e2 j ω + (1) r̂ x,i (−1)e j ω + (2) r̂ x,i (0)
2
+ (1) r̂ x,i (1)e− j ω + (0) r̂ x,i (2)e−3 j ω
2 2
2 − |l| − j ωl
= r̂ x,i (l) e = r̂ x,i (l) wB (l) e− j ωl
l=−2
2 l=−2
Consider L = 3:
r̂ x,i (0) r̂ x,i (−1) r̂ x,i (−2) 1
1 H jω 1
u (e )R̂x,i u(e j ω ) = 1 e− j ω e− j 2ω r̂ x,i (1) r̂ x,i (0) r̂ x,i (−1) e j ω
3 3
r̂ x,i (2) r̂ x,i (1) r̂ x,i (0) e j 2ω
1
= r̂ x,i (0) + e− j ω r̂ x,i (1) + e−2 j ωr̂ x,i (2) + r̂ x,i (−1) + r̂ x,i (0)e− j ω + r̂ x,i (1)e− j 2ω e
3
+ r̂ x,i (−2) + e− j ωr̂ x,i (−1) + e−2 j ωr̂ x,i (0) e2 j ω
1
= (0) r̂ x,i (−3)e3 j ω + r̂ x,i (−2)e2 j ω + 2r̂ x,i (−1)e j ω + 3r̂ x,i (0) + 2r̂ x,i (1)e− j ω
3
+r̂ x,i (2)e−2 j ω + (0) r̂ x,i (2)e−3 j ω
3 3
3 − |l| − j ωl
= r̂ x,i (l) e = r̂ x,i (l) wB (l) e− j ωl
l=−3
3 l=−3
90 Statistical and Adaptive Signal Processing - Solution Manual
L
L
jω − j ωl L − |l|
R̂x,i (e ) = r̂ x,i (l) wB (l) e = r̂ x,i (l) e− j ωl
l=−L l=−L
L
1
L
= r̂ x,i (l) (L − |l|) e− j ωl
L l=−L
L
L−1
L−1
(L − |l|) f (l) = f (m − n)
l=−L m=0 n=0
we have
1 1
L L−1 L−1
R̂x,i (e j ω ) = r̂ x,i (l) (L − |l|) e− j ωl = r̂ x,i (m − n)e− j ω(m−n)
L l=−L L m=0 n=0
1 H jω
= u (e )R̂x,i u(e j ω )
L
(c) Finally, using (5.3.55)
1 1 H jω
K K
R̂x(B) (e j ω ) = R̂x,i (e j ω ) = u (e )R̂x,i u(e j ω )
K i=1 K L i=1
where ~ denotes the periodic convolution and Wa (e j ω ) is the spectrum of the correlation lag window wa (l),
−L ≤ l ≤ L.
(a) Bias of R̂x(CN) (e j ω ): Note that from (5.3.57) the mean of R̂x(PA) (e j ω ) is given by
$ % 1
E R̂x(PA) (e j ω ) = R̂x(PA) (e j ω ) ~ Rw (e j ω )
L
where Rw (e j ω ) is the spectrum of the data window w(n), 0 ≤ n ≤ L − 1. Thus from (1)
$ % π $ %
(CN) j ω 1
E R̂x (e ) = E R̂x(PA) (e j θ ) Wa (e j (ω−θ ) ) dθ
2π −π
$ %
= E R̂x(PA) (e j ω ) ~ Wa (e j ω ) (2)
1 (PA) j ω
= R̂ (e ) ~ Rw (e j ω ) ~ Wa (e j ω ) (3)
L x
Thus R̂x(CN) (e j ω ) is a biased estimator.
Statistical and Adaptive Signal Processing - Solution Manual 91
(b) From (1), the Carter-Nuttall PSD estimator, R̂x(CN) (e j ω ), is obtained by performing additional windowing
on the Welch-Bartlett PSD estimator, R̂x(PA) (e j ω ). Thus the variance of R̂x(PA) (e j ω ) is further reduced while
broadening frequency peaks (or decreasing resolution). The larger the maximum lag-length L, the lesser
are these effects.
(c) Matlab function CN_psd:
function [Rx,Freq] = CN_psd(x,L,Lagwindow,Fs)
% Spectrum estimation using Carter and Nuttall approach that
% combines data and lag windows.
% Rx = CN_psd(x,L,Window,Fs)
%
% Inputs:
% x : data values
% L : maximum Lag distance
% LagWindow : Lag window function (must be previously defined)
% Fs : sampling rate
%
% Output:
% Rx : Spectral estimates over 0 -- Fs/2
% Freq : Frequency samples between 0 and Fs/2
%-----------------------------------------------------------
% Copyright 2000, by Dimitris G. Manolakis, Vinay K. Ingle,
% and Stephen M. Kogon. For use with the book
%
% "Statistical and Adaptive Signal Processing"
%
% McGraw-Hill Higher Education.
%-----------------------------------------------------------
(a) At ω = 0, we have
N−1 2 N−1 2
1 − j 0n 1
R̂(e ) =
j0
x(n)e = x(n)
N N
n=0 n=0
(b) Assume that x(n) ia a real-valued zero-mean white Gaussian process with variance σ 2x . Then r x (l) = σ 2x .
The mean of R̂(e j 0 ) is given by
2 N−1 N−1
$ % N−1
1 1
E R̂(e ) = E
j0
x(n) = E x(n) x(m)
N n=0 N n=0 m=0
N−1 N−1
1 1
N−1 N−1
1
N−1 N−1
= E x(n)x(m) = E [x(n)x(m)] = r x (n − m)
N n=0 m=0
N n=0 m=0 N n=0 m=0
1 2
N−1 N−1
= σ δ(n − m) = σ 2x
N x n=0 m=0
Consider
N−1 N−1
$ % 1
N−1
N−1
E R̂ 2 (e j 0 ) = E x(m) x(n) x( p) x(q)
N2
m=0 n=0 p=0 q=0
1
N−1
N−1
N−1
N−1
= E x(q)x( p)x(n)x(m)
N2 m=0 n=0 p=0 q=0
1
N−1 N−1 N−1 N−1
= E [x(q)x( p)x(n)x(m)]
N 2 m=0 n=0 p=0 q=0
Now using the property (3.2.53) of real-valued Gaussian random variables, that is,
we obtain
Hence
$ % σ 4x
N−1 N−1 N−1 N−1
E R̂ 2 (e j 0 ) = [δ(q − p)δ(n − m) + δ(q − n)δ( p − m) + δ(q − m)δ( p − n)]
N 2 m=0 n=0 p=0 q=0
N−1 N−1 N−1 N−1
σ 4
= 3 x2 δ(n − m) δ(q − p) = 3σ 4x
N m=0 n=0 p=0 q=0
Therefore,
$ %
var R̂(e j 0 ) = 3σ 4x − σ 4x = 2σ 4x
$ %
(c) Clearly the estimator R̂ 2 (e j 0 ) is not consistent since var R̂(e j 0 is independent of N .
5.21 Consider Bartlett’s method for estimating R̂x (e j 0 ) using L = 1. The periodogram of one sample x(n) is simply
|x(n)|2 . Thus
1 1
N−1 N−1
R̂x(B) (e j 0 ) = R̂x,n (e j 0 ) = |x(n)|2
N n=0 N n=0
Assume that x(n) is a real-valued white Gaussian process with variance σ 2x . Then r x (l) = E x 2 (n) = σ 2x .
Consider
"
#2 1 2
N−1
1 2
N−1
E R̂x(B) (e j 0 ) = E x (m) x (n)
N m=0 N n=0
1 2
N−1 N−1
= E x (n)x 2
(m)
N 2 m=0 n=0
Using the property (3.2.53) of real-valued Gaussian random variables, that is,
we obtain
E x 2 (n)x 2 (m) = E x 2 (n) E x 2 (m) + E [x(n)x(m)] E [x(n)x(m)] + E [x(n)x(m)] E [x(n)x(m)]
= σ 4x + 2σ 4x δ(n − m)
94 Statistical and Adaptive Signal Processing - Solution Manual
Hence
" #2 1 2 1 4
N−1 N−1 N−1 N−1
E R̂x(B) (e j 0 ) = 2
E x (n)x 2
(m) = 2
σ x + 2σ 4x δ(n − m)
N m=0 n=0 N m=0 n=0
1 2σ 4x
= σ 4x + 2σ 4
N = σ 4
+
N2 x x
N
Finally
$ % " #2 2σ 4x
var R̂x(B) (e j 0 ) =E R̂x(B) (e j 0 ) − σ 4x =
N
(b) Comparison with the results of Problem 5.20: The means and variances of R̂x(B) (e j 0 ) are
(a) Let v(n), 0 ≤ n ≤ L − 1 be a data window. Let the lag window w(n) de defined by
w(n) , F −1 |F {v(n)}|2 = F −1 V (e j ω )V ∗ (e j ω )
Then using the convolution property of the DTFT, the lag window is
Thus w(n) has the desired property that its DTFT is nonnegative. We also the length of the window equal
to 2L + 1.
(b) Matlab script to design a lag window with The Hanning window as the prototype is given below and the
plots of the window and its DTFT are shown in Figure P5.22.
% (b) Design of a lag window of length 31 using the
% Hanning window prototype
N = 31; L = (N+1)/2; n = 0:N-1;
v = hanning(L);
w = conv(v,v);
% DTFT of w(n);
W = fft(w,1024); magW = abs(W(1:513));
omg = [0:512]/512;
% Plots
subplot(’position’,[0.1,0.65,0.85,0.3])
stem(n,w,’g’); axis([-1,N,0,8]);
set(gca,’xtick’,[0,15,30],’ytick’,[0:2:8]);
xlabel(’sample index n’,’fontsize’,label_fontsize);
ylabel(’x(n)’,’fontsize’,label_fontsize);
title(’Lag Window’,’fontsize’,title_fontsize);
Statistical and Adaptive Signal Processing - Solution Manual 95
Lag Window
8
x(n)
4
0
0 15 30
sample index n
60
W( ejω )
40
20
0
0 0.25 0.5 0.75 1
normalized frequency ω/π
Figure 5.22: Plots of the lag window in the time and frequency domains.
subplot(’position’,[0.1,0.15,0.85,0.3])
plot(omg,magW,’m’); axis([0,1,0,80]);
set(gca,’xtick’,[0:0.25:1],’ytick’,[0:20:80]);
xlabel(’normalized frequency \omega/\pi’,’fontsize’,label_fontsize);
ylabel(’W( e^{j\omega} )’,’fontsize’,label_fontsize);
title(’Spectrum of the Lag Window’,’fontsize’,title_fontsize);
4
x(n) = Ak sin(ωk n + φ k ) + ν(n)
k=1
(a) The top two row of Figure 5.23ab shows the Blackman-Tukey estimate using a Bartlett window for
L = 32, 64, 128 in dB. The left sided plots are the Blackman-Tukey estimates for each realization, while
the right sided plots are the average of the Blackman-Tukey estimates.
(b) The bottom row of Figure 5.23ab shows the Blackman-Tukey estimate using a Parzen window for L =
32, 64, 128 in dB. The left sided plots are the B-T estimates for each realization, while the right sided
plots are the average of the B-T estimates.
(c) It can be seen in Figure 5.23ab that neither window does a good job of estimating the true spectrum with a
window length less then L = 128. At this length, all four frequency components are visable. For lengths
less then L = 128, the Parzen window is more tightly bound around the true spectrum, with the Bartlett
window estimate having a larger envelope. This stand to reason, the Bartlett window used for part (a) has
higher sidelobes then the Parzen window used in part (b). The higher the sidelobe the greater the spectral
leakage from the true spectra.
96 Statistical and Adaptive Signal Processing - Solution Manual
B−T estimates w/ Bartlett Window (overlay) B−T estimates w/ Bartlett Window (average)
20 N=32 20 N=32
0 0
−20 −20
−40 −40
0 0.1 0.2 0.3 0.4 0.5 0 0.1 0.2 0.3 0.4 0.5
20 N=64 20 N=64
0 0
−20 −20
−40 −40
0 0.1 0.2 0.3 0.4 0.5 0 0.1 0.2 0.3 0.4 0.5
20 N=128 20 N=128
0 0
−20 −20
−40 −40
0 0.1 0.2 0.3 0.4 0.5 0 0.1 0.2 0.3 0.4 0.5
B−T estimates w/ Parzen Window (overlay) B−T estimates w/ Parzen Window (average)
20 N=32 20 N=32
0 0
−20 −20
−40 −40
0 0.1 0.2 0.3 0.4 0.5 0 0.1 0.2 0.3 0.4 0.5
20 N=64 20 N=64
0 0
−20 −20
−40 −40
0 0.1 0.2 0.3 0.4 0.5 0 0.1 0.2 0.3 0.4 0.5
20 N=128 20 N=128
0 0
−20 −20
−40 −40
0 0.1 0.2 0.3 0.4 0.5 0 0.1 0.2 0.3 0.4 0.5
Figure 5.23ab:
Statistical and Adaptive Signal Processing - Solution Manual 97
0 0
0 0.1 0.2 0.3 0.4 0.5 0 0.1 0.2 0.3 0.4 0.5
20 10
L=32 L=32
10 5
0 0
0 0.1 0.2 0.3 0.4 0.5 0 0.1 0.2 0.3 0.4 0.5
40 20
L=64 L=64
20 10
0 0
0 0.1 0.2 0.3 0.4 0.5 0 0.1 0.2 0.3 0.4 0.5
Welch Estimate (overlay) Welch Estimate (average)
5 4
L=16 L=16
2
0 0
0 0.1 0.2 0.3 0.4 0.5 0 0.1 0.2 0.3 0.4 0.5
10 10
L=32 L=32
5 5
0 0
0 0.1 0.2 0.3 0.4 0.5 0 0.1 0.2 0.3 0.4 0.5
20 20
L=64 L=64
10 10
0 0
0 0.1 0.2 0.3 0.4 0.5 0 0.1 0.2 0.3 0.4 0.5
Figure 5.24ab:
(a) The top row of Figure 5.24ab shows the Bartlett estimate in dB, which uses no overlap, a rectangular
window, and L = 32, 64, 128. The left sided plots are the Bartlett estimates for each realization, while
the right sided plots are the average of the Bartlett estimates.
(b) The bottom row of Figure 5.24ab shows the Welch estimate in dB using 50% overlap, a Hamming window,
and L = 32, 64, 128. The left sided plots are the Welch estimates for each realization, while the right
sided plots are the average of the Bartlett estimates.
(c) The Bartlett estimates have better resolution but slightly higher variance.
(a) Figure 5.25a shows the multitaper spectrum estimate, using K = 3, 5, 7 Slepian tapers. The left sided
plot is the estimates for each realizations while the right sided plot is the average of the estimates.
(b) As expected the multitaper spectral estimates have wider (and almost rectangular) peak and hence less
resolution.
5.26 This problem deals with spectral estimation using three different techniques. A 1000 sample AR(1) process is
generated with a = −0.9.
(a) The top row of Figure 5.26 shows a periodogram estimate for the AR(1) process. It is not very accurate
over the entire spectrum and has a high variance.
(b) The bottom left side plot of Figure 5.26 shows a Blackman-Tukey estimate for L = 10, 20, 50, 100.
Clearly, as L increases the estimated spectrum more closely matches the true spectrum.
(c) The bottom right side plot of Figure 5.26 shows a Welch estimate,with 50% overlap, using a Hamming
window, for L = 10, 20, 50, 100. Clearly, as L increases the estimated spectrum more closely matches
the true spectrum. This appears to be the best estimator of the three.
98 Statistical and Adaptive Signal Processing - Solution Manual
0 0
0 0.1 0.2 0.3 0.4 0.5 0 0.1 0.2 0.3 0.4 0.5
20 10
K=5 K=5
10 5
0 0
0 0.1 0.2 0.3 0.4 0.5 0 0.1 0.2 0.3 0.4 0.5
10 10
K=7 K=7
5 5
0 0
0 0.1 0.2 0.3 0.4 0.5 0 0.1 0.2 0.3 0.4 0.5
Figure 5.25a:
20
15
10
−5
−10
−15
0 0.1 0.2 0.3 0.4 0.5
B−T estimate vs. True Spectrum (a=−0.9) Welch estimate vs. True Spectrum (a=−0.9)
20 20
L= 10 L= 10
10 10
0 0
−10 −10
0 0.1 0.2 0.3 0.4 0.5 0 0.1 0.2 0.3 0.4 0.5
20 20
L= 20 L= 20
10 10
0 0
−10 −10
0 0.1 0.2 0.3 0.4 0.5 0 0.1 0.2 0.3 0.4 0.5
20 20
L= 50 L= 50
10 10
0 0
−10 −10
0 0.1 0.2 0.3 0.4 0.5 0 0.1 0.2 0.3 0.4 0.5
20 20
L= 100 L= 100
10 10
0 0
−10 −10
0 0.1 0.2 0.3 0.4 0.5 0 0.1 0.2 0.3 0.4 0.5
Figure 5.26:
Statistical and Adaptive Signal Processing - Solution Manual 99
5.27 This problem deals with spectral estimation using three different techniques. A 1000 sample AR(1) process is
generated with a = 0.9.
(a) The top row of Figure 5.27 shows a periodogram estimate for the AR(1) process. It is not very accurate
over the entire spectrum and has a high variance.
(b) The bottom left side plot of Figure 5.27 shows a Blackman-Tukey estimate for L = 10, 20, 50, 100.
Clearly, as L increases the estimated spectrum more closely matches the true spectrum.
(c) The bottom right side plot of Figure 5.27 shows a Welch estimate, with 50% overlap, using a Hamming
window, for L = 10, 20, 50, 100. Clearly, as L increases the estimated spectrum more closely matches
the true spectrum. This appears to be the best estimator of the three.
15
10
−5
−10
−15
0 0.1 0.2 0.3 0.4 0.5
B−T estimate vs. True Spectrum (a=0.9) Welch estimate vs. True Spectrum (a=0.9)
20 20
L= 10 L= 10
10 10
0 0
−10 −10
0 0.1 0.2 0.3 0.4 0.5 0 0.1 0.2 0.3 0.4 0.5
20 20
L= 20 L= 20
10 10
0 0
−10 −10
0 0.1 0.2 0.3 0.4 0.5 0 0.1 0.2 0.3 0.4 0.5
20 20
L= 50 L= 50
10 10
0 0
−10 −10
0 0.1 0.2 0.3 0.4 0.5 0 0.1 0.2 0.3 0.4 0.5
20 20
L= 100 L= 100
10 10
0 0
−10 −10
0 0.1 0.2 0.3 0.4 0.5 0 0.1 0.2 0.3 0.4 0.5
Figure 5.27:
5.28 Multitaper estimation technique requires a properly designed orthonormal set of tapers for proper performance.
One set discussed in the chapter is that of harmonically related sinusoids given by
2 π (k + 1)(n + 1)
ωk (n) = sin n = 0, 1, ..., N − 1
N −1 N +1
(a) Listed below is a MATLAB functions that will generate K < N sinusoidal tapers of length N .
function w = sine_tapers(N, K)
−10
−20
−30
−40
0 0.05 0.1 0.15
Figure 5.28b:
(b) Figure 5.28b plots the first five tapers of length 51.
5.29 The following MATLAB function determines the multitaper estimate using the sine tapers generated above
N = length(x); w = sine_tapers(N,K);
for k = 1:K
x_w(k,:) = x.*w(1,:);
S_x(:,k) = psd(x_w(k,:),N , 1, ones(N/10,1),0);
end
Pxx = mean(S_x’);
(a) The left side of Figure 5.29 shows the estimate of the AR(1) process given in Problem 5.26
(b) The right side of Figure 5.29 shows the estimate of the AR(1) process given in Problem 5.27
Sine Taper estimate vs. True Spectrum (a=0.9) Sine Taper estimate vs. True Spectrum (a=−0.9)
20 20
10 10
0 0
−10 −10
−20 −20
−30 −30
−40 −40
−50 −50
−60 −60
−70 −70
−80 −80
0 0.1 0.2 0.3 0.4 0.5 0 0.1 0.2 0.3 0.4 0.5
Figure 5.29:
Chapter 6
Optimum Linear Filters
6.1 Show that the linear MMSE estimate ŷ of a random variable y using the data vector x is given by ŷ = yo + c H x,
where yo = E{y} − c H E{x} , c = R−1 d , R = E{xx H } , and d = E{xy ∗ }.
Let
ε 2 = | ŷ − y|2 = ŷ ŷ ∗ − ŷ y ∗ − y ŷ ∗ − yy ∗
ŷ = yo + c H x
Substituting the expression for ŷ into the above expression for ε2 , computing its expected value and taking the
derivative with respect to yo results in
d Eε 2
= 2yo + 2µ xH c − 2µ y
dyo
6.2 Consider an optimum FIR filter specified by the input correlation matrix R = Toeplitz {1, 14 } and cross-
correlation vector d = [1 12 ]T .
(b) Express co and the MMSE Po in terms of the eigenvalues and eigenvectors of R
The eigenvalues and eigenvectors of R are
0.7071 0.7071 0.75 0 0.7071 −0.7071
R = QQ H =
−0.7071 0.7071 0 1.25 0.7071 0.7071
Using (6.2.35) and (6.2.32), co and Po are found using the eigenvalues and eigenvectors as is shown below
2
qHd
co = QQ d = H i
qi
i=1
λi
0.7071 1 1 0.7071
= 1
[0.7071
− 0.7071] 1 + 1
[0.7071 0.7071]
0.75 −0.7071 1.25 1
0.7071
2 2
0.333 0.6 0.933
= + =
−0.333 0.6 0.267
101
102 Statistical and Adaptive Signal Processing - Solution Manual
2
|d ! |2 (0.3536)2 (1.0607)2
Po = Py − i
= Py − − = Py − 1.067
i=1
λ 0.75 1.25
6.3 Repeat Problem 6.2 for a third-order optimum FIR filter, with R = Toeplitz {1, 14 , 0} and cross-correlation
vector d = [1 12 0]T .
(a) Solving the same way as Problem 6.2, using (6.2.12) and (6.2.17) results in
0.9286
co = R −1 d = 0.2857
−0.0714
and
Po = Py − d H co = Py − 1.071
and
1.3536 0 0
= 0 1 0
0 0 0.6464
and
(0.8536)2 (0.7071)2 (0.1464)2
Po = Py − − − = Py − 1.071
1.3536 1 0.6464
6.4 A process y(n) with the autocorrelation r y (l) = a |l| , −1 < a < 1, is corrupted by additive, uncorrelated
white noise ν(n) with variance σ 2ν . To reduce the noise in the observed process x(n) = y(n) + ν(n), we use a
first-order Wiener filter.
(a) Express the coefficients co,1 and co,2 and the MMSE Po in terms of the parameters a and σ 2ν
The autocorrelation matrix for x(n) is
1 + σ 2ν a
Rx = E{x(n)x (n)} = R y + σ ν I =
H 2
a 1 + σ 2ν
Statistical and Adaptive Signal Processing - Solution Manual 103
The MMSE Po is found using Po = Py − d H co where Py = E|y|2 = 1. After simplifying, the MMSE
Po is
2 2 1+σ ν −a
Po = 1 − [1 a] ((1+σ 2ν )2 −a 2 )
σ 2ν a
= σ 2ν (1 + a 2 + σ 2ν )
((1+σ 2ν )2 −a 2 )
(b) Compute and plot the PSD of x(n) and the magnitude response |Co (e j ω )| of the filter when σ 2v = 2, for
both a = 0.8 and a = −0.8, and compare the results.
% (b) Plot of the PSD of x(n) and the Mag Res of the optimal filter
Hf_1 = figure(’units’,SCRUN,’position’,SCRPOS,...
’paperunits’,PAPUN,’paperposition’,[0,0,5,3]);
set(Hf_1,’NumberTitle’,’off’,’Name’,’Pr0604b’);
% Given parameters
var_v = 2;
% 1. a = 0.8
a = 0.8;
% Computed Parameters
c_o1 = (1+var_v-a*a)/((1+var_v)*(1+var_v)+a*a);
c_o2 = (var_v*a)/((1+var_v)*(1+var_v)+a*a);
% PSD of x(n)
omg = [0:500]*pi/500;
Rx = (2-(1+a*a))./((1+a*a)-2*a*cos(omg)) + var_v;
% Magnitude plot of the optimal filter
C_o = freqz([c_o1,c_o2],1,omg);
magC_o = abs(C_o);
subplot(2,2,1);
plot(omg/pi,Rx,’g’); axis([0,1,0,12]);
%xlabel(’\omega / \pi’,’fontsize’,label_fontsize);
ylabel(’Magnitudes’,’fontsize’,label_fontsize);
set(gca,’xtick’,[0:0.2:1],’ytick’,[0:2:12]);
title(’PSD of x(n) for a = 0.8’,’fontsize’,title_fontsize);
subplot(2,2,2);
plot(omg/pi,magC_o,’g’); axis([0,1,0,0.5]);
%xlabel(’\omega / \pi’,’fontsize’,label_fontsize);
ylabel(’Magnitudes’,’fontsize’,label_fontsize);
104 Statistical and Adaptive Signal Processing - Solution Manual
10 0.4
Magnitudes
Magnitudes
8
0.3
6
0.2
4
2 0.1
0 0
0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1
10 0.4
Magnitudes
Magnitudes
8
0.3
6
0.2
4
2 0.1
0 0
0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1
ω/π ω/π
set(gca,’xtick’,[0:0.2:1],’ytick’,[0:.1:0.5]);
title(’Magnitude Response for a = 0.8’,’fontsize’,title_fontsize);
% 2. a = -0.8
a = -0.8;
% Computed Parameters
c_o1 = (1+var_v-a*a)/((1+var_v)*(1+var_v)+a*a);
c_o2 = (var_v*a)/((1+var_v)*(1+var_v)+a*a);
% PSD of x(n)
omg = [0:500]*pi/500;
Rx = (2-(1+a*a))./((1+a*a)-2*a*cos(omg)) + var_v;
% Magnitude plot of the optimal filter
C_o = freqz([c_o1,c_o2],1,omg);
magC_o = abs(C_o);
subplot(2,2,3);
plot(omg/pi,Rx,’g’); axis([0,1,0,12]);
xlabel(’\omega / \pi’,’fontsize’,label_fontsize);
ylabel(’Magnitudes’,’fontsize’,label_fontsize);
set(gca,’xtick’,[0:0.2:1],’ytick’,[0:2:12]);
title(’PSD of x(n) for a = -0.8’,’fontsize’,title_fontsize);
subplot(2,2,4);
plot(omg/pi,magC_o,’g’); axis([0,1,0,0.5]);
xlabel(’\omega / \pi’,’fontsize’,label_fontsize);
ylabel(’Magnitudes’,’fontsize’,label_fontsize);
set(gca,’xtick’,[0:0.2:1],’ytick’,[0:.1:0.5]);
title(’Magnitude Response for a = -0.8’,’fontsize’,title_fontsize);
The plot is shown in Figure 6.4b.
(c) Compute and plot the processing gain of the filter for a = −0.9, −0.8, −0.7, . . . , 0.9 as a function of a
Statistical and Adaptive Signal Processing - Solution Manual 105
Processing gain vs a
0.35
Gain(a)
0.3
0.25
−1 −0.9 −0.8 −0.7 −0.6 −0.5 −0.4 −0.3 −0.2 −0.1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
parameter a
6.5 Consider the harmonic process y(n) and its noise observation x(n) given in Example 6.4.1
From Example 6.4.1, y(n) = A cos(ωo n+φ) where φ is uniformly distributed on [0, 2π ]. The noise observation
is x(n) = y(n) + ν(n) with ν(n) ∼ N (0, σ 2ν )
(b) The following MATLAB function will compute an Mth-order optimum FIR filter impulse response h(n)
0.05
−0.05
−0.1
0 5 10 15 20
0.6
0.4
0.2
0
0 0.1 0.2 0.3 0.4 0.5
l=[0:M-1]’;
Rxx=toeplitz(rx);
h=inv(Rxx)*ry;
(c) Figure 6.5 shows the impulse response of the 20th-order optimum FIR filter for A = 0.5, f o = 0.05, and
σ 2ν = 0.5.
(d) Figure 6.5 shows the impulse and magnitude response. Note that this matches Example 6.4.1
6.6 Consider a “desired” signal s(n) generated by the process s(n) = −0.8w(n − 1) + w(n), where w(n) ∼
WN(0, σ 2w ). This signal is passed through the causal system H (z) = 1 − 0.9z −1 whose output y(n) is
corrupted by additive white noise v(n) ∼ WN(0, σ 2v ). The processes w(n) and v(n) are uncorrelated with
σ 2w = 0.3 and σ 2v = 0.1.
(a) Design a second-order optimum FIR filter that estimates s(n) from the signal x(n) = y(n) + v(n) and
determine co and Po :
% Given parameters
var_w = 0.3;
h1 = [1,-0.8]; lh1 = length(h1);
h = [ 1,-0.9];
var_v = 0.1;
% Computed Parameters
% Autocorrelation of s(n): rs(l) = var_w*h1(l)*h1(-l)
Statistical and Adaptive Signal Processing - Solution Manual 107
[co0,co1] = meshgrid([co(1)-1:0.05:co(1)+1],[co(2)-1:0.01:co(2)+1]);
P = Ps - 2*dxs(1)*co0 - 2*dxs(2)*co1 + rx(1)*co0.^2 + 2*rx(2)*co0.*co1...
+ rx(1)*co1.^2;
V = [0:0.05:1]+Po;
contour(co0,co1,P,V);
xlabel(’c_o(1)’,’fontsize’,label_fontsize);
ylabel(’c_o(2)’,’fontsize’,label_fontsize);
set(gca,’xtick’,[co(1)-1:1:co(1)+1],’ytick’,[co(2)-1:1:co(2)+1]);
title(’P6.6 : Error Performance Surface’,’fontsize’,title_fontsize);
grid;
The plot is shown in Figure 6.6.
(c) Repeat part (a) for a third-order filter, and see whether there is any improvement.
% (c) Third-order (i.e., length M = 3) optimal FIR filter design
M = 3;
% Optimal filter
Rx = toeplitz(rx(1:M),rx(1:M));
dxs = rxs(1:M)’;
108 Statistical and Adaptive Signal Processing - Solution Manual
co(2)
−0.2793
−1.2793
−0.6745 0.3255 1.3255
c (1)
o
co = Rx\dxs;
% Optimal error
Po = Ps - dxs’*co;
% Printout
Third-order (i.e., length M = 3) optimal FIR filter design
Optimal FIR filter coefficients: 0.2775, -0.3893, -0.1303
Optimal error = 0.0579
6.7 Repeat Problem 6.6, assuming that the desired signal is generated by s(n) = −0.8s(n − 1) + w(n).
(a) Design a second-order optimum FIR filter that estimates s(n) from the signal x(n) = y(n) + v(n) and
determine co and Po :
% Given parameters
var_w = 0.3;
n = 0:20;
h1 = (-0.8).^n; lh1 = length(h1);
h = [ 1,-0.9];
var_v = 0.1;
% Computed Parameters
% Autocorrelation of s(n): rs(l) = var_w*h1(l)*h1(-l)
rh1 = conv(h1,fliplr(h1)); lrh1 = length(rh1);
rs = var_w*rh1; rs = rs(lh1:end); Ps = rs(1);
% Signal x(n) = h(n)*h1(n)*w(n) + v(n); h2 def h1*h;
h2 = conv(h,h1); lh2 = length(h2);
% Autocorrelation of x(n): rx(l) = var_w*h2(l)*h2(-l)+var_v*delta(l)
rx = var_w*conv(h2,fliplr(h2))+var_v*[zeros(1,lh2-1),1,zeros(1,lh2-1)];
rx = rx(lh2:end);
% Crosscorrelation between x(n) and s(n): rxs(l) = vaw_w*h(l)*h1(l)*h1(-l)
lrh1c = round((lrh1-1)/2)+1;
rxs = var_w*conv(h,rh1); rxs = rxs(lrh1c:end);
Statistical and Adaptive Signal Processing - Solution Manual 109
[co0,co1] = meshgrid([co(1)-1:0.05:co(1)+1],[co(2)-1:0.01:co(2)+1]);
P = Ps - 2*dxs(1)*co0 - 2*dxs(2)*co1 + rx(1)*co0.^2 + 2*rx(2)*co0.*co1...
+ rx(1)*co1.^2;
V = [0:0.05:1]+Po;
contour(co0,co1,P,V);
xlabel(’c_o(1)’,’fontsize’,label_fontsize);
ylabel(’c_o(2)’,’fontsize’,label_fontsize);
set(gca,’xtick’,[co(1)-1:1:co(1)+1],’ytick’,[co(2)-1:1:co(2)+1]);
title(’P6.7 : Error Performance Surface’,’fontsize’,title_fontsize);
grid;
The plot is shown in Figure 6.7.
(c) Repeat part (a) for a third-order filter, and see whether there is any improvement.
% (c) Third-order (i.e., length M = 3) optimal FIR filter design
M = 3;
% Optimal filter
Rx = toeplitz(rx(1:M),rx(1:M));
dxs = rxs(1:M)’;
co = Rx\dxs;
% Optimal error
Po = Ps - dxs’*co;
% Printout
Third-order (i.e., length M = 3) optimal FIR filter design
Optimal FIR filter coefficients: 0.2769, -0.3269, -0.0723
Optimal error = 0.0552
co(2)
−0.2493
−1.2493
−0.7059 0.2941 1.2941
c (1)
o
(a) Design a second-order optimum FIR filter that estimates s(n) from the signal x(n) = y(n) + v(n) and
determine co and Po :
% Given parameters
var_w = 0.3;
h1 = [1,-0.8]; lh1 = length(h1);
h = [ 1];
var_v = 0.1;
% Computed Parameters
% Autocorrelation of s(n): rs(l) = var_w*h1(l)*h1(-l)
rh1 = conv(h1,fliplr(h1)); lrh1 = length(rh1);
rs = var_w*rh1; rs = rs(lh1:end); Ps = rs(1);
% Signal x(n) = h(n)*h1(n)*w(n) + v(n); h2 def h1*h;
h2 = conv(h,h1); lh2 = length(h2);
% Autocorrelation of x(n): rx(l) = var_w*h2(l)*h2(-l)+var_v*delta(l)
rx = var_w*conv(h2,fliplr(h2))+var_v*[zeros(1,lh2-1),1,zeros(1,lh2-1)];
rx = [rx(lh2:end),0,0];
% Crosscorrelation between x(n) and s(n): rxs(l) = vaw_w*h(l)*h1(l)*h1(-l)
lrh1c = round((lrh1-1)/2)+1;
rxs = var_w*conv(h,rh1); rxs = [rxs(lrh1c:end),0,0];
co(2)
−0.0819
−1.0819
−0.2021 0.7979 1.7979
c (1)
o
[co0,co1] = meshgrid([co(1)-1:0.05:co(1)+1],[co(2)-1:0.01:co(2)+1]);
P = Ps - 2*dxs(1)*co0 - 2*dxs(2)*co1 + rx(1)*co0.^2 + 2*rx(2)*co0.*co1...
+ rx(1)*co1.^2;
V = [0:0.05:1]+Po;
contour(co0,co1,P,V);
xlabel(’c_o(1)’,’fontsize’,label_fontsize);
ylabel(’c_o(2)’,’fontsize’,label_fontsize);
set(gca,’xtick’,[co(1)-1:1:co(1)+1],’ytick’,[co(2)-1:1:co(2)+1]);
title(’P6.8 : Error Performance Surface’,’fontsize’,title_fontsize);
grid;
The plot is shown in Figure 6.8.
(c) Repeat part (a) for a third-order filter, and see whether there is any improvement.
% (c) Third-order (i.e., length M = 3) optimal FIR filter design
M = 3;
% Optimal filter
Rx = toeplitz(rx(1:M),rx(1:M));
dxs = rxs(1:M)’;
co = Rx\dxs;
% Optimal error
112 Statistical and Adaptive Signal Processing - Solution Manual
Po = Ps - dxs’*co;
% Printout
Third-order (i.e., length M = 3) optimal FIR filter design
Optimal FIR filter coefficients: 0.7897, -0.1020, -0.0414
Optimal error = 0.0790
6.9 A stationary process x(n) is generated by the difference equation x(n) = ρx(n − 1) + w(n), where w(n) ∼
WN(0, σ 2w )
σ 2w
Rx = Toeplitz{1, ρ, ρ 2 , . . . , ρ M−1 }
1 − ρ2
Computing the correlation directly
r x (0) = E{ρ 2 x(n − 1)x ∗ (n − 1) + ρx(n − 1)w ∗ (n) + ρ ∗ x ∗ (n)w(n − 1) + w(n − 1)w ∗ (n − 1)}
= ρ 2r x (0) + σ 2w
σ 2w
r x (l) = ρl
1−ρ 2
σ 2w
Rx = Toeplitz{1, ρ, ρ 2 , . . . , ρ M−1 }
1 − ρ2
(b) Show that the Mth-order FLP is given by a1(M) = −ρ, ak(M) = 0 for k > 1 and the MMSE is PM = σ 2w .
f
The FLP, using (6.5.18), is R(n − 1)ao (n) = −r(n). Expanding this relation below
1 ρ ··· a1 ρ
σw ρ 1
2
a2 σ w ρ2
2
=−
1−ρ 2 .. .. .. 1 − ρ2 ..
. . . .
It is clearly seen, that the right-hand side of the above equation is simply the first column of the autocor-
relation matrix scaled by −ρ. Therefore a = [−ρ0 · · · 0]T , or in other words, a1(M) = −ρ, ak(M) = 0 for
k > 1.
The MMSE, using (6.5.19), is
σ 2w σ 2w ρ 2
Pof (n) = Px (n) + r f H ao(M) = − = σ 2w
1 − ρ2 1 − ρ2
Statistical and Adaptive Signal Processing - Solution Manual 113
6.10 Using Parseval’s theorem, show that (6.4.18) can be written as (6.4.21) in the frequency domain
Equation (6.4.18) is
M−1
M−1 M−1
M−1
∗ ∗
P = E{|e(n)| } = r y (0) −
2
h(k)r yx (k) − h (k)r yx (k) − h(k)r(l − k)h ∗ (l)
k=0 k=0 k=0 l=0
Applying Parseval’s relation to (6.4.18) and using the fact that h(k) is non-zero over [0, M − 1], we have
M−1 ∞
∗ 1
h(k)r yx (k) = H (e j ω )R ∗yx (e j ω )dω
0
2π −∞
M−1 ∞
1
h ∗ (k)r yx (k) = H ∗ (e j ω )R yx (e j ω )dω
0
2π −∞
and
M−1
M−1
M−1
M−1
h(k)r yx (l − k)h ∗ (k) = h(k) r yx (l − k)h ∗ (l)
k=0 l=0 k=0 l=0
M−1 ∞
1
= h(k) R yx (e j ω )e− j ωk H ∗ (e j ω )dω
k=0
2π −∞
∞ M−1
1 − j ωk
= h(k)e R yx (e j ω )H ∗ (e j ω )dω
2π −∞ k=0
∞
1
= H (e j ω )R yx (e j ω )H ∗ (e j ω )dω
2π −∞
Substituting these relations in (6.4.18), we obtain (6.4.21).
6.11 By differentiating (6.4.21) with respect to H (e j ω ), derive the frequency response function Ho (e j ω ) of the
optimum filter in terms of R yx (e j ω ) and Rx (e j ω ).
Differentiating with respect to H (e j ω ) or equivalently with respect to H ∗ (e j ω ) [see Appendix B].
∂P
=0
∂ H ∗ (e j ω )
π
∂ 1 jω ∗ jω ∗ jω jω jω ∗ jω ∗ jω
0= r y (0) − [H (e )R yx (e ) + H (e )R yx (e ) − H (e )H (e )R yx (e )]dω
∂ H ∗ (e j ω ) 2π −π
Which implies that
∂
H (e j ω )R ∗yx (e j ω ) + H ∗ (e j ω )R yx (e j ω ) − H (e j ω )H ∗ (e j ω )R ∗yx (e j ω ) = 0
∂ H ∗ (e j ω )
Using (B.13), we obtain
R yx (e j ω ) − Ho (e j ω )Rx (e j ω ) = 0
114 Statistical and Adaptive Signal Processing - Solution Manual
or
R yx (e j ω )
Ho (e j ω ) =
Rx (e j ω )
6.12 A conjugate symmetric linear smoother is obtained from (6.5.12) when M = 2L and i = L. If the process
x(n) is stationary, then, using R̄ J = J R̄ ∗ , show that c̄ = J c̄∗ .
Using (6.5.12)
0
R̄ c̄ = Po(i)
0
Multiply both sides by the exchange matrix J
0 0
J R̄ c̄ = J Po(i) = Po(i)
0 0
With the second equality due to the symmetry of the MMSE Po(i) (n). Using R̄ J = J R̄ ∗ the above equation
can be written
0
J R̄ c̄ = R ∗ J c = Po(i)
0
Resulting in J c̄ = c̄∗
¯ be the matrices from the eigen-decomposition of R̄, that is, R̄ = Q̄
6.13 Let Q̄ and ¯ Q̄ H
(a) Substitute R into (6.5.20) and (6.5.27) to prove (6.5.43) and (6.5.44).
Starting with (6.5.20), and solving directly
f
1 Po (n)
R̄(n) =
ao (n) 0
f
¯ 1 Po (n)
Q̄ Q̄ H
=
ao (n) 0
∗
f q1,1
1
M+1
1 ¯ −1 H Po (n) ¯ −1 .
.. ∗
= Q̄ Q̄ = Po (n) Q̄
f
= Po (n)
f
q̄i q̄i,1
ao (n) 0 λ̄ i
q M−1,1 i=1
6.14 Let R̃(n) be the inverse of the correlation matrix R̄(n) given in (6.5.11).
(a) Using (6.5.12), show that the diagonal elements of R̃(n) are given by
1
R̃(n)i,i = 1≤i ≤ M +1
P (i) (n)
Given
R11 (n) r1 (n) R12 (n)
R̄(n) = E{x̄(n)x̄ H (n)} = r1H (n) Px (n − 1) r2H (n)
H
R12 (n) r2 (n) R22 (n)
Since the ith element of c̄o(i) (n) = 1, comparing the ith row of the above equation, we obtain
1
R̃(n)i,i = 1≤i ≤ M +1
P (i) (n)
R̃(n)1,i
..
0 .
c̄o (n) = R̃(n) Po (n) = Po (n)
(i) (i) (i)
R̃(n)i,i = r̃i (n)
R̃(n)
0 .. i,i
.
R̃(n) M+1,i
6.15 The first five samples of the autocorrelation sequence of a signal x(n) are r(0) = 1, r(1) = 0.8, r(2) =
0.6, r(3) = 0.4, and r(4) = 0.3. Compute the FLP, the BLP, the optimum symmetric smoother, and the
corresponding MMSE.
116 Statistical and Adaptive Signal Processing - Solution Manual
BLP:Divide the last column by 2. 916 7 to obtain cob and take inverse of 2. 916 7 to obtain Pob .
b
c1 −. 416 67 −0. 892 86
cb 1 0. 729 17 0 1
2b = = , Pb = = 0. 342 85
c3 2. 916 7 0 0. 25 o
2. 916 7
c4b −2. 604 2 −0. 142 86
SLS:Divide the middle column by 5 to obtain cos and take inverse of 5 to obtain Pos .
s
c1 0 0
cs 1 −2.5 −0. 5 1
2s =
c3 5 −2.5 = −0. 5 , Po = 5 = 0. 2
b
c4s 0 0
6.16 For the symmetric, Toeplitz autocorrelation matrix R = Toeplitz{r(0), r(1), r(2)} = r(0)× Toeplitz{1, ρ 1 , ρ 2 }
with R = LDL H and D = diag{ξ 1 , ξ 2 , ξ 3 }, the following conditions are equivalent:
• R is positive definite.
• ξ i > 0 for 1 ≤ i ≤ 3.
• |ki | < 1 for 1 ≤ i ≤ 3.
Determine the values of ρ 1 and ρ 2 for which R is positive definite, and plot the corresponding area in the
(ρ 1 , ρ 2 ) plane.
6.17 Prove the first equation in (6.5.45) by rearranging the FLP normal equations in terms of the unknowns
f f
Po (n),a1 (n),. . . ,a M (n) and then solve for Po (n), using Cramer’s rule. Repeat the procedure for the sec-
ond equation
(a) Given
f
1 Po (n)
R̄(n) =
ao (n) 0
and using Cramer’s rule for the first element
D1
1=
det R̄(n)
where,
f
P0 (n) r f H (n) f
D1 = det = P0 (n) det R(n − 1)
0 R(n − 1)
Hence,
f det R̄(n)
P0 (n) =
det R(n − 1)
118 Statistical and Adaptive Signal Processing - Solution Manual
(b) Given
bo (n) 0
R̄(n) =
1 Pob (n)
Hence,
det R̄(n)
P0b (n) =
det R(n)
6.18 Consider the signal x(n) = y(n) + ν(n) where y(n) is a useful random signal corrupted by noise ν(n). The
processes y(n) and ν(n) are uncorrelated with PSDs
&
jω 1 0 ≤ |ω| ≤ π2
R y (e ) =
0 π2 < |ω| ≤ π
and
&
jω 1 π4 ≤ |ω| ≤ π2
Rν (e ) =
0 0 ≤ |ω| < π4 and π
2
< |ω| ≤ π
R yx (e j ω )
Hnc (e j ω ) =
Rx (e j ω )
Using the fact that y(n) and ν(n) are uncorrelated, the above can be re-written as
R (e jω
) 1 0 ≤ |ω| ≤ π4
Hnc (e j ω ) = 1/2 π4 < |ω| ≤ π2
y
=
R y (e j ω ) + Rν (e j ω ) π
0 2
< |ω| ≤ π
where
&
1/2 0 ≤ |ω| ≤ π2
Hnc1 (e j ω ) = π
0 2
< |ω| ≤ π
Statistical and Adaptive Signal Processing - Solution Manual 119
and
&
jω 1/2 0 ≤ |ω| ≤ π4
Hnc2 (e ) = π
0 4
< |ω| ≤ π
Taking the inverse Fourier transform on these two filters results in the optimum IIR filter
sin πn sin πn
h nc (n) = h nc1 + h nc2 = 2
+ 4
2π n 2π n
The MMSE is evaluated as
π
1 1 1
Po = [R y (e j ω ) − H (e j ω )R ∗yx (e j ω )]dω = (π ) − (π − π /4) = 1/8
2π −π 2π 2π
M−1
h o (k)r x (n − k) = r yx (n) 0 ≤n ≤ M −1
k=0
2
h o (k)r x (m − k) = r yx (m − 1) 0≤m ≤ M−1
k=0
120 Statistical and Adaptive Signal Processing - Solution Manual
Due to the real values of x(n) and y(n), the autocorrelation is symmetric and r y (l) = r y (−l). Therefore
the optimal filter equation is
−1
r x (0) r x (1) r x (2) r y (1) 0.0760
h o = Rx−1r y = r x (1) r x (0) r x (1) r y (0) = 0.4723
r x (2) r x (1) r x (0) r y (1) 0.0760
6.19 Consider the ARMA(1,1) process x(n) = 0.8x(n − 1) + ω(n) + 0.5ω(n − 1), where ω(n) ∼ W G N (0, 1).
(a) Determine the coefficients and the MMSE of (1) the one-step ahead FLP x̂(n) = a1 x(n − 1) + a2 x(n − 2)
and (2) the two-step ahead FLP x̂(n + 2) = a1 x(n − 1) + a2 x(n − 2).
Using (6.5.20)
f
1 Po (n)
R̄(n) =
ao (n) 0
where
r (0) = 8.25 [r (1) r (2)] = [7.1 5.68]
Px (n) r (n)
fH x x x
R̄(n) = = r x (1) 7.1 r x (0) = 8.25 r x (1) = 7.1
r f (n) R(n − 1) =
r x (2) 5.68 r x (1) = 7.1 r x (0) = 8.25
Clearly, for both filters above, the zero in within the unit circle and therefore minimum phase.
6.20 Consider a random signal x(n) = s(n) + ν(n), where ν(n) ∼ WGN(0, 1) and s(n) is the AR(1) process
s(n) = 0.9s(n − 1) + w(n), where w(n) ∼ WGN(0, 0.64). The signals s(n) and ν(n) are uncorrelated.
Statistical and Adaptive Signal Processing - Solution Manual 121
(a) Determine and plot the autocorrelation rs (l) and the PSD Rs (e j ω of s(n).
Start with
where,
Hence
Using,
a |l|
[al u(n)] ∗ [a −l u(n)] = |a| < 1
1 − a2
and
0.64 64
rs (l) = (0.9)|l| = (0.9)|l|
0.19 19
The PSD is
∞
∞ −∞
64
Rs (e j ω ) = rs (l)e− j ωl = (0.9)l e− j ωl + (0.9)−l e− j ωl
−∞
19 0 −1
& − jω '
64 1 0.9e
= +
19 1 − 0.9e − j ω 1 − 0.9e− j ω
Therefore,
0.64
Rs (e j ω ) =
1.81 − 1.8 cos ω
The plot is obtained using the Matlab script and is shown in Figure 6.20a.
% (a) Plot of the PSD R_s
Hf_1 = figure(’units’,SCRUN,’position’,SCRPOS,...
’paperunits’,PAPUN,’paperposition’,[0,0,4,2]);
set(Hf_1,’NumberTitle’,’off’,’Name’,’Pr0620b’);
omg = [0:1:500]*pi/500;
Rs = (0.64)./(1.81-1.8*cos(omg));
plot(omg/pi,Rs,’g’); axis([0,1,0,70]);
xlabel(’\omega / \pi’,’fontsize’,label_fontsize);
ylabel(’R_s(e^{j\omega})’,’fontsize’,label_fontsize);
set(gca,’xtick’,[0:0.2:1],’ytick’,[0:10:70]);
title(’PSD of s(n)’,’fontsize’,title_fontsize);
(b) Design a second-order optimum FIR filter to estimate s(n) from x(n). What is the MMSE?
122 Statistical and Adaptive Signal Processing - Solution Manual
PSD of s(n)
70
60
50
40
Rs(ejω)
30
20
10
0
0 0.2 0.4 0.6 0.8 1
ω/π
%% Computed Parameters
% Autocorrelation of s(n): rs(l) = (var_w/(1-a*a))*a^|l|
l = 0:100; rs = (var_w/(1-a*a))*a.^l;
Ps = rs(1);
% Signal x(n) = s(n) + v(n);
% Autocorrelation of x(n): rx(l) = rs(l)+var_v*delta(l)
rx = rs + var_v*[1,zeros(1,100)];
% Crosscorrelation between x(n) and s(n): rxs(l) = rs(l)
rxs = rs;
% Optimal filter
M = 2;
Rx = toeplitz(rx(1:M),rx(1:M));
dxs = rxs(1:M)’;
co = Rx\dxs;
% Optimal error
Po = Ps - dxs’*co;
% Printout
Second-order (i.e., length M = 2) optimal FIR filter design
Optimal FIR filter coefficients: 0.5584, 0.3064
Optimal error = 0.5584
(c) Design an optimum IIR filter to estimate s(n) from x(n). What is the MMSE?
Start with
Rs x (e j ω )
Ho (e j ω ) =
Rx (e j ω )
Statistical and Adaptive Signal Processing - Solution Manual 123
Now
0.64
Rx (e j ω ) = Rs (e j ω ) + Rν (e j ω ) = +1
1.81 − 1.8 cos ω
2.45 − 1.8 cos ω
=
1.81 − 1.8 cos ω
and
0.64
Rs x (e j ω ) = Rs (e j ω ) =
1.81 − 1.8 cos ω
Thus
0.64
Ho (e j ω ) =
2.45 − 1.8 cos ω
or
h o (n) = 0.3851(0.4377)|l|
6.21 A useful signal s(n) with PSD Rs (z) = [(1 − 0.9z −1 )(1 − 0.9z)]−1 is corrupted by additive uncorrelated noise
ν(n) ∼ WN(0, σ 2v ). Choose σ 2v = 1.
(a) The resulting signal x(n) = s(n) + ν(n) is passed through a causal filter with system function H (z) =
(1 − 0.8z −1 )−1 . Determine (1) the SNR at the input, (2) the SNR at the output, and (3) the processing
gain, that is, the improvement in SNR.
1. the SNR at the input: The autocorrelation of the input is
1
rs (l) = Z −1 [Rs (z)] = (0.9)|l| = 5. 263 2 (0.9)|l|
0.19
Hence the input power is rs (0) = 5. 263 2. The noise power is rv (0) = σ 2v = 1. Hence
SNRI = 5. 263 2
2. the SNR at the Output: Let the signal component at the output of the filter due to s(n) be ys (n) and
that due to noise be yv (n). Then
1
R ys (z) = H (z)H (z −1)Rs (z) =
(1 − 0.8z) 1 − 0.8z −1 (1 − 0.9z) 1 − 0.9z −1
79. 365z 169. 17z 169. 17z 79. 365z
= − + − +
z − .8 z − .9 z − 1. 111 1 z − 1. 25
or
Thus the signal power at the output of the filter is 169. 17 − 79. 365 = 89. 805. Similarly,
1
R yv (z) = H (z)H (z −1)Rv (z) =
(1 − 0.8z) 1 − 0.8z −1
2. 777 8z 2. 777 8z
= −
z − .8 z − 1. 25
or
Thus the noise power at the output of the filter is 2. 777 8. Hence SNRO = 89. 805
2. 777
= 32. 339.
3. the processing gain:
(b) Determine the causal optimum filter and compare its performance with that of the filter in (a).
First
1
Rx (z) = Rs (z) + Rv (z) =
+1
(1 − 0.9z) 1 − 0.9z −1
2.81 − 0.9z − 0.9z −1 (1 − 0. 362 33z) 1 − 0. 362 33z −1
=
= 0. 551 98
(1 − 0.9z) 1 − 0.9z −1 (1 − 0.9z) 1 − 0.9z −1
1 − 0. 362 33z −1
Hx (z) =
1 − 0.9z −1
Also
Rs x (z) Rs (z) 1 (1 − 0.9z)
Rsw (z) = = =
Hx (z) Hx (z )−1
(1 − 0.9z) 1 − 0.9z −1 (1 − 0. 362 33z)
1 1. 483 9 1. 483 9
=
= −1
−
1 − 0.9z −1 (1 − 0. 362 33z) 1 − . 9z 1 − 0. 362 33z
Hence
[Rsw (z)]+ 1 1. 483 9 1 − 0.9z −1
Hc (z) = =
σ 2x Hx (z) 0. 551 98 1 − . 9z −1 1 − 0. 362 33z −1
2.6883
=
1 − 0. 362 33z −1
1. the SNR at the input: This is same as before, that is, SNRI = 5. 263 2
2. the SNR at the Output: Let the signal component at the output of the filter due to s(n) be ys (n) and
that due to noise be yv (n). Then
(2.6883) (2.6883)
R ys (z) = Hc (z)Hc (z −1 )Rs (z) =
1 − 0. 362 33z −1 (1 − 0. 362 33z) (1 − 0.9z) 1 − 0.9z −1
8. 318 9z 94. 478z 94. 478z 8. 318 9z
= − + − +
z − . 362 33 z − .9 z − 1. 111 1 z − 2. 759 9
Statistical and Adaptive Signal Processing - Solution Manual 125
or
Thus the signal power at the output of the filter is 94.478 − 8. 318 9 = 86. 159. Similarly,
(2.6883) (2.6883)
R yv (z) = Hc (z)Hc (z −1 )Rv (z) =
1 − 0. 362 33z −1 (1 − 0. 362 33z)
8. 319 1 8. 319 1
= −
z − . 362 33 z − 2. 759 9
or
Thus the noise power at the output of the filter is 8.3191. Hence SNRO = 86. 159
8.3191
= 10. 357.
3. the processing gain:
6.22 A useful signal s(n) with PSD Rs (z) = 0.36[(1 − 0.8z −1 )(1 − 0.8z −1 )]−1 is corrupted by additive uncorre-
lated noise ν(n) ∼ WN(0, 1). Determine the optimum noncausal and causal IIR filters, and compare their
performance by examining the MMSE and their magnitude response.
The optimum noncausal filter is
Rs x (z) Rs (z) 0.36
Hnc (z) = = =
Rx (z) Rs (z) + Rν (z) 0.36 + (1 − 0.8z −1 )(1 − 0.8z −1 )
0.225
=
(1 − 0.5z )(1 − 0.5z −1 )
−1
Therefore the optimum noncausal filter is h nc (l) = (0.225)(0.5)|l| . The resulting MMSE is
Po = rs (0) − h nc (k)rs x (k) = 1 − (0.225) (0.5)|k| (0.9)|k| = 1 − (0.225)(3.333)
k k
= 0.25
where
R yx (z) Rs x (z) 0.36 1 − 0.8z
= =
Hx (1/z) + Hx (1/z) + (1 − 0.8z −1 )(1 − 0.8z) 1 − 0.5z +
−0.6 0.6 0.6
= + =
1 − 2z −1 1 − 0.8z −1
+ 1 − 0.8z −1
Also
1 − 0.5z −1 1 − 0.5z
Rx (z) = Rs (z) + Rν (z) = σ 2x Hx (z)Hx (z −1 ) = (1.6)
1 − 0.8z −1 1 − 0.8z
126 Statistical and Adaptive Signal Processing - Solution Manual
Therefore,
1 − 0.5z −1
Hx (z) =
1 − 0.8z −1
and
1 − 0.5z −1 0.6 0.375
Hc (z) = =
1.6(1 − 0.8z −1 ) 1 − 0.8z −1 1 − 0.5z −1
The optimum causal filter is
∞
Po = rs (0) − h c (k)rs x (k) = 1 − (0.375) (0.5)k (0.9)k = 1 − (0.375)(1.667)
k k=0
= 0.375
−1
6.23 Consider a process with PSD Rx (z) = σ 2 Hx (z)H
! x (z ). Determine the D-step ahead linear predictor, and
show that the MMSE is given by P (D) = σ 2 n=0 h 2x (n). Check your results by using the PSD Rx (z) =
D−1
y(n) = x(n + D)
then
∞
[D]
e (n + D) = x(n + 1) −
f
h lp (k)x(n − k)
k=0
[D]
where h lp (n) is the impulse response of the D-step ahead predictor. Thus
or
R yx (z) = z D Rx (z)
Thus,
D 2
1 z σ x Hx (z)Hx (1/z) [z D Hx (z)]+
Hlp[D] (z) = 2 =
σ x Hx (z) Hx (1/z) + Hx (z)
where
Consider,
z D Hx (z) = z D h(0) + h(1)z D−1 + h(2)z D−2 + · · · + h(D)z 0 + h(D + 1)z −1 + · · · h(0) = 1
Statistical and Adaptive Signal Processing - Solution Manual 127
Hence,
or
! ! D−1
−k
[z D Hx (z)]+ D−1
k=0 h(k)z h(k)z −1
= zD − zD =z D
1− k=0
Hx (z) Hx (z) Hx (z)
Substituting in Po[D]
2 ! D−1
1 h(k)z −1
Po[D] = [Rx (z) − z D
1− k=0
z −D Rx (z)]z −1 dz
2π j Hx (z)
2 ! D−1 2
D−1
1 h(k)z −1 −1 1
= Rx (z) k=0
z dz = σ 2x Hx (1/z) h(k)z −1 z −1 dz
2π j Hx (z) 2π j k=0
2
D−1
σ 2x
= Hx (1/z) h(k)z −1 z −1 dz
2π j k=0
To check, consider
1 − a2
Rx (z) =
(1 − az −1 )(1 − az)
with
1 1
σ 2x = (1 − a 2 ), Hx (z) = , Hx (z −1 ) = , h x (k) = a k u(k)
1 − az −1 1 − az
Hence
and
H0 (z) = a D ⇒ h 0 (k) = a D δ(k)
The MMSE is
∗ ∗
Po = r y (0) − h 0 (k)r yx (k) = r x (0) − a D δ(k)r yx (k)
k
∞
∗
= r x (0) − a D r yx (0) = σ 2x h x (k)2 − σ 2x h x (k)2
D
D−1
= σ 2x h x (k)2
k=0
6.24 Let x(n) = s(n) + ν(n) with Rν (z) = 1, Rsν (z) = 0, and
0.75
Rs (z) =
(1 − 0.5z −1 )(1 − 0.5z)
Determine the optimum filters for the estimation of s(n) and s(n − 2) from {x(k)}n−∞ and the corresponding
MMSEs.
Start with
1 Rs x (z) 1 Rs (z)
Hc (z) = = 2
σ 2x Hx (z) Hx (1/z) σ x Hx (z) Hx (1/z)
Compute the autocorrelation Rx (z)
0.75
Rx (z) = Rs (z) + Rν (z) = +1
(1 − 0.5z −1 )(1 − 0.5z)
1 − 0.2679z −1 1 − 0.2679z
= σ 2x Hx (z)Hx (z −1 ) = (1.866)
1 − 0.5z −1 1 − 0.5z
Therefore,
1 − 0.2679z −1
Hx (z) =
1 − 0.5z −1
Substituting into the above equation for Hc (z)
1 1 − 0.5z −1 0.8659
Hc (z) =
1.866 1 − 0.2679z −1 1 − 0.5z −1
1
= 0.464
1 − 0.2679z −1
Therefore, h c (l) = 0.464(0.2679)l u(l), and is shown in Figure 6.24. The resulting MMSE is
∞
Po = rs (0) − h c (k)rs x (k) = 1 − 0.464(0.2679)k (0.70)(0.5)k = 0.5982
k k=0
0.45 0.4
0.4
0.35
0.1
0.1
0.05 0.05
0 0
−1 0 1 2 3 4 5 6 7 8 9 −1 0 1 2 3 4 5 6 7 8 9
The two-step ahead linear predictor can be found directly using (6.5.18)
Predictor coefficients
0.7
0.6
0.4
0.3
0.2
0.1
0
−2 0 2 4 6 8 10
Rx (n − 1)ao = −r xf (n)
6.27 Let x(n) = s(n) + ν(n) with ν(n) ∼ WN(0, 1) and s(n) = 0.6s(n − 1) + w(n), where w(n) ∼ WN(0, 0.82).
The process s(n) and ν(n) are uncorrelated.
Determine the optimum filters for the estimation of s(n), s(n + 2), and s(n − 2) from {x(k)}n−∞ and the
corresponding MMSEs.
The optimum filter equation is
Co = Rx−1 d
where Rx = Rs + Rν . The autocorrelation of the signal is symmetric, and each lag is found using
rs (l) = rs (0)(0.6)|l|
Statistical and Adaptive Signal Processing - Solution Manual 131
Predictor coefficients
0.6
0.5
0.3
0.2
0.1
−0.1
−2 0 2 4 6 8 10
where
σ 2w σ 2w
rs (0) = =
1 − ρ2 1 − (0.6)2
and rν (l) = σ 2ν δ(l). The same optimum filter equation is used for the three cases: filtering s(n), estimation
s(n + 2) or smoothing s(n − 2). The only change is the value of the cross-correlation vector between the
desired response and the input data vector. The value for this vector is shown below for the three cases Filtering
1
(0.6)
s(n) : d(l) = E{x(n)s ∗ (n + l)} = rs (l) = (0.6)2
..
.
Estimation
(0.6)2
(0.6)3
s(n + 2) : d(l) = E{x(n)s ∗ (n + l)} = rs (l + 2) = (0.6)4
..
.
Smoothing
(0.6)2
(0.6)
1
s(n − 2) : d(l) = E{x(n)s ∗ (n + l)} = rs (l − 2) = (0.6)
(0.6)2
..
.
The MMSE is found directly using the filter coefficients and the appropriate cross-correlation vector
Po = Py − d H Co = rs (0) − d H Co
The filter coefficients are found, using MATLAB, and shown in Figure 6.27, along with the appropriate MMSE
values.
132 Statistical and Adaptive Signal Processing - Solution Manual
0.6
0
0 1 2 3 4 5 6 7 8 9 10
0.6
0
0 1 2 3 4 5 6 7 8 9 10
0.6
0
0 1 2 3 4 5 6 7 8 9 10
6.28 A random sequence s(n) with PSD Rs (z) = 1−0.5z −11 (1−0.5z) is corrupted by noise sequence v(n) with PSD
( )
Rv (z) = 5 to obtain the observed sequence x(n) = s(n) + v(n). Also Rsv (z) = 0.
$ %
Optimal causal filter to estimate s(n) from {x(n)}n−∞ : First, rs (l) = Z −1 1−0.5z −11 (1−0.5z) = 43 (0.5)|l| . Now
( )
1 1 − 0.4z −1 (1 − 0.4z)
Rx (z) =
+ 5 = 6.25
1 − 0.5z −1 (1 − 0.5z) 1 − 0.5z −1 (1 − 0.5z)
and Rs x (z) = Rs (z). Thus after spectral factorization
1 − 0.4z −1
σ 2x = 6.25 and Hx (z) =
, |z| > 0.5
1 − 0.5z −1
Hence
Rs x (z) 1 (1 − 0.5z) 1
Rsw (z) = =
=
Hx (z −1 ) 1 − 0.5z −1 (1 − 0.5z) (1 − 0.4z) 1 − 0.5z −1 (1 − 0.4z)
1. 25 1. 25
= −
1 − 0. 5z −1 1 − 2. 5z −1
or [Rsw (z)]+ = 1. 25
1−0. 5z −1
. Finally
[Rsw (z)]+ 1 1. 25 1 − 0.5z −1 0.2
Hc (z) = 2 =
=
, |z| > 0.4
σ x Hx (z) 6.25 1 − 0. 5z −1 1 − 0.4z −1 1 − 0.4z −1
and h c (n) = 0.2 (0.4)n u(n). The MMSE is given by
∞
∞
4 1 4
Pc = rs (0) − h c (k)rs x (k) = − (0.4)k (0.5)k = 1
k=0
3 5 3 k=0
Optimal prediction filter to estimate s(n + 2) from {x(n)}n−∞ : The whitening part of the causal filter does not
depend on s(n + 2) and is given by Hx (z). The coloring part depends on s(n + 2) and is given by z 2 Rsw (z).
Thus
[Rsw (z)]+ 0.2 (0.5)2 0.0 5
Ho[2] (z) = (0.5) 2
=
=
, |z| > 0.4
σ x Hx (z)
2 1 − 0.4z −1 1 − 0.4z −1
Statistical and Adaptive Signal Processing - Solution Manual 133
Optimal smoothing filter to estimate s(n − 2) from {x(n)}n−∞ : Once again the whitening part of the causal
filter does not depend on s(n + 2) and is given by Hx (z). The coloring part is obtained from
[−2]
rsw (l) + , rsw (l − 2)u(l)
From Rsw (z) above, we have rsw (l) = 1.25 (0.5)l u(l) + 1.25 (2.5)l u(−l − 1). Hence
[−2]
rsw (l) + = rsw (l − 2)u(l) = 1.25 (0.5)l−2 u(l − 2) + (2.5)l−2 u(−l + 2 − 1) u(l)
= 1.25 (0.5)l−2 u(l − 2) + 1.25 {.4δ(l) + δ(l − 1)}
or
" # 5 z −2 1 5
[−2]
Rsw (z) +
= Z [−2]
rsw (l) + = + + z −1
41−
0.5z
−1 2 4
−1 −2
1 1 + 2z + 1.25z
=
2 1 − 0.5z −1
Finally
[−2]
Rsw (z) + 1 1 − 0.5z −1 1 1 + 2z −1 + 1.25z −2
Ho[−2] (z) = =
σ 2x Hx (z) 6.25 1 − 0.4z −1 2 1 − 0.5z −1
1 + 2z −1 + 1.25z −2
= 0.08
, |z| > 0.4
1 − 0.4z −1
1 − 0.4z −1 + 2.4z −1 1 − 0.4z −1 + 2.21z −2
= 0.08
, |z| > 0.4
1 − 0.4z −1
1
= 0.08 + 0.192z −1 + 0.1768z −2
, |z| > 0.4
1 − 0.4z −1
or
h [−2]
o (n) = 0.08δ(n) + 0.192δ(n − 1) + 0.1768 (0.4)n−2 u(n − 2)
1
N
P̂ f = |xk (n) − x̂kf (n)|2 k = 1, . . . , K
N − 1 n=2
1
N−2
P̂ b = |xk (n) − x̂kb (n)|2 k = 1, . . . , K
N − 1 n=0
Optimum Pf = 1.0119
1.5
MMSE
1
0.5
0
0 100 200 300 400 500 600 700 800 900 1000
MMSE of a Second−order BLP
2
Optimum Pb = 1.0119
1.5
MMSE
0.5
0
0 100 200 300 400 500 600 700 800 900 1000
MMSE of a Second−order SLP
2
Optimum Ps = 0.85
1.5
MMSE
0.5
0
0 100 200 300 400 500 600 700 800 900 1000
sample function index k
Pb = sum(eb(1:N-M,:) .*eb(1:N-M,:),1)/(N-M);
subplot(3,1,2);
plot(1:K,Pb,’g’,[0,K],[Pbo,Pbo],’r--’);
axis([0,K,0,2]);
%xlabel(’sample function index k’,’fontsize’,label_fontsize);
ylabel(’MMSE’,’fontsize’,label_fontsize);
title(’MMSE of a Second-order BLP’,’fontsize’,title_fontsize);
text(700,1.7,[’Optimum P^b = ’,num2str(Pbo)],’fontsize’,text_fontsize);
1
N−1
P̂ s = |xk (n) − x̂kc (n)|2 k = 1, . . . , K
N − 1 n=1
6.30 Let x(n) = y(n) + v(n) be a wide-sense stationary process. The linear, symmetric smoothing filter estimator
of y(n) is given by
L
ŷ(n) = h(k)x(n − k)
k=−L
(a) Determine the normal equations for the optimum MMSE filter.
(b) Show that the smoothing filter cos has linear phase.
(c) Use the Lagrange multiplier method to determine the MMSE Mth-order estimator ŷ(n) = c H x(n), where
M = 2L + 1, when the filter vector c is constrained to be conjugate symmetric, that is, c = Jc∗ . Compare
the results with those obtained in part (a).
Pc[D] = 1 − 58 ( 45 )2D
Solving directly using the following formula
∞
Pc[D] = r y (0) − h [D]
c (k)r yx (k)
k=0
∞
= 1− 3
8
( 12 )k ( 45 ) D ( 45 )k ( 45 ) D
k=0
∞
= 1− (
3 4 2
8 5
) D ( 12 45 )k
k=0
( ) ( ) −D−1
5 1 − 45 z −1 3 zD
Hc[D] (z), D < 0 = + 2D 2l z −l
8 1 − 12 z −1 5 1 − 45 z −1 l=0
−D−1
4 −1 D l −l
(1 − z )2 2z
3
D 5
z l=0
= +
8 1 − 12 z −1 1− 1 −1
z
2
(a) Consider
$ ! %
r yw (l) = r yw (l + D)u(l), D < 0
+
3 4 l+D
= u(l + D) + 2l+D u(−l − D − 1) u(l), D < 0
5 5
3 4 l+D 3
= u(l + D) + 2l+D {u(l) − u(l + D)} , D < 0
5 5 5
Hence
$ % −D−1 −D−1
! 3 zD 3 D l −l 3 zD 3 D 2 l
R yw (z) = + 2 2z = + 2
+ 5 1 − 45 z −1 5 l=0
5 1 − 45 z −1 5 l=0
z
3 zD 3 D 1 − (z/D) D 3 zD 3 2D − z D
= + 2 = +
5 1 − 45 z −1 5 1 − 2z −1 5 1 − 45 z −1 5 1 − 2z −1
138 Statistical and Adaptive Signal Processing - Solution Manual
or
( )
$ !
% 3 zD 2D − z D
R yw (z) = + , D<0
+ 5 1 − 45 z −1 1 − 2z −1
As −D → ∞ we have
Hence
∞
lim Pc[D] = r y (0) − h c (k)r yx (k) = Pnc
−D→∞
k=−∞
6.34 Consider the block diagram of a simple communication system shown in Figure 6.38 in which H1 (z) =
1/(1 + 0.95z −1 ).
(a) Determine a second-order optimum FIR filter (M = 2) that estimates the signal s(n) from the received
signal x(n) = z(n) + ν(n). What is the corresponding MMSE Po ?
From the block diagram, s(n) = −0.95s(n − 1) + w(n) and z(n) = 0.85z(n − 1) + s(n). The optimum
filter is Co = Rz−1rs x . The first two lags of the autocorrelation are
The optimum filter coefficients are shown in the top plot of Figure 6.34.
Statistical and Adaptive Signal Processing - Solution Manual 139
−0.2
−0.4
−0.6
c0 = [ 0.94,−0.812]
−0.8
−1
−1.2
0.175 0.165
0.17 0.16
0.165 0.155
0.16 0.15
0.155 0.145
0.15 0.14
0.145 0.135
0.14 0.13
0 10 20 30 40 50 60 70 80 90 100 0 10 20 30 40 50 60 70 80 90 100
ε2 = σ 2y − 2cT d + cT Rx c
(a) The Matlab script is shown below and the plots are shown in Figure 6.35a.
clc; close all;
set(0,’defaultaxesfontsize’,default_fontsize);
% Given parameters
var0 = 0.25;
a = 0.6;
Hf_1 = figure(’units’,SCRUN,’position’,SCRPOS,...
’paperunits’,PAPUN,’paperposition’,[0,0,5,4]);
set(Hf_1,’NumberTitle’,’off’,’Name’,’Pr0635a’);
subplot(2,2,1), stem(n,s,’filled’,’g’);
ylabel(’s(n)’,’fontsize’,label_fontsize);
title(’Signal s(n)’,’fontsize’,title_fontsize);
axis([-1,M,0,1]);
ro = 0.1; Pv = var0/(1-ro*ro);
rv = ro.^n; Rv = Pv*toeplitz(rv);
c = inv(Rv)*s0;
subplot(2,2,2), stem(n,c,’filled’,’g’);
ylabel(’c(n)’,’fontsize’,label_fontsize);
SNRmax = Ps*(s0’*inv(Rv)*s0)
title([’\rho = 0.1, SNR= ’,num2str(SNRmax),’ dB’],’fontsize’,title_fontsize);
axis([-1,M,0,4]);
ro = -0.8; Pv = var0/(1-ro*ro);
rv = ro.^n; Rv = Pv*toeplitz(rv);
c = inv(Rv)*s0;
Statistical and Adaptive Signal Processing - Solution Manual 141
3.5
0.8
3
0.6 2.5
s(n)
c(n)
2
0.4 1.5
1
0.2
0.5
0 0
0 2 4 6 8 0 2 4 6 8
2.5
8
2
6 1.5
c(n)
c(n)
1
4 0.5
0
2
−0.5
0 −1
0 2 4 6 8 0 2 4 6 8
Sample index (n) Sample index (n)
Figure 6.35a: Signal and impulse responses of optimal matched filters for M = 8
subplot(2,2,3), stem(n,c,’filled’,’g’);
xlabel(’Sample index (n)’,’fontsize’,label_fontsize);
ylabel(’c(n)’,’fontsize’,label_fontsize);
SNRmax = Ps*(s0’*inv(Rv)*s0)
title([’\rho = -0.8, SNR= ’,num2str(SNRmax),’ dB’],’fontsize’,title_fontsize);
axis([-1,M,0,10]);
ro = 0.8; Pv = var0/(1-ro*ro);
rv = ro.^n; Rv = Pv*toeplitz(rv);
c = inv(Rv)*s0;
subplot(2,2,4), stem(n,c,’filled’,’g’); hold on;
plot([-1,M],[0,0],’w’);
xlabel(’Sample index (n)’,’fontsize’,label_fontsize);
ylabel(’c(n)’,’fontsize’,label_fontsize);
SNRmax = Ps*(s0’*inv(Rv)*s0)
title([’\rho = 0.8, SNR= ’,num2str(SNRmax),’ dB’],’fontsize’,title_fontsize);
axis([-1,M,-1,3]);
(b) The Matlab script is shown below and the plots are shown in Figure 6.35b.
% (b) Plots for rho = 0.1, -0.8, and 0.8, M = 16
M = 16; n = 0:M-1;
s = a.^n; s0 = s’;
Ps = 1;
Hf_2 = figure(’units’,SCRUN,’position’,SCRPOS,...
’paperunits’,PAPUN,’paperposition’,[0,0,5,4]);
142 Statistical and Adaptive Signal Processing - Solution Manual
3.5
0.8
3
0.6 2.5
s(n)
c(n)
2
0.4 1.5
1
0.2
0.5
0 0
0 5 10 15 0 5 10 15
2.5
8
2
6 1.5
c(n)
c(n)
1
4 0.5
0
2
−0.5
0 −1
0 5 10 15 0 5 10 15
Sample index (n) Sample index (n)
Figure 6.35b: Signal and impulse responses of optimal matched filters for M = 16
set(Hf_2,’NumberTitle’,’off’,’Name’,’Pr0635b’);
subplot(2,2,1), stem(n,s,’filled’,’g’);
ylabel(’s(n)’,’fontsize’,label_fontsize);
title(’Signal s(n)’,’fontsize’,title_fontsize);
axis([-1,M,0,1]);
ro = 0.1; Pv = var0/(1-ro*ro);
rv = ro.^n; Rv = Pv*toeplitz(rv);
c = inv(Rv)*s0;
subplot(2,2,2), stem(n,c,’filled’,’g’);
ylabel(’c(n)’,’fontsize’,label_fontsize);
SNRmax = Ps*(s0’*inv(Rv)*s0)
title([’\rho = 0.1, SNR= ’,num2str(SNRmax),’ dB’],’fontsize’,title_fontsize);
axis([-1,M,0,4]);
ro = -0.8; Pv = var0/(1-ro*ro);
rv = ro.^n; Rv = Pv*toeplitz(rv);
c = inv(Rv)*s0;
subplot(2,2,3), stem(n,c,’filled’,’g’);
xlabel(’Sample index (n)’,’fontsize’,label_fontsize);
ylabel(’c(n)’,’fontsize’,label_fontsize);
SNRmax = Ps*(s0’*inv(Rv)*s0)
title([’\rho = -0.8, SNR= ’,num2str(SNRmax),’ dB’],’fontsize’,title_fontsize);
axis([-1,M,0,10]);
Statistical and Adaptive Signal Processing - Solution Manual 143
ro = 0.8; Pv = var0/(1-ro*ro);
rv = ro.^n; Rv = Pv*toeplitz(rv);
c = inv(Rv)*s0;
subplot(2,2,4), stem(n,c,’filled’,’g’); hold on;
plot([-1,M],[0,0],’w’);
xlabel(’Sample index (n)’,’fontsize’,label_fontsize);
ylabel(’c(n)’,’fontsize’,label_fontsize);
SNRmax = Ps*(s0’*inv(Rv)*s0)
title([’\rho = 0.8, SNR= ’,num2str(SNRmax),’ dB’],’fontsize’,title_fontsize);
axis([-1,M,-1,3]);
6.36 Matlab program to reproduce the plot shown in Figure 6.9.2. The Matlab script is shown below and the plots
are shown in Figure 6.36.
Hf_1 = figure(’units’,SCRUN,’position’,SCRPOS,...
’paperunits’,PAPUN,’paperposition’,[0,0,3,3]);
set(Hf_1,’NumberTitle’,’off’,’Name’,’Pr0636a’);
plot(x(1,:),x(2,:),’g’,y(1,:),y(2,:),’m’);hold on;
plot(y1(1,:),y1(2,:),’c:’,y2(1,:),y2(2,:),’r--’);
plot([minx,maxx],[0,0],’w’,[0,0],[miny,maxy],’w’);
axis equal
axis([minx,maxx,miny,maxy]);
title(’\rho = -0.81’,’fontsize’,title_fontsize);
xlabel(’c_1’,’fontsize’,label_fontsize);
ylabel(’c_2’,’fontsize’,label_fontsize);
grid; hold off;
[legh,objh] = legend(’c^Hc=1’,’c^HRc=1’,...
’c^HRc=\lambda_1’,’c^HRc=\lambda_2’,1);
pause
144 Statistical and Adaptive Signal Processing - Solution Manual
exportfig(gcf,’p0636a.eps’,’fontmode’,’scaled’,...
’linemode’,’scaled’,’color’,’cmyk’);
Hf_2 = figure(’units’,SCRUN,’position’,SCRPOS,...
’paperunits’,PAPUN,’paperposition’,[0,0,3,3]);
set(Hf_1,’NumberTitle’,’off’,’Name’,’Pr0636b’);
plot(x(1,:),x(2,:),’g’,y(1,:),y(2,:),’m’);hold on;
plot(y1(1,:),y1(2,:),’c:’,y2(1,:),y2(2,:),’r--’);
plot([minx,maxx],[0,0],’w’,[0,0],[miny,maxy],’w’);
title(’\rho = 0.81’,’fontsize’,title_fontsize);
xlabel(’c_1’,’fontsize’,label_fontsize);
ylabel(’c_2’,’fontsize’,label_fontsize);
axis equal
axis([minx,maxx,miny,maxy]);
grid; hold off;
[legh,objh] = legend(’c^Hc=1’,’c^HRc=1’,...
’c^HRc=\lambda_1’,’c^HRc=\lambda_2’,1);
pause
exportfig(gcf,’p0636b.eps’,’fontmode’,’scaled’,...
’linemode’,’scaled’,’color’,’cmyk’);
(a) SNRs for the matched and forward linear prediction error (LPE) filters:
M = 2: For the eigenfilter design, the autocorrelation matrix is given by
1 ρ
Rv =
ρ 1
Statistical and Adaptive Signal Processing - Solution Manual 145
Signal s(n) ρ = 0.1, SNR= 5.5213 dB Signal s(n) ρ = 0.1, SNR= 5.5225 dB
1 4
1 4
3.5 3.5
0.8 0.8
3 3
s(n)
c(n)
s(n)
c(n)
2 2
1 1
0.2 0.2
0.5 0.5
0 0 0 0
0 2 4 6 8 0 2 4 6 8 0 5 10 15 0 5 10 15
ρ = −0.8, SNR= 13.6804 dB ρ = 0.8, SNR= 1.6898 dB ρ = −0.8, SNR= 13.69 dB ρ = 0.8, SNR= 1.69 dB
10 3 10 3
2.5 2.5
8 8
2 2
1.5 6 1.5
6
c(n)
c(n)
c(n)
c(n)
1 1
4 4 0.5
0.5
0 0
2 2
−0.5 −0.5
0 −1 0 −1
0 2 4 6 8 0 2 4 6 8 0 5 10 15 0 5 10 15
Sample index (n) Sample index (n) Sample index (n) Sample index (n)
Figure 6.36: Geometric interpretation of the optimization process for ρ = −0.8 and ρ = 0.8
whose eigenvalues are: −ρ + 1, ρ + 1. The minimum eigenvalue is λmin = (1 − ρ) and the maximum
SNR is
1 1
SNRmax = =
λmin 1−ρ
For the LPE filter the maximum SNR is given by
aoT ao
SNRmax =
aoT Rv ao
T
where ao is the forward linear predictor given by ao = 1 −ρ . Thus
1
1 −ρ
−ρ 1 + ρ2
SNRmax = =
1 ρ 1 1 − ρ2
1 −ρ
ρ 1 −ρ
M = 3: For the eigenfilter design, the autocorrelation matrix is given by
1 ρ ρ4
Rv = ρ 1 ρ
ρ4 ρ 1
:
:
whose eigenvalues are: 1 − ρ 4 , 1 + 21 ρ 4 + 12 ρ 8 + 8ρ 2 , 1 + 12 ρ 4 − 21 ρ 8 + 8ρ 2 . The minimum
eigenvalue is
:
1
1 1 8
λmin = 1 + ρ 4 − ρ + 8ρ 2 = 2 + ρ 4 − ρ 4 1 + 8ρ −6
2 2 2
1$ %
= 2 + ρ 4 1 − 1 + 8ρ −6
2
Hence the maximum SNR is
1 2
SNRmax = =
λmin 2 + ρ 4 1 − 1 + 8ρ −6
146 Statistical and Adaptive Signal Processing - Solution Manual
and
1 + 3ρ 4 + 3ρ 6 + 2ρ 8 + ρ 10
SNR(LPE)
max =
2
1 − ρ2 1 − ρ6
(b) Plots of the SNRs for M = 2, 3, and 4 and ρ = 0.6, 0.8, 0.9, 0.95, 0.99, and 0.995:
% (b) Plots of SNRs
ro = [0.6,0.8,0.9,0.95,0.99,0.995];
Hf_1 = figure(’units’,SCRUN,’position’,SCRPOS,...
’paperunits’,PAPUN,’paperposition’,[0,0,5,4]);
set(Hf_1,’NumberTitle’,’off’,’Name’,’Pr0637b’);
% 1. M = 2
SNR_M = 1./(1-ro); SNR_Mdb = 10*log10(SNR_M);
SNR_L = (1+ro.*ro)./(1-ro.*ro); SNR_Ldb = 10*log10(SNR_L);
subplot(3,1,1);
plot(ro,SNR_Mdb,’g’,ro,SNR_Ldb,’r:’);
%xlabel(’\rho’,’fontsize’,label_fontsize);
ylabel(’Decibels’,’fontsize’,label_fontsize);
title(’M = 2’,’fontsize’,title_fontsize);
legend(’Matched filter’,’LPE filter’,0)
% 2. M = 3
SNR_M = 2./(2+ro.^4.*(1-sqrt(1+8*ro.^(-6))));
SNR_Mdb = 10*log10(SNR_M);
SNR_L = (1+ro.^2+3*ro.^4+ro.^6)./((ro.^2-1).*(ro.^4-1));
SNR_Ldb = 10*log10(SNR_L);
Statistical and Adaptive Signal Processing - Solution Manual 147
M=2
25
Matched filter
20 LPE filter
Decibels
15
10
0
0.6 0.65 0.7 0.75 0.8 0.85 0.9 0.95 1
M=3
50
Matched filter
40 LPE filter
Decibels
30
20
10
0
0.6 0.65 0.7 0.75 0.8 0.85 0.9 0.95 1
M=4
80
Matched filter
LPE filter
60
Decibels
40
20
0
0.6 0.65 0.7 0.75 0.8 0.85 0.9 0.95 1
ρ
Figure 6.37b: Plots of the SNRs for matched and LPE filters
subplot(3,1,2);
plot(ro,SNR_Mdb,’g’,ro,SNR_Ldb,’r:’);
%xlabel(’\rho’,’fontsize’,label_fontsize);
ylabel(’Decibels’,’fontsize’,label_fontsize);
title(’M = 3’,’fontsize’,title_fontsize);
legend(’Matched filter’,’LPE filter’,0)
% 3. M = 4
SNR_M = 2./(2-ro+ro.^9-sqrt((ro-ro.^9).^2+4*(ro-ro.^4).^2));
SNR_Mdb = 10*log10(SNR_M);
SNR_L = (1+3*ro.^4+3*ro.^6+2*ro.^8+ro.^10)./((1-ro.^2).^2.*(1-ro.^6));
SNR_Ldb = 10*log10(SNR_L);
subplot(3,1,3);
plot(ro,SNR_Mdb,’g’,ro,SNR_Ldb,’r:’);
xlabel(’\rho’,’fontsize’,label_fontsize);
ylabel(’Decibels’,’fontsize’,label_fontsize);
title(’M = 4’,’fontsize’,title_fontsize);
legend(’Matched filter’,’LPE filter’,0)
The plots are shown in Figure 6.37b.
(c) Magnitude responses of matched, LPE, and binomial filters for M = 3 and ρ = 0.9:
% (c) Magnitude response plots
M = 3; ro = 0.9
gr=(1+sqrt(5))/2;
Hf_2 = figure(’units’,SCRUN,’position’,SCRPOS,...
148 Statistical and Adaptive Signal Processing - Solution Manual
0
Matched filter
LPE filter
Binomial filter
−5
−10
−15
Magnitude Response (dB)
−20
−25
−30
−35
−40
−45
−50
0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5
Frequency (Cycles/Sampling interval)
’paperunits’,PAPUN,’paperposition’,[0,0,5,4]);
set(Hf_2,’NumberTitle’,’off’,’Name’,’Pr0637c’);
6.38 Determine the matched filter for the deterministic pulse s(n) = cos ω0 n for 0 ≤ n ≤ M −1 and zero elsewhere.
PSD of pulse s0
−5 −5
10 10
−0.5 −0.4 −0.3 −0.2 −0.1 0 0.1 0.2 0.3 0.4 0.5 −0.5 −0.4 −0.3 −0.2 −0.1 0 0.1 0.2 0.3 0.4 0.5
PSD of Optimum Filter with White Noise
−5 −5
10 10
−0.5 −0.4 −0.3 −0.2 −0.1 0 0.1 0.2 0.3 0.4 0.5 −0.5 −0.4 −0.3 −0.2 −0.1 0 0.1 0.2 0.3 0.4 0.5
PSD of Optimum Filter with Colored Noise
−5 −5
10 10
−0.5 −0.4 −0.3 −0.2 −0.1 0 0.1 0.2 0.3 0.4 0.5 −0.5 −0.4 −0.3 −0.2 −0.1 0 0.1 0.2 0.3 0.4 0.5
2 2
SNR = 6 σν =1 SNR = 1.6483 σν =1
0 0
10 10
−5 −5
10 10
−0.5 −0.4 −0.3 −0.2 −0.1 0 0.1 0.2 0.3 0.4 0.5 −0.5 −0.4 −0.3 −0.2 −0.1 0 0.1 0.2 0.3 0.4 0.5
2 2
SNR = 1.2 σν =5 SNR = 0.32965 σν =5
0 0
10 10
−5 −5
10 10
−0.5 −0.4 −0.3 −0.2 −0.1 0 0.1 0.2 0.3 0.4 0.5 −0.5 −0.4 −0.3 −0.2 −0.1 0 0.1 0.2 0.3 0.4 0.5
2 2
SNR = 12 σν =0.5 SNR = 3.2965 σν =0.5
0 0
10 10
−5 −5
10 10
−0.5 −0.4 −0.3 −0.2 −0.1 0 0.1 0.2 0.3 0.4 0.5 −0.5 −0.4 −0.3 −0.2 −0.1 0 0.1 0.2 0.3 0.4 0.5
Figure 6.38:
co = κso
co = κ Rν−1 so
where κ = (soH Rν−1 so )−1 . The upper left plot of Figure 6.38 shows the spectrum of the signal, the
spectrum of the matched filter in white noise, and the spectrum of the matched filter in colored noise.
The dotted line in these plots represents the spectrum of the noise. As can be easily seen from this plot,
the matched filter will emphasis the spectrum with the least amount of noise energy, and de-emphasis the
spectrum with higher noise energy.
(c) Study the effect of the SNR in part(a) by varying the value of σ 2ν
The lower left and right plots of figure 6.38 show the matched filter for different values of σ 2ν in white
noise and colored noise respectively.
(d) Study the effect of the noise correlation in part(b) by varying the value of ρ
The upper right plot shows the matched filter for the colored noise case with different values of ρ
150 Statistical and Adaptive Signal Processing - Solution Manual
1
10 jω jω
|H(e )|max/ |H(e )|min = 6.573
0
10 W = 2.9
λ /λ = 6.078
−1 max min
10
−0.5 −0.4 −0.3 −0.2 −0.1 0 0.1 0.2 0.3 0.4 0.5
1
10 jω jω
|H(e )|max/ |H(e )|min = 12.54
0
10 W = 3.1
(a) Compute and plot the magnitude response |H (e j ω )| of the channel and |Co (e j ω )| of the optimum equalizer
for W = 2.9,3.1,3.3, and 3.5 and comment upon the results.
Using Example 6.8.1, the magnitude of |H (e j ω )| is shown for each W in Figure 6.39 where H (e j ω ) is
The optimum filter coefficients are found directly from Co = Rx−1 d where Rx = E{x(n)x ∗ (n)} and
d = E{a(n)x ∗ (n)}. Using equation 6.8.41,
D=7 d(l) = h(7 − l) ⇒ d(4) = h(3) d(5) = h(2) d(6) = h(1) d(l) = 0 elsewhere
Figure 6.39 shows the magnitude response of the optimum filter for each W . Note that the magnitude
response of the filter is the inverse of the channel. In effect, removing the influence of the channel from
the signal.
(b) Compute the spectral dynamic range |H (e j ω )|max /|H (e j ω )|min of the channel and the eigenvalue spread
λmax /λmin of the M x M input correlation matrix.
Figure 6.39 shows the values for the spectral dynamic range and the eigenvalue spread for each value of
W . Note that the value of these two parameters has a direct relation to each other.
6.40 In this problem we clarify some of the properties of the MSE equalizer discussed in Example 6.8.1.
(a) Compute and plot the MMSE Po as a function of M, and recommend how to choose a “reasonable” value.
(b) Compute and plot Po as a function of the delay D for 0 ≤ D ≤ 11. What is the best value of D?
(c) Study the effect of input SNR upon Po for M = 11 and D = 7 by fixing σ 2y = 1 and varying σ 2v .
6.41 In this problem we formulate the design of optimum linear signal estimators (LSE) using a constrained opti-
mization framework. To this end we consider the estimator e(n) = c0∗ x(n) + · · · + c∗M x(n − M) , c H x(n)
and we wish to minimize the output power E{|e(n)|2 } = c H Rc. To prevent the trivial solution c = 0 we need
to impose some constraint on the filter coefficients and use Lagrange multipliers to determine the minimum.
Let u i be an M × 1 vector with one at the ith position and zeros elsewhere.
(a) Show that minimizing c H Rc under the linear constraint u iT c = 1 provides the following estimators: FLP
if i = 0, BLP if i = M, and linear smoother if i = 0, M.
Statistical and Adaptive Signal Processing - Solution Manual 151
(b) Determine the appropriate set of constraints for the L-steps ahead linear predictor, defined by c0 = 1
and {ck = 0}1L−1 , and solve the corresponding constrained optimization problem. Verify your answer by
obtaining the normal equations using the orthogonality principle.
(c) Determine the optimum linear estimator by minimizing c H Rc under the quadratic constraints c H c = 1
and c H W c = 1 (W is a positive definite matrix) which impose a constraint on the length of the filter
vector.
Chapter 7
and then the determinants of both sides, prove Equation (7.1.25). Another proof, obtained using the L D L H
decomposition, is given by Equation (7.2.4).
Computing the matrix product directly
Rm rmb Im −Rm−1 rmb Rm 0m
=
rmb H ρ bm 0m 1 rmb H ρ bm − rmb H Rm−1 rmb
Using (7.1.23)
7.2 Prove the matrix inversion lemma for lower right corner partitioned matrices, which is described by Equations
(7.1.26) and (7.1.28).
Start with a slightly different partition of Rm+1 Qm+1 in (7.1.13)
f fH
ρ m rm qm qmH 1 0mH
Rm+1 Qm+1 = f f =
rm Rm q m Qm 0m Im
ρ mf qm + rmf H qm = 1 (1)
ρ mf qmH + rmf H Qm = 0mH
rmf qm + Rmf qm = 0m
rmf qmH + Rmf Qm = Im (2)
152
Statistical and Adaptive Signal Processing - Solution Manual 153
1
qm = −1 (4)
f fH f f
ρ m − rm Rm rm
−1
f f
− Rm rm
qm = −1
f fH f f
ρ m − rm Rm rm
am
= f
(5)
αm
f
where am and α m are defined per (7.1.27) and (7.1.28). Now, (4) into (5) yields
−1
Qm = Rmf (Im − rmf qmH )
H
−1
f f f
f
−1
rm Rm rm
= Rm Im + −1
f fH f f
ρ m − rm Rm rm
=
f f
αm αm
−f (a )(a H )
am
f Rm + m f m
αm αm
H
1 0m 1 1
= −f + f [1 amH ]
0m Rm α m am
7.3 This problem generalizes the matrix inversion lemmas to non-symmetric matrices.
(a) Show that if R −1 exists, the inverse of an upper left corner partitioned matrix is given by
−1
R r 1 α R −1 + wv T w
=
r̃ T σ α vT 1
where
Rw = −r
R T v = −r̃
α = σ − r̃ T R −1r = σ + v T r = σ + r̃ T w
154 Statistical and Adaptive Signal Processing - Solution Manual
1 1
q = = (6)
σ− r̃ H R−1 r α
where α = σ − r̃ H R−1 r.
Substitute (6) into (5) to obtain q
−R−1 r −R−1 r
q = = (7)
σ − r̃ H R−1 r α
Solve (1) for Q and substitute into (3) to obtain q̃T
(b) Show that if R −1 exists, the inverse of an upper left corner partitioned matrix is given by
−1
σ r̃T 1 1 vT
=
r R α w α R −1 + wv T
where
Rw = −r
R T v = −r̃
α = σ − r̃T R−1 r = σ + v T r = σ + r̃T w
σ q + r̃T q = 1 (1)
σ q̃ + r̃ Q = 0
T T T
(2)
rq + Rq = 0 (3)
RQ + rq̃ T
= I (4)
q = −R−1 rq (5)
1 1
q = = (6)
σ− r̃ H R−1 r α
where α = σ − r̃ H R−1 r.
Substitute (6) into (5) to obtain q
−R−1 r −R−1 r
q = = (7)
σ − r̃ H R−1 r α
−1
Therefore, Rm+1 is
−1
−1 σ r̃T q q̃T
Rm+1 = =
r R q Q
1 1 vT
= −1
α w α R + wv T
where
Rw = −r
R T v = −r̃
α = σ − r̃T R−1 r = σ + v T r = σ + r̃T w
(c)
7.4 Develop an order-recursive algorithm to solve the linear system in Example 7.1.2, using the lower right corner
partitioning lemma (7.1.26).
f f f
Using (7.1.26), and starting with m = 1, then R1 = 1, r1 = 1/2, and ρ 1 = 1. This leads to
−1
f f
a1 = − R1 r1 = −1/2
and
−1
f f fH f f
α 1 = ρ 1 − r1 R1 r1 = 3/4
−f
Using these results into (7.1.26) to find R2
−f 1 01H 1 1
R2 = −f + f [1 a1H ]
01 R1 α a1
1
1 0 4 1
= + [1 − 12 ]
0 1 3 − 1
4 2
− 23
= 3
− 23 4
3
Therefore
−1
f f
a2 = − R2 r2
4
− 23 1
= − 3 2
− 23 4 1
4 3 3
−9
=
− 19
Statistical and Adaptive Signal Processing - Solution Manual 157
and
−1
f f fH f f
α2 = ρ 2 − r2 R2 r2
f fH
= ρ 2 − r2 a2
4
−9
= 1 + [ 12 31 ]
− 19
= 20
27
−f
The desired solution is found using R3 and d3
− 20
9
−f
c3 = R3 d3 = 4
20
81
20
7.5 In this problem we consider two different approaches for inversion of symmetric and positive definite matrices by
constructing an arbitrary fourth-order positive definite correlation matrix R and comparing their computational
complexities.
(a) Given that the inverse of a lower (upper) triangular matrix is itself lower (upper) triangular, develop an
algorithm for triangular matrix inversion.
The Cholesky decomposition of the autocorrelation matrix is R = L D L H where L is lower triangular
and D is a diagonal matrix. Therefore the inverse of R is
R −1 = (L D L H )−1 = L −H D −1 L −1
7.6 Using the appropriate orthogonality principles and definitions, prove Equation (7.3.32)
f∗
The partial correlation E{emb (n − 1)em (n)} can be expanded using (7.3.39) as
E{emb (n − 1)(x ∗ (n) + xm∗ (n − 1)amH (n))} = E{emb (n − 1)x ∗ (n)}E{emb (n − 1)xm∗ (n − 1)}amH (n))
Using the fact that xm is orthogonal to em , the above equation can be simplified to
again using (7.3.39). The final step uses (7.3.2) and (7.3.26) to finish the proof
& '
∗ xm (n − 1) ∗
E{(bm (n − 1)xm (n − 1) + x(n − M − 1))x (n)} = E [bm (n − 1) 1]
H H
x (n)
x(n − M − 1)
& '
xm (n − 1) ∗
= [bm (n − 1) 1]E
H
x (n)
x(n − M − 1)
= [bmH (n − 1) 1]E{xm+1 (n − 1)x ∗ (n)}
f
r m (n)
= [bmH (n − 1) 1] f
rm+1 (n)
f∗ f f
Therefore, E{emb (n − 1)em (n)} = rm+1 (n) + bmH (n − 1)rm (n)
f fH
Pm+1 (n) = Pmf (n) + rm+1 (n)am+1 (n)
fH −1 f
= Pmf (n) − rm+1 (n)Rm+1 (n − 1)rm+1 (n)
Pmf (n) − rm+1 (n)L −1 −1 −1
fH f
= m+1 (n − 1)Dm+1 (n − 1)L m+1 (n − 1)rm+1 (n)
7.8 Working as in Example 6.3.1, develop an algorithm for the upper-lower decomposition of a symmetric positive
definite matrix. Then use it to factorize the matrix in Example 6.3.1, and verify your results, using the function
[U,D]=udut(R).
Statistical and Adaptive Signal Processing - Solution Manual 159
where ri j = r j i and ξ i > 0. If we perform the matrix multiplication on the right-hand side of (6.3.7) and
equate the matrix elements on the left and right sides, we obtain,
r11 = ξ 1 ⇒ ξ 1 = r11
r21
r21 = ξ 1 u 10 ⇒ u 10 =
ξ1
r22 = ξ 1 |u 10 | + ξ 2 ⇒ ξ 2 = r22 − ξ |u 10 |2
2
r31
r31 = ξ 1 u 20 ⇒ u 20 =
ξ1
r32 − ξ 1 u 20 u ∗10
r32 = ξ 1 u 20 u ∗10 + ξ 2 u 21 ⇒ u 21 =
ξ2
r33 = ξ 1 |u 20 | + ξ 2 |u 21 | + ξ 3 ⇒ ξ 3 = r33 − ξ 1 |u 20 |2 − ξ 2 |u 21 |2
2 2
r41
r41 = ξ 1 u 30 ⇒ u 30 =
ξ1
r42 − ξ 1 u 30 u ∗10
r42 = ξ 1 u 30 u ∗10 + ξ 2 u 31 ⇒ u 31 =
ξ2
r43 − ξ 1 u 30 u ∗20 − ξ 2 u 31 u ∗21
r43 = ξ 1 u 30 u ∗20 + ξ 2 u 31 u ∗21 + ξ 3 u 32 ⇒ u 32 =
ξ3
r44 = ξ 1 |u 30 | + ξ 2 |u 31 | + ξ 3 |u 32 | + ξ 4 ⇒ ξ 4 = r44 − ξ 1 |u 30 | − ξ 2 |u 31 |2 − ξ 3 |u 32 |2
2 2 2 2
This provides a row-by-row computation of the elements of the U H DU decomposition. Note that the compu-
tation of the next row does not change the already computed rows. This recursion can be continued for higher
order matrices.
7.9
H
7.9 In this problem we explore the meaning of the various quantities in the decomposition R = UD̄U of the
correlation matrix.
(a) Show that the rows of A = U−1 are the MMSE estimator of xm from xm+1 , xm+2 , . . . , x M .
H
(b) Show that the decomposition R = UD̄U can be obtained by the Gram-Schmidt orthogonalization pro-
cess, starting with the random variable x M and ending with x1 , that is, proceeding backward.
7.10 In this problem we clarify the various quantities and the form of the partitionings involved in the U DU H
decomposition, using an m = 4 correlation matrix.
(a) Prove that the components of the forward prediction error vector (7.3.65) are uncorrelated.
The forward prediction error vector is uncorrelated if it’s autocorrelation is a diagonal matrix. Using
(7.3.66)
e(n) = A(n)x(n)
160 Statistical and Adaptive Signal Processing - Solution Manual
with an autocorrelation of
R1 (n − 3) → R2 (n − 2) → R3 (n − 1) → R4 (n)
where R1 (n − 3) = Px (n − 3) and
fH
Px (n − 2) r1 (n − 2)
R2 (n − 2) = f
r1 (n − 2) R1 (n − 3)
fH
Px (n − 1) r2 (n − 1)
R3 (n − 1) = f
r2 (n − 1) R2 (n − 2)
fH
Px (n) r3 (n)
R4 (n) = f
r3 (n) R3 (n − 1)
a1 (n − 3) → a2 (n − 2) → a3 (n − 1) → a4 (n)
Using (7.3.64) and (7.3.65) the order-recursion for the FLP errors for m = 4 is
f f f f
e1 (n − 3) → e2 (n − 2) → e3 (n − 1) → e4 (n)
Statistical and Adaptive Signal Processing - Solution Manual 161
(c)
7.11 Given an all-zero lattice filter with coefficients k0 and k1 , determine the MSE P(k0 , k1 ) as a function of the
required second-order moments, assumed jointly stationary, and plot the error performance surface. Use the
statistics in Example 6.2.1
For an all-zero lattice filter, the estimate ŷ(n) is
where c1 = k0∗ + k0 k1∗ and c2 = k1∗ . Using the statistics from Example 6.2.1 (Py = 0.5, r11 = r22 = 4.5,
r12 = r21 = −0.1545, d1 = −0.5, and d2 = −0.1545), the MSE P(k0 , k1 ) is
7.12 Given the autocorrelation r(0) = 1,r(1) = r(2) = 12 , and r(3) = 14 , determine all possible representations for
the third-order prediction error filter (see Figure 7.7)
Given the autocorrelation, we need to find the forward predictor coefficients am and the latice parameters km .
Using Table 7.2, step (2a)
Therefore, the forward predictor coefficients am and the latice parameters km are
−7/12
am = −7/12
3/4
and
k0 = −1/2 k1 = −1/3 k2 = 3/4
Pm = Pm−1 (1 − |km−1 |2 )
P1 = P0 (1 − |k0 |2 )
= (27/64)(1 − |1/3|)2 = 3/8
P2 = P1 (1 − |k1 |2 )
= (3/8)(1 − |1/3|2 ) = 1/3
7.14 Use Levinson’s algorithm to solve the normal equations Rc = d where R =Toeplitz{3, 2, 1} and d = [6 6 2]T .
Using the Levinson algorithm (Table 7.3), starting with step 2
(a) r1 = [r(1)]
(b) β 1 = a1T Jr1∗ + r(2) = (−2/3)(2) + 1 = −1/3
(c)P1 = P0 + β 0 k0∗ = 3 + 2(−2/3) = 5/9
1/3
(d) k1 = −β 1 /P1 = = 3/5
5/9
a1 a1 −2/3 −2/3 −16/15
(e) a2 = + k1 = + (3/5) =
0 1 0 1 3/5
( f ) β c1 = −c1(1)r(1) + d2 = (2)(2) + 6 = 10
10
(g) k1c = β c1 /P1 = = 18
5/9
c1 J a1 −2 −2/3 −14
(h) c2 = + k1 =
c
+ (18) =
0 1 0 1 18
The last recursion for m = 2 repeats step 3 only for the optimum filter
2
( f ) β 2 = −c2 Jr(2) + d3 = −[−14 18]
c H
+ 2 = 12
1
β c2
(g) k2c = β c2 /P2 = = 33.75
P1 + β 1 k1
−14 3/5 6.25
c2 J a2
(h) c3 = + k2c = 18 + −16/15 (33.75) = −18.00
0 1
0 1 33.75
7.15 Consider a random sequence with autocorrelation {r(L)}30 = {1, 0.8, 0.6, 0.4}
f
(a) Determine the FLP am and the corresponding error Pm for m = 1, 2, 3.
Given the autocorrelation coefficients, the FLP and the corresponding errors can be found using Levinson-
Durbin algorithm (Table 7.2). Using Table 7.2, step (2a)
r(1)
k0 = − = −0.8, a1(1) = k0 = −0.8
r(0)
Statistical and Adaptive Signal Processing - Solution Manual 165
P3 = r(0)3m=1 (1 − |km−1 |2 )
(b) Determine and draw the flow diagram of the third-order lattice prediction error filter.
Figure 7.15 shows the third-order lattice prediction error filter where the lattice parameters are k0 = −0.8,
k1 = 0.1111, and k2 = 0.1248 which have been computed above in part (a).
7.16 Using the Levinson-Durbin algorithm, determine the third-order linear predictor a3 and the MMSE P3 for the
signal with autocorrelation r(0) = 1,r(1) = r(2) = 1/2, and r(3) = 1/4.
Given the autocorrelation coefficients, the FLP and the corresponding error can be found using Levinson-Durbin
algorithm (Table 7.2). Using Table 7.2, step (2a)
− − −
7.17 Given the autocorrelation sequence r(0) = 1,r(1) = r(2) = 1/2, and r(3) = 1/4, compute the lattice and
direct-form coefficients of the prediction error filter, using the algorithm of Schür.
Using Table 7.4 to help solve for the lattice coefficients km , starting with step 2
f
(a) ξ 0 (l) = ξ b0 (l) = r(l)
f
ξ 0 (1) −1/2
(b) k0 = − = = −1/2
ξ 0 (0)
b 1
(c) P1 = r(0)(1 − |k0 |2 ) = (1)(1 − |1/4|2 ) = 3/4
ξ f (m + 1)
(b) km = − m b
ξ m (m)
f
ξ (2) −1/4
k1 = − 1b = = −1/3
ξ 1 (1) 3/4
(c) Pm+1 = Pm (1 − |km |2 )
P2 = P1 (1 − |k1 |2 ) = 2/3
f
ξ (3) 1/12
(b) k2 = − 2b = = 1/8
ξ 2 (2) 2/3
(c) P2 = P1 (1 − |k1 |2 ) = (2/3)(1 − |1/8|2 ) = 21/32
Lastly, the output of the Schür algorithm is k0 = −1/2,k1 = −1/3,k2 = 1/8, and P3 = 21/32.
The direct-form coefficients can be found using (7.5.27)
∗
am−1 J am−1
am = + km−1
0 1
a1 = k0 = −1/2
−1/2 −1/2 −1/3
a2 = + (−1/3) =
0 1 −1/3
−1/3 −1/3 −3/8
a3 = −1/3 + −1/3 (1/8) = −3/8
0 1 1/8
168 Statistical and Adaptive Signal Processing - Solution Manual
detR < 1
1 ρ1 ρ2
ρ 1 1 ρ 1 < 1
ρ ρ 1
2 1
1 + 2ρ 21 ρ 2 − 2ρ 21 − ρ 22 < 1
(ρ 2 − 1)(2ρ 21 − ρ 2 − 1) < 1
ρ2 < 1
and
2ρ 21 − 1 < ρ 2
Combining the two yields 2ρ 21 − 1 < ρ 2 < 1 which is exactly the condition shown in (4.2.105).
7.19 An AR(2) model fit for a sinusoidal random-phase signal in additive noise with autocorrelation
(a) Model parameters a1(2) , a2(2) , and σ 2w in terms of P0 , ω0 , and σ 2v : The model parameters are given by the
normal equation
(2)
r(0) r(1) a1 r(1)
=−
r(1) r(0) a2(2) r(2)
or
P0 + σ 2v P0 cos ω0 a1(2) P0 cos ω0
=−
P0 cos ω0 P0 + σ 2v a2(2) P0 cos 2ω 0
Hence
P0 +σ 2v −P0 cos 2ω0
a1(2) −P0 (cos ω0 )
= P0 +2 P0 σ 2v +σ 4v −P02 cos2 ω0
2
a2(2) −P0
−P0 cos2 ω0 +P0 cos 2ω0 +(cos 2ω0 )σ 2v
P02 +2 P0 σ 2v +σ 4v −P02 cos2 ω0
Also
$ % r(1)
σ 2w = P0 + a1(2) a2(2)
r(2)
$ % P cos ω
P0 +σ 2v −P0 cos 2ω0 −P cos2 ω +P cos 2ω +(cos 2ω )σ 2
= P0 + −P0 (cos ω0 ) P02 +2 P0 σ 2v +σ 4v −P02 cos2 ω0
−P0 0 P 2 +2 0P σ 20+σ 4 −P0 2 cos2 ω 0 v
0 0
0P0 cos 2ω0
0 v v 0 0
−2P02 cos2 ω0 − P0 cos2 ω0 σ 2v + 2P02 cos2 ω0 cos 2ω0 − P02 cos2 2ω0 − P0 cos2 2ω0 σ 2v + P02 + 2P0 σ 2v +
= P0
P02 + 2P0 σ 2v + σ 4v − P02 cos2 ω0
Statistical and Adaptive Signal Processing - Solution Manual 169
and
−P0 cos2 ω0 + P0 cos 2ω 0 cos 2ω0 − cos2 ω0
a2(2) = −P0 = = 1 = k1
P02 − P02 cos2 ω0 (cos ω0 − 1) (cos ω0 + 1)
cos ω0
k0 = −P0 = − cos ω0
P0
and
−2P02 cos2 ω0 + 2P02 cos2 ω0 cos 2ω0 − P02 cos2 2ω0 + P02
σ 2w = P0
P02 − P02 cos2 ω0
(cos 2ω 0 − 1) − cos 2ω0 + 2 cos2 ω0 − 1
= P0 =0
− (cos ω0 − 1) (cos ω0 + 1)
7.20 Given the parameters r(0) = 1,k0 = k1 = 1/2, and k2 = 1/4, determine all other equivalent representations
of the prediction error filter (see Figure 7.7)
The forward predictor can be found directly using (7.5.27)
∗
am−1 J am−1
am = + km−1
0 1
a1 = k0 = 1/2
1/2 1/2
a2 = + (1/2)
0 1
3/4
=
1/2
3/4 1/2
a3 = 1/2 + 3/4 (1/4)
0 1
7/8
= 11/16
1/4
170 Statistical and Adaptive Signal Processing - Solution Manual
The autocorrelation can be found directly using (7.5.36) and using the fact that r(0) = P0 then for m = 0
r(1) = −k0∗ P0 = −(1/2)(1) = −1/2
For m = 2
r(2) = −k1∗ P1 − a1(1)∗r(1) = −(1/2)(3/4) − (1/2)(−1/2) = −1/8
where
P1 = P0 (1 − |k0 |2 ) = (1)(1 − |1/2|2 ) = 3/4
Finally, for m = 2
r(3) = −k2∗ P2 − [a1(2)∗r(2) + k1∗r(1)]
= −(1/4)(3/4)2 − [(3/4)(−1/8) + (1/2)(−1/2)
= 5/16
where
P2 = P1 (1 − |k1 |2 ) = (3/4)(1 − |1/2|2 ) = (3/4)2
Therefore the autocorrelation is r(0) = 1, r(1) = −1/2, r(2) = −1/8, and r(3) = 5/16
7.21 Let {r(l)}0P be samples of the autocorrelation sequence of a stationary random signal x(n)
(a) Is it possible to extend r(l) for |l| > P so the the PSD
∞
R(e j ω ) = r(l)e− j ωl
l=−∞
(c) Use the algorithm in part (b) to find the necessary and sufficient conditions so that r(0) = 1, r(1) = ρ 1 ,
and r(2) = ρ 2 are a valid autocorrelation sequence. Is the resulting extension unique?
Using the algorithm from step (b) above
β 1 = a1T Jr1∗ + r ∗ (2) = ρ 2 − ρ 21
where a1(1) = −r(1)/r(0) and with P1 = P0 + β 0 k0 = r(0) + r(1) −r(1)
r(0)
then for m = 0
r(1) = −k0∗ P0 = −(1/4)(4/3) = −1/3
For m = 2
r(2) = −k1∗ P1 − a1(1)∗r(1) = −(1/2)(5/4) + (1/4)(1/3) = −13/24
where
P1 = P0 (1 − |k0 |2 ) = (4/3)(1 − |1/4|2 ) = 5/4
Finally, for m = 2
r(3) = −k2∗ P2 − [a1(2)∗r(2) + k1∗r(1)]
= −(1/4)(15/16) − [(3/8)(−13/24) + (1/2)(−1/3)
= 13/96
where
P2 = P1 (1 − |k1 |2 ) = (5/4)(1 − |1/2|2 ) = 15/16
Therefore the autocorrelation is r(0) = 4/3, r(1) = −1/3, r(2) = −13/24, and r(3) = 13/96
Statistical and Adaptive Signal Processing - Solution Manual 173
(c) Determine the value r(4) so that the MMSE P4 for the corresponding fourth-order filter is the minimum
possible.
The autocorrelation extension formula (7.5.36)
r(m + 1) = −km∗ Pm − amH J rm
can be used to compute the next autocorrelation value. Since the value of k3 is not set, an infinite number
of possible values can be used provided that |k3 | < 1, therefore insuring that R is positive definite.
(a) Show that the values of r(m) such that Rm+1 is positive definite determine a disk in the complex plane.
Find the center α m and the radius ζ m of the disk
Figure similar to 6.3 in Haykin
If Rm is positive definite, then the necessary and sufficient condition for Rm+1 to be positive definite is
r(m + 1) = −km∗ Pm − amH Jrm
for any value of km such that |km | < 1. This establishes a circular region in the Real plane of possible
values for r(m + 1), with the circle centered at {Re[amH Jrm ],Im[amH Jrm ]} and a maximum radius of Pm .
174 Statistical and Adaptive Signal Processing - Solution Manual
∞
(b) By induction show that there are infinitely many extension of {r(l)}m−1
−m+1 that make {r(l)}−∞ a valid
autocorrelation sequence.
Any choice of |km | < 1 provides a valid r(m + 1). Hence, there are infinitely many extensions.
7.28 Consider the MA(1) sequence x(n) = w(n) + d1 w(n − 1), w(n) ∼ WN(0, σ 2w ). Then
r(0) = σ 2w 1 + |d1 |2 , r(1) = r ∗ (−1) = d1 σ 2w , and r(l) = 0, |l| > 0 (1)
and
r(0) r(1) 0 ··· 0 0
r ∗ (1) r(0) r(1) · · · 0 0
.
0
r ∗ (1) r(0) . . 0 0
Rm = . .. .. .. .. .. (2)
.. . . . . .
..
0 0 0 . r(0) r(1)
0 0 0 ··· r ∗ (1) r(0)
where the first determinant is of (m − 1) × (m − 1) matrix Rm−1 and the second determinant is of
(m − 2) × (m − 2) matrix Rm−2 . Hence
Hence
r(0) r(1) 0 ··· 0 −r(1)
r ∗ (1) r(0) r(1) · · · 0 0
.
0
r ∗ (1) r(0) . . 0 0
det . .. .. .. .. ..
.. . . . . .
..
0 0 0 . r(0) 0
0 0 0 ··· r ∗ (1) 0 −r m (1)
km = = (4)
det Rm det Rm
Dividing both sides of (3) by −r m (1), we obtain
det Rm r(0) det Rm−1 det Rm−2
= − |r(1)|2
−r m (1) −r (1)
m −r m (1)
1 r(0) det Rm−1 r(1)r ∗ (1) det Rm−2
= − −
km −r(1) −r m−1 (1) r(1)r(1) −r m−2 (1)
∗
1 r(0) 1 r (1) 1
= − − (5)
km −r(1) km−1 r(1) km−2
(c) Determine the initial conditions and solve the recursion in (b) to show that
(1 − |d1 |2 )(−d1 )m
km =
1 − |d1 |2m+2
which tends to zero as m → ∞.
Note that (5) which is a difference equation in p(m) , 1
km+3
, m ≥ 0 with initial conditions (see Prob-
lem 4.25)
1 1 + |d1 |2 1 1 + |d1 |6
p(−2) = = and p(−1) = = −
(6)
k1 (−d1 ) k2 1 − |d1 |2 (−d1 )2
Using unilateral z-transform along with (6) with fair amount of algebra, we obtain
(1 − |d1 |2 )(−d1 )m
km =
1 − |d1 |2m+2
which tends to zero as m → ∞ since |d1 | < 1.
From (7.6.5)
J r̃∗m (m − l − 1) = J r ∗ (m − l − 1) r ∗ (m − l − 2) · · · r ∗ (−l)
= J r(l − m + 1) r(l − m + 2) · · · r(l)
= r(l) r(l − 1) · · · r(l − m + 1) = r̃m (l) (3)
176 Statistical and Adaptive Signal Processing - Solution Manual
ξ − ξ − ξ
− −
− −
− −
ξ − − ξ − − ξ
− −
Figure 7.30: Flow diagram of the lattice filter with the lattice parameters
7.30 In this problem we show that the lattice parameters can be obtained by "feeding" the autocorrelation sequence
through the lattice filter as a signal and switching on the stages one by one after the required lattice coefficient
is computed. The value of km is computed at time n = m from the inputs to stage m.
(a) Using (7.6.10), draw the flow diagram of a third-order lattice filter that implements this algorithm.
Figure 7.30 shows the flow diagram of the lattice filter with the lattice parameter computed per
ξ mf (l)
km = − (1)
ξ bm (m)
(b) Using the autocorrelation sequence in Example 7.6.1, "feed" the sequence {r(n)}30 = {3, 2, 1, 12 } through
the filter one sample at a time, and compute the lattice parameters. H int : Use Example 7.6.1 for
guidance.
Using (7.6.10)
f
ξ 0 (l) = ξ b0 (l) = r(l)
f ∗
ξ mf (l) = ξ m−1 (l) + km−1 ξ bm−1 (l − 1)
f
ξ bm (l) = ξ bm−1 (l − 1) + km−1 ξ m−1 (l)
and the flow diagram above, the lattice parameters can be computed using the autocorrelation as the input.
For each instance in time, the lattice has a number of stages equal to the time index starting with time
f
equal zero. With l = 0, the first stage is ξ 0 (0) = ξ b0 (0) = r(0) = 3. The second stage is computed with
l = 1 and r(1) = 2 as the input, with the following output
f
ξ 0 (1) = ξ b0 (1) = r(1) = 2
f
−ξ 0 (1)
k0 = = −2/3
ξ b0 (0)
f
ξ b1 (1) = ξ b0 (0) + k0 ξ 0 (1) = 3 + (−2/3)(2) = 5/3
Statistical and Adaptive Signal Processing - Solution Manual 177
f
ξ b1 (2) = ξ b0 (1) + k0 ξ 0 (2) = 2 + (−2/3)(1) = 4/3
f
ξ 1 (2) −1/3
k1 = − =− = 1/5
ξ 1 (1)
b 4/3
f
ξ b2 (2) = ξ b1 (1) + k1 ξ 1 (2) = 5/3 + (1/5)(−1/3) = 8/5
and the last lattice parameter is computed with l = 3 and r(3) = 1/2
f
ξ 0 (3) = ξ b0 (3) = r(3) = 1/2
ξ 1 (3) = ξ 0 (3) + k0∗ ξ b0 (2) = 1/2 + (−2/3)(1) = −1/6
f f
f
ξ 2 (3) 1/10
k2 = − =− = −1/16
ξ 2 (2)
b 8/5
7.31 Draw the superlattice structure for M = 8, and show how it can be partitioned to distribute the computations
to three processors for parallel execution.
Figure 7.31 shows the superlattice structure, and a partition of computations for three parallel processors.
ξ c0 (0) = d1
ξ c0 (1) = d2
ξ c0 (2) = d3
ξ c0 (3) = d4
ξ b0 (0) = r(0)
ξ b0 (1) = r(1)
ξ b0 (2) = r(2)
ξ b0 (3) = r(3)
−ξ c0 (0)
k0c =
ξ b0 (0)
178 Statistical and Adaptive Signal Processing - Solution Manual
ξ
ξ
ξ
ξ
ξ
ξ
ξ
ξ
ξ
ξ
ξ
ξ
ξ
ξ
ξ
ξ
ξ
ξ
ξ
ξ
ξ
ξ
ξ
ξ
ξ
ξ
ξ ξ
ξ
ξ
and
−ξ c3 (3)
k3c =
ξ b3 (3)
7.33 Extend the algorithm of Schür to compute the LDL H decomposition of a Hermitian Toeplitz matrix, and write
a Matlab function for its implementation.
The L D L H decomposition of a Hermitian Toeplitz matrix can be accomplished using (7.7.12)
1 0 ··· 0 0
ξ̄ b (1) ··· 0
0 1 0
b b
−1
L=B = 0 ξ̄ (2) ξ̄ (1) · · · 0 0
1
.. .. .. .. ..
. . . . .
b b b
ξ̄ 0 (M) ξ̄ 1 (M) · · · ξ̄ M−1 (M) 1
b ξ bm (l) ξ bm (l)
where ξ̄ m (l) = ξ bm (m)
= Pm
and D =diag{P0 , P1 , . . . , PM }.
7.34 Given the matrix R3 =Toeplitz{1, 1/2, 1/2}, use the appropriate order-recursive algorithms to compute the
following:
where L m+1 and Dm+1 are generated from L m and Dm using (7.1.37)
Lm 0 Dm 0
L m+1 = D =
lmH 1 m+1
0 H ξ m+1
and ξ m+1 =detRm+1 /detRm . The vector lm can be found by solving (7.1.39)
(L m Dm )lm = rmb
where bm is computed as shown in part (c) below. Also Dm =diag{P0b , P1b , . . . , Pm−1
b
}, where Pmb is
The above algorithm is repeated for m = 2, with r2b = [1/2 1/2]T and ρ b2 = 1
−1 b 4/3 −1/2 1/2 −1/3
b2 = −R2 r2 = − =
−1/2 4/3 1/2 −1/3
−1/3
α b2 = ρ b2 + r2b H b2 = 1 + [1/2 1/2] = 2/3
−1/3
−1
−1 R2 02 1 b2
R3 = + b [b2H 1]
02H 0 α2 1
7/3 −2/3 0 −1/3
3
= −2/3 4/3 0 + −1/3 [−1/3 − 1/3 1]
2
0 0 0 1
3/2 −1/2 −1/2
= −1/2 3/2 −1/2
−1/2 −1/2 3/2
7.35 Consider the AR(1) process x(n) = ρx(n − 1) + w(n), where w(n) ∼ WN(0, σ 2w ) and −1 < ρ < 1. The
z-domain PSD of x(n) is given by
σ 2w 1
Rx (z) =
; < |z| < |ρ| , −1 < ρ < 1
(1 − ρ z) 1 − ρ z −1 |ρ|
σ 2w
and the correlation sequence is given by r x (l) = ρ |l| .
1 − ρ2
(a) Determine the correlation matrix R M+1 of the process.
For an arbitrary value of M, we have
1 ρ ρ2 ··· ρM
ρ 1 ρ ··· ρ M−1
ρ2 ρ ··· ρ M−2
R M+1 = 1
.. .. .. .. ..
. . . . .
ρM ρ M−1 ρ M−2 · · · 1
182 Statistical and Adaptive Signal Processing - Solution Manual
7.36 If r(l) = cos ω0l, determine the second-order prediction error filter and check whether it is minimum-phase.
The second-order forward prediction error filter is given by
where prediction error filter coefficients are given by R a = −r, that is,
r(0) r(1) a1 r(1)
=−
r(1) r(0) a2 r(2)
or
1 cos ω0 a1 cos ω0
=−
cos ω0 1 a2 cos 2ω0
Statistical and Adaptive Signal Processing - Solution Manual 183
or
cos ω0 ω0
a1 cos2 ω0 −1
− coscos
2 ω −1 cos 2ω 0 −2 cos ω0
= 0
=
− coscos2 ωω0 −1
2
a2 0
+ cos2 1ω0 −1 cos 2ω0 1
Develop a recursion that computes a(D+1) from a(D) by exploring the shift invariance of the vector r(D).
We want to determine a(D+1) (which is otherwise obtained from R a(D+1) , −r(D+1) ) directly from a(D). We
will use subscripts to denote the size of a matrix or vector. Consider the partitioning
r(D) r(D)
r(D + 1) r(D + 1)
(D)
RM aM = − .. = .. (1)
. .
r(D + M − 1) r(D + M − 1)
184 Statistical and Adaptive Signal Processing - Solution Manual
and
r(D + 1)
..
.
R M a(D+1) = − (2)
M
r(D + M − 1)
r(D + M)
Premultiplying by J
r(D + M − 1)
..
.
R M J a(D) = − (3)
M
r(D + 1)
r(D)
7.38 The normal equations for the optimum symmetric signal smoother (see Section 6.5.1) can be written as
0
R2m+1 c2m+1 = P2m+1
0
where P2m+1 is the MMSE, c2m+1 = Jc∗2m+1 , and cm(2m+1) = 1. (a) Using a “central” partitioning of R2m+3
and the persymmetry property of Toeplitz matrices, develop a recursion to determine c2m+3 from c2m+1 . (b)
Develop a complete order-recursive algorithm for the computation of {c2m+1 , P2m+1 }0M (see Kok et al. 1993).
7.39 Using the triangular decomposition of a Toeplitz correlation matrix, show that
(a) the forward prediction errors of various orders and at the same time instant, that is,
ef (n) = [e0f (n) e1f (n) · · · emf (n)]T
are correlated.
m
Using the definition of ekf (n) k=0 , we obntain
1 0 0 ··· 0 x(n)
1 a1(1)∗ 0 ··· 0 x(n − 1)
1 a (2)∗ a (2)∗ · · ·
e (n) =
f
1 2 0 x(n − 2) , Ā M+1 x M+1 (n)
. . .. .. .. ..
.. .
. . . . .
1 a1(M)∗ a2(M)∗ · · · a (M)∗
M
x(n − M)
Hence
E ef (n)efH (n) = Ā M+1 E x M+1 (n)x M+1 (n) ĀHM+1 = Ā M+1 R M+1 ĀHM+1
which, in general, is not a diagonal matrix. Hence components of ef (n) are correlated.
(b) the forward prediction errors
ēf (n) = [efM (n) efM−1 (n − 1) · · · e0f (n − M)]T
are uncorrelated.
Using (7.3.66)
ēf (n) = A M+1 x M+1 (n)
Hence
E ēf (n)ēfH (n) = A M+1 E x M+1 (n)x M+1 (n) AHM+1 = A M+1 R M+1 AHM+1
where
1 a1(M)∗ a2(M)∗ ··· a (M)∗
M
0 1 a1(M−1)∗ ··· a (M−1)∗
M−1
··· a (M−2)∗
A M+1 = 0 0 1
.. .. .. ..
M−2
..
. . . . .
0 0 0 ··· 1
186 Statistical and Adaptive Signal Processing - Solution Manual
7.40 Generalize the inversion algorithm described in Section 7.7.3 to handle Hermitian Toeplitz matrices.
R M−1 Q M−1 q
Given: R M = , Determine: Q M =
rH ρ qH q
where
1 1
q = −1
, , b = −R−1
M−1 r
ρ − r R M−1 r
H ρ + r Hb
q = − R−1
M−1 r q = bq
Q M−1 = R−1
M−1 + qbb
H
Let P = 1/q which gives q = b/P, b = q P and Q M−1 = R−1 M−1 + Pqq or
H
< =
Q M−1 i j = R−1 ∗
M−1 i j + Pqi q j (1)
−1
∗
Using the fact that R M−1 is Hermitian Toeplitz, that is, JR M−1 J = R∗M−1 or R−1
M−1 = J R M−1 J (Per-
Hermitian), we obtain
< −1 = < −1 = ∗
R M−1 = R M−1 M− j,M−i
Substituting in (1)
< = ∗
Q M−1 i j = R−1
M−1 M− j,M−i
+ Pqi q∗j (2)
or
< = ∗
Q M−1 i j = Q−1
M−1 M− j,M−i
+ P qi q∗j − q∗M− j q M−i
function Q = invtoeplC(r,M)
% Computes inverse of a Hermitian Toeplitz matrix R
% Q = invtoeplC(r,M)
% Input: First column of Hermitian Toeplitz matrix R
% r(m), 0 <= m <= M-1
Statistical and Adaptive Signal Processing - Solution Manual 187
M = length(r);
% Determine P and q
P = r(1) + (conj(r(M:-1:2)))’*b;
q = b/P;
Mend = ceil((M+1)/2);
for j = M-1:-1:Mend
for i = (M-j+1):1:j
% Use eq. (7.7.24)
Q(i,j) = conj(Q(M-j,M-i)) - P*(conj(q(M-j))*q(M-i)-q(i)*conj(q(j)));
end
% Perform symmetry and persymmetry operations
QM = sympersymC(QM,Q((M-j+1):1:j,j));
Q = QM(1:M-1,1:M-1);
end
Q = QM;
7.41 Consider the estimation of a constant α from its noisy observations. The signal and observation models are
188 Statistical and Adaptive Signal Processing - Solution Manual
given by
y(n + 1) = y(n) n>0 y(0) = α
x(n) = y(n) + v(n) v(n) ∼ WGN(0, σ 2v )
(a) Develop scalar Kalman filter equations, assuming the initial condition on the a posteriori error variance
R ỹ (0|0) equal to r0 .
Signal model:
Observation model:
Signal Prediction:
Signal filter:
ŷ(n|n) = ŷ(n|n − 1) + K (n) x(n) − H ŷ(n|n − 1)
= ŷ(n|n − 1) + K (n) x(n) − ŷ(n|n − 1)
Kalman gain:
−1
K (n) = R ỹ (n|n − 1)H R ỹ (n|n − 1) + Rv (n)
R ỹ (n|n − 1) R ỹ (n|n − 1)
= =
R ỹ (n|n − 1) + Rv (n) R ỹ (n|n − 1) + σ 2v
A-posteriori error covariance:
Thus for n = 1:
r0
r0 σ 2v r0
K (1) = = , R ỹ (1|1) =
r0 + σ v
2 1 + σr02 1 + σr02
v v
n = 2:
r0
r0 σ 2v r0
K (2) = = , R ỹ (2|2) =
2r0 + σ v
2 1 + 2 σr02 1 + 2 σr02
v v
Hence
r0
r0 σ 2v r0
K (n) = = , R ỹ (n|n) =
nr0 + σ 2v 1 + n σr02 1 + n σr02
v v
(c) Show that the optimal filter for the estimation of the constant α is given by
r0 /σ 2v
ŷ(n) = ŷ(n − 1) + [x(n) − ŷ(n − 1)]
1 + (r0 /σ 2v )n
Using K (n) from the above part we obtain the desired result.
(a) Using Matlab, plot the PSD Rs (e j ω ) and determine the resonant frequency ω0 .
% Given PSD
w = [0:1:500]*pi/500;
Rs = 4./(2.4661-1.629*cos(w)+0.81*cos(2*w));
Hf_1 = figure(’units’,SCRUN,’position’,SCRPOS,...
’paperunits’,PAPUN,’paperposition’,[0,0,5,3],...
’numbertitle’,’off’,’name’,’P0742a’);
plot(w/pi,Rs,’g’,’linewidth’,1.5); hold on; axis([0,1,0,3.5]);
plot([w_max,w_max]/pi,[0,maxRs],’r:’,[w_max/pi],[maxRs],’md’);
xlabel(’Digital frequency in \pi units’,’fontsize’,8);
ylabel(’{\itR}_{\its}( e^{j\omega} )’,’fontsize’,8);
title(’Power Spetral Density’,’fontsize’,10,’fontweight’,’bold’);
text(w_max/pi+0.02,0.5,[’Resonant frequency: ’,num2str(w_max),’ radians’]);
The plot is shown in Figure 7.42a.
(b) Using spectral factorization, develop a signal model for the process of the form
where y(n) is a 2 × 1 vector, η(n) ∼ WGN(0, 1), and A and B are matrices with appropriate dimensions.
190 Statistical and Adaptive Signal Processing - Solution Manual
2.5
2
Rs( ejω )
1.5
0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Digital frequency in π units
4
Rs (z) = −1 2 +z −2
2.4661 − 1.629 z+z2 + 0.81 z 2
40000z 2
=
4050z 4 − 8145z 3 + 24661z 2 −8145z
+ 4050
3.1427 3.1427
=
1 − 0.3158z −1 + 0.1863z −2 z 2 − 1.6953z + 5.3674
Thus the AR model is
y(n)
s(n) = y(n) = 1 0
y(n − 1)
, H y(n)
% Verification
if 0
N = 8192; eta = randn(N,1);
sn = filter(b,a_in,eta);
Nfft = 512; L = 16; w_ham = hamming(L)’; Fs = 1;
Rs_hat = psd(sn,Nfft,Fs,w_ham,L/2,’none’);
figure;
w = [0:1:Nfft/2]*Fs/Nfft; plot(w,Rs_hat); axis([0,Fs/2,0,18]);
end
(c) Let x(n) be the observed values of s(n) given by
Assuming reasonable initial conditions, develop Kalman filter equations and implement them, using
Matlab. Study the performance of the filter by simulating a few sample functions of the signal process
s(n) and its observation x(n).
% (c) Simulation
% Design KF parameters
A = [-a(2),-a(3);1,0]; B = [b;0];
H = [h1,h2]; G = g1;
Rv = g1*g1; R_eta = eye(1);
% Initialization
y_post = [0;0]; R_post = zeros(2); I = eye(2);
y_hat = zeros(N+1,1); gain = zeros(N+1,2); mse = y_hat;
% Tracking
for n = 0:N
R_pri = A*R_post*A’ + B*R_eta*B’;
y_pri = A*y_post;
192 Statistical and Adaptive Signal Processing - Solution Manual
x_pri = H*y_pri;
Rw = H*R_pri*H’+Rv;
K = R_pri*H’*inv(Rw);
y_post = y_pri + K*(xn(n+1) - x_pri);
R_post = (I-K*H)*R_pri;
y_hat(n+1) = y_post(2);
gain(n+1,:) = K’;
mse(n+1) = R_post(1,1);
end
y_hat = [y_hat(2:N+1);y_hat(N+1)];
error = yn - y_hat; e_std = std(error);
out_snr = 20*log10(y_std/e_std)
%Plots
Hf_2 = figure(’units’,SCRUN,’position’,SCRPOS,...
’paperunits’,PAPUN,’paperposition’,[0,0,5,3],...
’numbertitle’,’off’,’name’,’P0742c1’);
n = 0:N;
plot(n,yn,’g’,n,xn,’w:’,n,y_hat,’c--’,’linewidth’,1);
ylabel(’Amplitude’,’fontsize’,8,’fontname’,’Helv’);
xlabel(’n’,’fontsize’,8,’fontname’,’Helv’);
legend(’y(n)’,’x(n)’,’yhat(n)’,0);
set(gca,’xtick’,[0:20:N],’ytick’,[-10:5:10],’fontname’,’times’,’fontsize’,6);
title(’Estimation of AR(2) Process’,’fontname’,’Helv’,’Fontsize’,10);
Hf_3 = figure(’units’,SCRUN,’position’,SCRPOS,...
’paperunits’,PAPUN,’paperposition’,[0,0,4,3],...
’numbertitle’,’off’,’name’,’P0742c2’);
subplot(2,1,1);
plot(n,gain(:,1),’g’,n,gain(:,2),’r--’,’linewidth’,1); axis([0,N,0,.1]);
legend(’K_1(n)’,’K_2(n)’,0);
ylabel(’Gains’,’fontsize’,8,’fontname’,’Helv’);
set(gca,’xtick’,[0:20:N],’ytick’,[0,0.1],’fontname’,’symbol’,’fontsize’,6);
title(’Kalman Gain Values’,’fontname’,’Helv’,’Fontsize’,10);
subplot(2,1,2);
plot(n,mse,’g’,’linewidth’,1); axis([0,N,0,1]);
ylabel(’MSE’,’fontsize’,8,’fontname’,’Helv’);
set(gca,’xtick’,[0:20:N],’ytick’,[0,1],’fontname’,’symbol’,’fontsize’,6);
title(’Mean Squared Error’,’fontname’,’Helv’,’Fontsize’,10);
xlabel(’n’,’fontsize’,8,’fontname’,’Helv’);
The plots are shown in Figures 7.42c1 and 7.42c2.
7.43 Alternative form of the Kalman filter. A number of different identities and expressions can be obtained for the
quantities defining the Kalman filter.
Statistical and Adaptive Signal Processing - Solution Manual 193
5
Amplitude
−5
−10
0 20 40 60 80 100
n
0
0 20 40 60 80 100
0
0 20 40 60 80 100
n
where K(n) = R ỹ (n|n − 1)HH (n)Rw−1 (n). Substituting K(n) in the above equation
R ỹ (n|n) = I − R ỹ (n|n − 1)HH (n)Rw−1 (n)H(n) R ỹ (n|n − 1)
= R ỹ (n|n − 1) − R ỹ (n|n − 1)HH (n)Rw−1 (n)H(n)R ỹ (n|n − 1)
Now substituting Rw (n) = H(n)R ỹ (n|n − 1)H H (n) + Rv (n) from (7.8.29) we obtain the desired result.
(b) If the inverses of R ỹ (n|n), R ỹ (n|n − 1), and Rv exist, then show that
R−1 −1 −1
ỹ (n|n) = R ỹ (n|n − 1) + H (n)Rv (n)H(n)
H
(2)
Consider
−1
R−1 −1
ỹ (n|n) = R ỹ (n|n − 1) − R ỹ (n|n − 1)H (n)Rw (n)H(n)R ỹ (n|n − 1)
H
we obtain
−1 −1
R−1 −1
ỹ (n|n) = R ỹ (n|n − 1) + H (n)Rw (n)H
−H
(n) − R ỹ (n|n − 1)
This shows that the update of the error covariance matrix does not require the Kalman gain matrix (but
does require matrix inverses).
(c) Finally show that the gain matrix is given by
I = R ỹ (n|n)R−1 −1
ỹ (n|n − 1) + R ỹ (n|n)H (n)Rv (n)H (n)
H 1
Postmultiplying by R ỹ (n|n − 1)
7.44 In Example 7.8.3 we assumed that only the position measurements were available for estimation. In this
problem we will assume that we also have a noisy sensor to measure velocity measurements. Hence the
observation model is
xp (n) yp (n) + v1 (n)
x(n) , = (1)
xv (n) yv (n) + v2 (n)
where v1 (n) and v2 (n) are two independent zero-mean white Gaussian noise sources with variances σ 2v1 and
σ 2v2 , respectively.
(a) Using the state vector model given in Example 7.8.3 and the observation model in (1), develop Kalman
filter equations to estimate position and velocity of the object at each n.
The vector state equations are:
2
yp (n) 1 T yp (n − 1) T /2
= + η(n)
yv (n) 0 1 yv (n − 1) T
y(n) , A y(n − 1) + B η(n)
simulate the true and observed positions and velocities of the object. Using your Kalman filter equations,
generate plots similar to the ones given in Figures 7.14 and 7.15.
% Target and sensor models
T = 0.1;
A = [1 T; 0 1]; % PHI
B = [T*T/2; T]; % G
vareta =0.25;
H = eye(2);
D = eye(2);
varv1 = 0.25;
varv2 = 0.25;
Rv = diag([varv1,varv2]);
v1 = sqrt(varv1)*randn(1,Nt);
v2 = sqrt(varv2)*randn(1,Nt);
v = zeros(2,1,Nt); v(1,1,:) = v1(:); v(2,1,:) = v2(:);
for n = 1:Nt
x(1:2,1,n) = H*y(1:2,1,n) + D*v(1:2,1,n);
end
% A-priori estimates
yhat_ini = [0;0];
R_y = 2*eye(2,2);
% Kalman Filter
[y_hat,GainK,Re_pre,Re_post] = skf(A,B,vareta,H,D,Rv,x,yhat_ini,R_y);
% Plotting
Hf_1 = figure(’units’,SCRUN,’position’,SCRPOS,...
’paperunits’,PAPUN,’paperposition’,papos);
subplot(2,1,1);
plot(time,yp,’g’,time,xp,’r:’,time,yp_hat,’m--’);
axis([time(1),time(end),-5,15]);
ylabel(’Position (meters)’,’fontsize’,8);
title(’True, Noisy, and Estimated Positions’,’fontsize’,10);
legend(’True’,’Noisy’,’Estimate’,4);
set(gca,’xtick’,[0:2:10],’fontsize’,6)
set(gca,’ytickmode’,’auto’,’fontsize’,6);
subplot(2,1,2);
plot(time,yv,’g’,time,xv,’r:’,time,yv_hat,’m--’);
axis([0,10,-3,3]);
xlabel(’t (sec)’,’fontsize’,8); ylabel(’velocity (m/sec)’,’fontsize’,8);
legend(’True’,’Noisy’,’Estimate’,4);
title(’True, Noisy, and Estimated Velocities’,’fontsize’,10);
Statistical and Adaptive Signal Processing - Solution Manual 197
set(gca,’xtick’,[0:2:10],’fontsize’,6);
set(gca,’ytickmode’,’auto’,’fontsize’,6);
Hf_2 = figure(’units’,SCRUN,’position’,SCRPOS,...
’paperunits’,PAPUN,’paperposition’,papos);
subplot(2,1,1);
H_kg = plot(time(2:end),Kg1,’go’,time(2:end),Kg2,’rd’);
set(H_kg,’markersize’,3); axis([0,10,0,1]);
title(’Kalman gain components’,’fontsize’,10);
legend(’K_p’,’K_v’,1);xlabel(’t (sec)’,’fontsize’,8);
set(gca,’xtickmode’,’auto’,’fontsize’,6);
set(gca,’ytick’,[0:0.2:1],’fontsize’,6);
set(gca,’yticklabel’,[’0.0’;’0.2’;’0.4’;’0.6’;’0.8’;’1.0’]);
subplot(2,2,3);
H_pt1 = plot(time(2:41),Rpre(1:40),’ro’,time(2:41),Rpost(1:40),’gd’);
set(H_pt1,’markersize’,3);
legend(’a-priori’,’a-posteriori’,1);xlabel(’t (sec)’,’fontsize’,8);
axis([0,4.0,0,1]);xlabel(’t (sec)’,’fontsize’,8);
%subplot(2,2,3), plot(time,tPm,’.’,time,tP,’g.’)
title(’Trace of covariance matrix’,’fontsize’,10);
set(gca,’xtickmode’,’auto’,’fontsize’,6);
set(gca,’ytick’,[0:0.5:1],’fontsize’,6);
subplot(2,2,4);
H_pt2 = plot(time(61:72),Rpre(60:71),’ro’,time(61:72),Rpost(60:71),’gd’);
set(H_pt2,’markersize’,3); hold on;
timenew = [1;1]*time(61:72); timenew = (timenew(:))’;
tpmtp = zeros(1,23);
tpmtp(1:2:23) = Rpre(60:71); tpmtp(2:2:24) = Rpost(60:71);
plot(timenew,tpmtp,’w:’); hold off;
legend(’a-priori’,’a-posteriori’,1);xlabel(’t (sec)’,’fontsize’,8);
axis([5.95,7.05,0.04,0.05]);
xlabel(’t (sec)’,’fontsize’,8);
title(’Trace of covariance matrix’,’fontsize’,10);
set(gca,’xtick’,[6,7],’fontsize’,6);
set(gca,’ytick’,[0.04:0.005:0.05],’fontsize’,6);
The plots are shown in Figures 7.44b1 and 7.44b2.
(c) Discuss the effects of velocity measurements on the estimates.
Clearly, the velocity estimates follow the true velocity values. The error is due to noisy observations.
7.45 In this problem, we will assume that the acceleration ya (n) is an AR(1) process rather than a white noise
process. Let ya (n) be given by
(a) Augment the state vector y(n) in (7.8.48), using variable ya (n), and develop the state vector as well as
the observation model, assuming that only the position is measured.
198 Statistical and Adaptive Signal Processing - Solution Manual
10
Position (meters)
0
True
Noisy
Estimate
−5
0 2 4 6 8 10
2
velocity (m/sec)
−1
True
−2 Noisy
Estimate
−3
0 2 4 6 8 10
t (sec)
0.6
0.4
0.2
0.0
0 1 2 3 4 5 6 7 8 9 10
t (sec)
0.5 0.045
0 0.04
0 1 2 3 4 6 7
t (sec) t (sec)
simulate the linear motion of the object. Using Kalman filter equations, estimate the position, velocity,
and acceleration values of the object at each n. Generate performance plots similar to the ones given in
Figures 7.14 and 7.15.
%% (b) AR(1) model for acceleration and observation of position
% Target and sensor models
T = 0.1; alpha = 0.9;
v1 = stdv*randn(1,Nt);
200 Statistical and Adaptive Signal Processing - Solution Manual
% A-priori estimates
yhat_ini = zeros(K,1); %[0;0;0];
R_y = 2*eye(K);
% Kalman Filter
[y_hat,GainK,Re_pre,Re_post] = skf(A,B,vareta,H,D,Rv,x,yhat_ini,R_y);
for n = 1:Nt
Rpre(n) = trace(Re_pre(:,:,n));
Rpost(n) = trace(Re_post(:,:,n));
end
% Plotting
Hf_1 = figure(’units’,SCRUN,’position’,SCRPOS,...
’paperunits’,PAPUN,’paperposition’,papos);
xaxismin = time(1); xaxismax = time(end);
subplot(3,1,1);
plot(time,yp,’g’,time,xp,’r:’,time,yp_hat,’m--’);
yaxismin = floor(min(min([yp,xp,yp_hat]))/5)*5;
yaxismax = ceil(max(max([yp,xp,yp_hat]))/5)*5;
axis([xaxismin,xaxismax,yaxismin,yaxismax]);
ylabel(’Position (meters)’,’fontsize’,8);
title(’True, Noisy, and Estimated Positions’,’fontsize’,10);
legend(’True’,’Noisy’,’Estimate’,4);
set(gca,’xtick’,[0:2:10],’fontsize’,6)
set(gca,’ytickmode’,’auto’,’fontsize’,6);
subplot(3,1,2);
Statistical and Adaptive Signal Processing - Solution Manual 201
plot(time,yv,’g’,time,yv_hat,’m--’);
yaxismin = floor(min(min([yv,yv_hat]))/5)*5;
yaxismax = ceil(max(max([yv,yv_hat]))/5)*5;
axis([xaxismin,xaxismax,yaxismin,yaxismax]);
ylabel(’velocity (m/sec)’,’fontsize’,8);
legend(’True’,’Estimate’,4);
title(’True and Estimated Velocities’,’fontsize’,10);
set(gca,’xtick’,[0:2:10],’fontsize’,6);
set(gca,’ytickmode’,’auto’,’fontsize’,6);
subplot(3,1,3);
plot(time,ya,’g’,time,ya_hat,’m--’);
yaxismin = floor(min(min([ya,ya_hat]))/5)*5;
yaxismax = ceil(max(max([ya,ya_hat]))/5)*5;
axis([xaxismin,xaxismax,yaxismin,yaxismax]);
xlabel(’t (sec)’,’fontsize’,8); ylabel(’velocity (m/sec)’,’fontsize’,8);
legend(’True’,’Estimate’,4);
title(’True and Estimated Accelerations’,’fontsize’,10);
set(gca,’xtick’,[0:2:10],’fontsize’,6);
set(gca,’ytickmode’,’auto’,’fontsize’,6);
Hf_2 = figure(’units’,SCRUN,’position’,SCRPOS,...
’paperunits’,PAPUN,’paperposition’,papos);
subplot(2,1,1);
H_kg = plot(time(2:end),Kg1,’mo’,time(2:end),Kg2,’rd’,time(2:end),Kg3,’g*’);
set(H_kg,’markersize’,3); axis([0,10,0,1]);
title(’Kalman gain components’,’fontsize’,10);
legend(’K_p’,’K_v’,’K_a’,1);xlabel(’t (sec)’,’fontsize’,8);
set(gca,’xtickmode’,’auto’,’fontsize’,6);
set(gca,’ytick’,[0:0.2:1],’fontsize’,6);
set(gca,’yticklabel’,[’0.0’;’0.2’;’0.4’;’0.6’;’0.8’;’1.0’]);
subplot(2,2,3);
H_pt1 = plot(time(2:41),Rpre(1:40),’mo’,time(2:41),Rpost(1:40),’gd’);
set(H_pt1,’markersize’,3);
legend(’a-priori’,’a-posteriori’,1);xlabel(’t (sec)’,’fontsize’,8);
%axis([0,4.0,1,6]);
xlabel(’t (sec)’,’fontsize’,8);
%subplot(2,2,3), plot(time,tPm,’.’,time,tP,’g.’)
title(’Trace of covariance matrix’,’fontsize’,10);
set(gca,’xtickmode’,’auto’,’fontsize’,6);
set(gca,’ytick’,[0:1:6],’fontsize’,6);
subplot(2,2,4);
H_pt2 = plot(time(61:72),Rpre(60:71),’mo’,time(61:72),Rpost(60:71),’gd’);
set(H_pt2,’markersize’,3); hold on;
timenew = [1;1]*time(61:72); timenew = (timenew(:))’;
tpmtp = zeros(1,23);
tpmtp(1:2:23) = Rpre(60:71); tpmtp(2:2:24) = Rpost(60:71);
202 Statistical and Adaptive Signal Processing - Solution Manual
Position (meters)
10
True
0 Noisy
Estimate
−5
0 2 4 6 8 10
True and Estimated Velocities
5
velocity (m/sec)
True
Estimate
−5
0 2 4 6 8 10
True and Estimated Accelerations
5
acceleration (m/sec )
2
True
Estimate
−5
0 2 4 6 8 10
t (sec)
where v1 (n), v2 (n), and v3 (n) are IID zero-mean white Gaussian noise sources with variance σ 2v . Repeat
parts (a) and (b) above.
%% (c) AR(1) model for acceleration and
% observations of position, velocity, and acceleration
% Target and sensor models
T = 0.1; alpha = 0.9;
0.6
0.4
0.2
0.0
0 1 2 3 4 5 6 7 8 9 10
t (sec)
1.7
3
1.6
2
0 1 2 3 4 6 7
t (sec) t (sec)
v1 = stdv*randn(1,Nt);
v2 = stdv*randn(1,Nt);
v3 = stdv*randn(1,Nt);
v = zeros(1,1,Nt);
v(1,1,:) = v1(:); v(2,1,:) = v2(:); v(3,1,:) = v3(:);
for n = 1:Nt
x(1:M,1,n) = H*y(1:K,1,n) + D*v(1:P,1,n);
end
% A-priori estimates
yhat_ini = zeros(K,1); %[0;0;0];
R_y = 2*eye(K);
% Kalman Filter
[y_hat,GainK,Re_pre,Re_post] = skf(A,B,vareta,H,D,Rv,x,yhat_ini,R_y);
204 Statistical and Adaptive Signal Processing - Solution Manual
for n = 1:Nt
Rpre(n) = trace(Re_pre(:,:,n));
Rpost(n) = trace(Re_post(:,:,n));
end
% Plotting
Hf_3 = figure(’units’,SCRUN,’position’,SCRPOS,...
’paperunits’,PAPUN,’paperposition’,papos);
xaxismin = time(1); xaxismax = time(end);
subplot(3,1,1);
plot(time,yp,’g’,time,xp,’r:’,time,yp_hat,’m--’);
yaxismin = floor(min(min([yp,xp,yp_hat]))/5)*5;
yaxismax = ceil(max(max([yp,xp,yp_hat]))/5)*5;
axis([xaxismin,xaxismax,yaxismin,yaxismax]);
ylabel(’Position (meters)’,’fontsize’,8);
title(’True, Noisy, and Estimated Positions’,’fontsize’,10);
legend(’True’,’Noisy’,’Estimate’,4);
set(gca,’xtick’,[0:2:10],’fontsize’,6)
set(gca,’ytickmode’,’auto’,’fontsize’,6);
subplot(3,1,2);
plot(time,yv,’g’,time,xv,’r:’,time,yv_hat,’m--’);
yaxismin = floor(min(min([yv,yv_hat]))/5)*5;
yaxismax = ceil(max(max([yv,yv_hat]))/5)*5;
axis([xaxismin,xaxismax,yaxismin,yaxismax]);
xlabel(’t (sec)’,’fontsize’,8); ylabel(’velocity (m/sec)’,’fontsize’,8);
legend(’True’,’Noisy’,’Estimate’,4);
title(’True, Noisy, and Estimated Velocities’,’fontsize’,10);
set(gca,’xtick’,[0:2:10],’fontsize’,6);
set(gca,’ytickmode’,’auto’,’fontsize’,6);
Statistical and Adaptive Signal Processing - Solution Manual 205
subplot(3,1,3);
plot(time,ya,’g’,time,xa,’r:’,time,ya_hat,’m--’);
yaxismin = floor(min(min([ya,ya_hat]))/5)*5;
yaxismax = ceil(max(max([ya,ya_hat]))/5)*5;
axis([xaxismin,xaxismax,yaxismin,yaxismax]);
xlabel(’t (sec)’,’fontsize’,8); ylabel(’velocity (m/sec)’,’fontsize’,8);
legend(’True’,’Noisy’,’Estimate’,4);
title(’True, Noisy, and Estimated Accelerations’,’fontsize’,10);
set(gca,’xtick’,[0:2:10],’fontsize’,6);
set(gca,’ytickmode’,’auto’,’fontsize’,6);
Hf_4 = figure(’units’,SCRUN,’position’,SCRPOS,...
’paperunits’,PAPUN,’paperposition’,papos);
subplot(2,1,1);
H_kg = plot(time(2:end),Kg1,’mo’,time(2:end),Kg2,’rd’,time(2:end),Kg3,’g*’);
set(H_kg,’markersize’,3); axis([0,10,0,1]);
title(’Kalman gain components’,’fontsize’,10);
legend(’K_p’,’K_v’,’K_a’,1);xlabel(’t (sec)’,’fontsize’,8);
set(gca,’xtickmode’,’auto’,’fontsize’,6);
set(gca,’ytick’,[0:0.2:1],’fontsize’,6);
set(gca,’yticklabel’,[’0.0’;’0.2’;’0.4’;’0.6’;’0.8’;’1.0’]);
subplot(2,2,3);
H_pt1 = plot(time(2:41),Rpre(1:40),’mo’,time(2:41),Rpost(1:40),’gd’);
set(H_pt1,’markersize’,3);
legend(’a-priori’,’a-posteriori’,1);xlabel(’t (sec)’,’fontsize’,8);
axis([0,4.0,0,7]);
xlabel(’t (sec)’,’fontsize’,8);
title(’Trace of covariance matrix’,’fontsize’,10);
set(gca,’xtickmode’,’auto’,’fontsize’,6);
set(gca,’ytick’,[0:1:7],’fontsize’,6);
subplot(2,2,4);
H_pt2 = plot(time(61:72),Rpre(60:71),’mo’,time(61:72),Rpost(60:71),’gd’);
set(H_pt2,’markersize’,3); hold on;
timenew = [1;1]*time(61:72); timenew = (timenew(:))’;
tpmtp = zeros(1,23);
tpmtp(1:2:23) = Rpre(60:71); tpmtp(2:2:24) = Rpost(60:71);
plot(timenew,tpmtp,’w:’); hold off;
legend(’a-priori’,’a-posteriori’,1);xlabel(’t (sec)’,’fontsize’,8);
axis([5.95,7.05,0.15,0.6]);
xlabel(’t (sec)’,’fontsize’,8);
title(’Trace of covariance matrix’,’fontsize’,10);
set(gca,’xtick’,[6,7],’fontsize’,6);
set(gca,’ytick’,[0.2:0.1:0.6],’fontsize’,6);
The plots are shown in Figures 7.45c1 and 7.45c2.
206 Statistical and Adaptive Signal Processing - Solution Manual
Position (meters)
5
0 True
Noisy
Estimate
−5
0 2 4 6 8 10
True, Noisy, and Estimated Velocities
5
velocity (m/sec)
True
Noisy
Estimate
−5
0 2 4 6 8 10
True, Noisy, and Estimated
t (sec) Accelerations
5
acceleration (m/sec2)
True
Noisy
Estimate
−5
0 2 4 6 8 10
t (sec)
0.6
0.4
0.2
0.0
0 1 2 3 4 5 6 7 8 9 10
t (sec)
4 0.4
3
0.3
2
1
0.2
0
0 1 2 3 4 6 7
t (sec) t (sec)
8.1 By differentiating (8.2.8) with respect to the vector c, show that the LSE estimator cls is given by the solution
of the normal equations (8.2.12).
From (8.2.8)
E = E y − cH d̂ − d̂H c + cH R̂c
8.2 Let the weighted LSE be given by E w = eH We, where W is a Hermitian positive definite matrix.
(a) By minimizing E w with respect to the vector c, show that the weighted LSE estimator is given by (8.2.35).
Using e , y − Xc, we have
E w = eH We = yH − cH XH W (y − Xc) = yH − cH XH (Wy − WXc)
= yH Wy − yH WXc − cH XH Wy + cH XH WXc
, E W y − d̂HW c − cH d̂ W + cH R̂ W c
where E W y , yH Wy, d̂W , XH Wy, and R̂W , XH WX. Since W is Hermitian and positive-definite, R̂W
is also Hermitian and positive-definite. Thus the weighted LSE estimator cwls is provided by the solution
of
or
H
−1 H
cwls = R̂−1
W d̂ W = X WX X Wy
(b) Using the LDL H decomposition W = LDLH , show that the weighted LS criterion corresponds to pre-
filtering the error or the data.
Using W = LDLH , E w = eH LDLH e. Consider LH e which due to the upper triangular structure of LH is
a prefiltering operation on the error. Similarly from
−1 H
cwls = XH LDLH X X LDLH y
8.3 Using direct substitution of (8.4.4) into (8.4.5), show that the LS estimator cls(i) and the associated LS error E ls(i)
are determined by (8.4.5).
207
208 Statistical and Adaptive Signal Processing - Solution Manual
Using X̄ = X1 y X2 from (8.4.4), we have in (8.4.5)
0
X1H
E (i) = X̄H X̄ cls(i) = y H X1 y X2 cls(i)
ls
0 X2H
H
X1 X1 X1H y X1H X2 R11 r1 R12
= y H X1 y H y y H X2 , r1H E y r2H
X2H X1 X2H y X2H X2 H
R12 r2 R22
T
Express cls(i) as cls(i) = cls1 1 cls2 so that
R11 r1 R12 cls1 0
r1H E y r2H 1 = E ls(i)
H
R12 r2 R22 cls2 0
Following the parallels of (6.5.4) and (6.5.6) with the above equation (or using orthogonality) we obtain
R11 R12 cls1 r1
H =−
R12 R22 cls2 r2
and
8.4 Consider a linear system described by the difference equation y(n) = 0.9y(n − 1) + 0.1x (n −1)+v(n), where
x(n) is the input signal, y(n) is the output signal, and v(n) is an output disturbance. Suppose that we have
collected N = 1000 samples of input-output data and that we wish to estimate the system coefficients, using
the LS criterion with no windowing. Determine the coefficients of the model y(n) = ay(n − 1) + dx(n − 1)
and their estimated covariance matrix σ̂ 2e R̂−1 when
x = sqrt(sigmaX)*randn(1000,1);
y = filter(B,A,x) + sqrt(sigmaV)*randn;
[R_hat,d_hat] = lsmatvec(’nowi’,x,2,y)
R_hat =
890.9536 11.7168
11.7168 891.0335
d_hat =
-31.4221
-28.2493
cls = inv(R_hat)*d_hat
c_ls =
Statistical and Adaptive Signal Processing - Solution Manual 209
-0.0349
-0.0312
Ey = y’*y;
Els = Ey-d_hat’*cls;
N = 1000; M = 2;
sigmaE = Els/(N-M)
sigmaE =
0.5557
cov = sigmaE*inv(R_hat)
cov =
1.0e-03 *
0.6238 -0.0082
-0.0082 0.6237
(b) x(n) ∼ WGN(0, 1) and v(n) = 0.8v(n − 1) + w(n) is an AR(1) process with w(n) ∼ WGN(0, 1).
Comment upon the quality of the obtained estimates by comparing the matrices σ̂ 2e R̂−1 obtained in each
case.
% part b
sigmaW = 1;
w = sqrt(sigmaW)*randn(1000,1);
v = filter([1],[1 0.8],w);
y = filter(B,A,x) + v;
[R_hat,d_hat] = lsmatvec(’nowi’,x,2,y)
R_hat =
890.9536 11.7168
11.7168 891.0335
d_hat =
-39.7950
-40.2742
cls = inv(R_hat)*d_hat
cls =
-0.0441
-0.0446
Ey = y’*y;
Els = Ey-d_hat’*cls;
N = 1000; M=2;
sigmaE = Els/(N-M)
sigmaE =
2.6554
cov = sigmaE*inv(R_hat)
cov =
0.0030 -0.0000
-0.0000 0.0030
8.5 Use Lagrange multipliers to show that Equation (8.4.13) provides the minimum of (8.4.8) under the constraint
210 Statistical and Adaptive Signal Processing - Solution Manual
(8.4.9).
8.6 If full windowing is used in LS, then the autocorrelation matrix is Toeplitz. Using this fact, show that in the
combined FBLP predictor is given by
afb = 21 a + jb∗
8.7 Consider the noncausal “middle” sample linear signal estimator specified by (8.4.1) with M = 2L and i = L.
Then
2L
e(L) (n) = ck(L)∗ x(n − k) = c(L)H x̄(n), c(L)
L = 1
k=0
(a) Show that if we apply full windowing to the data matrix, the resulting signal estimator is conjugate
symmetric, that is, c(L) = Jc(L)∗ . This property does not hold for any other windowing method.
We have the vector equation
(L)
e(L) = X̄c
in which X̄ is a data matric with full windowing. Hence R̄ , X̄H X̄ is a Hermitian Toeplitz matrix, that is,
∗ ∗
R̄J = JR̄ or R̄ = JR̄ J
subject to the constraint c(L) = Jc(L) . We will prove the real-valued case. Consider partitiong of
(L)
e(L) = X̄c as
(L)
c
(L)
1
e = X̄1 y X̄2 1
c2(L)
Statistical and Adaptive Signal Processing - Solution Manual 211
, Wc(L)
1 +y
WT e(L) = WT Wc(L)
1 +W y =0
T
or
T
T
T
X̄1 + X̄2 J X̄1 + X̄2 J c1(L) + X̄1 + X̄2 J y = 0 = X̄1T + JX̄2 X̄1 + X̄2 J c1(L) + X̄1T + X̄2T J y
or
X̄1T X̄1 + X̄1T X̄2 J + JX̄2 X̄1 + JX̄2 X̄2 J c1(L) + X̄1 + X̄2 J y = 0
T T
(1)
and since the first and the last elements (after multiplied by J) of the right-hand side vector add to zero
due to (1), we obtain
0
(L) T (L)
X̄T X̄c + JX̄ X̄c = 2E (L)
0
or
$ % 0
T
X̄T X̄ + JX̄ X̄ c(L) = 2E (L)
0
H T
T H
∗
JWJ = JX̄ X̄J + X̄ X̄∗ = JX̄ X̄∗ J + X̄ X̄ = W∗
R = X’*X;
r = X’*y;
c = -R\r;
c = [c(1:L);1;c(L+1:end)]
Els = Xbar’*Xbar*c, Els = real(Els(L+1));
e = Xbar*c; Els1 = e’*e;
R = X’*X;
r = X’*y;
c = -R\r;
c = [c(1:L);1;c(L+1:end)]
Els = Xbar’*Xbar*c, Els = real(Els(L+1));
e = Xbar*c; Els2 = e’*e;
R = X’*X;
r = X’*y;
c = -R\r;
c = [c(1:L);1;(c(L:-1:1))] %c = [c(1:L);1;c(L+1:end)]
Statistical and Adaptive Signal Processing - Solution Manual 213
[Els,I] = sort([Els1,Els2,Els3,Els4])
Els =
0.6667 0.6667 0.6667 1.0000
I =
3 2 4 1
Thus the full-windowing gives the worst error.
8.8 A useful impulse response for some geophysical signal processing applications is the Mexican hat wavelet
2
g(t) = √ π −1/4 (1 − t 2 )e−t /2
2
3
which is the second derivative of a Gaussian pulse.
(a) Plot the wavelet g(t) and the magnitude and phase of its Fourier transform.
% Mexican-Hat function:
tmax = 5; t = -tmax:0.05:tmax; t2 = t.*t;
gt = (2/sqrt(3))*pi^(-1/4)*(1-t2).*exp(-t2/2);
1.5
0.5
G(F )
g(t )
0
0.5
−0.5 0
−5 0 5 −1 −0.74 0 0.74 1
t F
Figure 8.8a: Plots of g(t) and G( f )
subplot(’position’,[0.08,0.15,0.4,0.75]);
plot(t,gt,’g’,[-tmax,tmax],[0,0],’w:’,[0,0],[-.5,1],’w:’);
axis([-tmax,tmax,-0.5,1]);
title(’Mexican-Hat Wavelet’,’fontsize’,12);
xlabel(’\itt’,’fontsize’,10); ylabel(’{\itg}({\itt} )’,’fontsize’,10);
subplot(’position’,[0.58,0.15,0.4,0.75]);
plot(F,Gf,’g’,[-1,1],[0,0],’w:’,[0,0],[0,1.8],’w:’); axis([-1,1,0,1.8]);
title(’Fourier Transform’,’fontsize’,12);
xlabel(’\itF’,’fontsize’,10); ylabel(’{\itG}({\itF} )’,’fontsize’,10);
set(gca,’xtick’,[-1,F1,0,F2,1],’ytick’,[0:0.5:2]);
The plot is shown in Figure 8.8a.
(b) By examining the spectrum of the wavelet, determine a reasonable sampling frequency Fs .
%% (b) A reasonable sampling frequency (for G(F) <= 0.001)
Fs = 2*F2, Ts = 1/Fs;
Fs =
1.4800
(c) Design an optimum LS inverse FIR filter for the discrete-time wavelet g(nT ), where T = 1/Fs . Determine
a reasonable value for M by plotting the LSE E M as a function of order M. Investigate whether we can
improve the inverse filter by introducing some delay n 0 . Determine the best value of n 0 and plot the
impulse response of the resulting filter and the combined impulse response g(n) ∗ h(n − n 0 ), which
should resemble an impulse.
%%(c) Optimum LS Inverse filter
M = 14; % order of the filter
Statistical and Adaptive Signal Processing - Solution Manual 215
Hf_2 = figure(’units’,’inches’,’position’,[1,1,6,6],...
’paperunits’,’inches’,’paperposition’,[0,0,6,6],...
’numbertitle’,’off’,’name’,’P0808c’);
subplot(’position’,[0.08,0.6,0.4,0.3]);
stem(n*Ts,g,’g’); hold on;
plot([0,tmax],[0,0],’w:’,[0,0],[-.5,1],’w:’); axis([0,tmax,-0.5,1]);
title(’sampled Wavelet’,’fontsize’,12);
xlabel(’\itn’,’fontsize’,10); ylabel(’{\itg}({\itn} )’,’fontsize’,10);
set(gca,’xtick’,n*Ts,’xticklabel’,...
[’ 0’;’ 1’;’ 2’;’ 3’;’ 4’;’ 5’;’ 6’;’ 7’;’ 8’;’ 9’;’10’;’11’;...
’12’;’13’;’14’]);
subplot(’position’,[0.58,0.6,0.4,0.3]);
stem(n*Ts,c_ls,’g’); hold on;
plot([0,tmax],[0,0],’w:’); axis([0,tmax,-20,20]);
title(’LS Inverse Filter’,’fontsize’,12);
xlabel(’\itn’,’fontsize’,10); ylabel(’{\itc}_{ls}({\itn} )’,’fontsize’,10);
set(gca,’xtick’,n*Ts,’xticklabel’,...
[’ 0’;’ 1’;’ 2’;’ 3’;’ 4’;’ 5’;’ 6’;’ 7’;’ 8’;’ 9’;’10’;’11’;’12’;...
’13’;’14’]);
subplot(’position’,[0.08,0.1,0.9,0.3]);
stem(m*Ts,y_ls,’g’); hold on;
plot([0,mmax],[0,0],’w:’); axis([0,mmax,-1,1]);
title(’Verification’,’fontsize’,12);
xlabel(’\itn’,’fontsize’,10);
ylabel(’{\itc}_{ls}({\itn})*{\itg}({\itn} )’,’fontsize’,10);
set(gca,’xtick’,n*M*Ts,’xticklabel’,...
[’ 0’;’14’;’29’]);
The plot is shown in Figure 8.8c.
(d) Repeat part (c) by increasing the sampling frequency by a factor of 2 and comparing with the results
obtained in part (c).
%%(d) Optimum LS Inverse filter (Twice the sampling rate)
216 Statistical and Adaptive Signal Processing - Solution Manual
10
0.5
cls(n )
g(n )
0
0
−10
−0.5 −20
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
n n
Verification
1
0.5
cls(n)*g(n )
−0.5
−1
0 14 29
n
Figure 8.8c: Plots of sampled wavelet and its inverse filter
0.5 500
cls(n )
g(n )
0 0
−0.5 −500
0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 0 2 4 6 8 10 12 14 16 18 20 22 24 26 28
n n
Verification
1
0.5
cls(n)*g(n )
−0.5
−1
0 14 29
n
Figure 8.8d: Plots of sampled wavelet and its inverse filter for twice the sampling rate
Statistical and Adaptive Signal Processing - Solution Manual 217
Fs = 2*Fs; Ts = 1/Fs;
Hf_3 = figure(’units’,’inches’,’position’,[1,1,6,6],...
’paperunits’,’inches’,’paperposition’,[0,0,6,6],...
’numbertitle’,’off’,’name’,’P0808d’);
subplot(’position’,[0.08,0.6,0.4,0.3]);
stem(n*Ts,g,’g’); hold on;
plot([0,tmax],[0,0],’w:’,[0,0],[-.5,1],’w:’); axis([0,tmax,-0.5,1]);
title(’sampled Wavelet’,’fontsize’,12);
xlabel(’\itn’,’fontsize’,10); ylabel(’{\itg}({\itn} )’,’fontsize’,10);
set(gca,’xtick’,n*2*Ts,’xticklabel’,...
[’ 0’;’ 2’;’ 4’;’ 6’;’ 8’;’10’;’12’;’14’;’16’;’18’;’20’;’22’;...
’24’;’26’;’28’]);
subplot(’position’,[0.58,0.6,0.4,0.3]);
stem(k*Ts,c_ls,’g’); hold on;
plot([0,tmax],[0,0],’w:’); %axis([0,tmax,-20,20]);
title(’LS Inverse Filter’,’fontsize’,12);
xlabel(’\itn’,’fontsize’,10); ylabel(’{\itc}_{ls}({\itn} )’,’fontsize’,10);
set(gca,’xtick’,n*2*Ts,’xticklabel’,...
[’ 0’;’ 2’;’ 4’;’ 6’;’ 8’;’10’;’12’;’14’;’16’;’18’;’20’;’22’;...
’24’;’26’;’28’]);
subplot(’position’,[0.08,0.1,0.9,0.3]);
stem(m*Ts,y_ls,’g’); hold on;
plot([0,mmax],[0,0],’w:’); axis([0,mmax,-1,1]);
title(’Verification’,’fontsize’,12);
xlabel(’\itn’,’fontsize’,10);
ylabel(’{\itc}_{ls}({\itn})*{\itg}({\itn} )’,’fontsize’,10);
set(gca,’xtick’,n*M*Ts,’xticklabel’,...
[’ 0’;’14’;’29’]);
The plot is shown in Figure 8.8d.
218 Statistical and Adaptive Signal Processing - Solution Manual
8.9 (a) Prove Equation (8.5.4) regarding the LDL H decomposition of the augmented matrix R̄.
Using direct substitution
H
L 0 D 0 L k LDLH LDk
=
kH 1 0 E ls 0H 1 kH DLH kH Dk + E ls
R̂ d̂
= = R̄
d̂H E y
(b) Solve the LS estimation problem in Example 8.5.1, using the LDLH decomposition of R̄ and the parti-
tionings in (8.5.4).
% part b
X=[1 1 1; 2 2 1; 3 1 3; 1 0 1];
y=[1 2 4 3]’;
R_hat=X’*X;
d_hat=X’*y;
Ey=y’*y;
R_bar=[R_hat d_hat; d_hat’ Ey];
[L_bar D_bar] = ldlt(R_bar);
k=L_bar(end,1:end-1)’;
L=L_bar(1:end-1,1:end-1);
Cls=L’\k
Cls =
3.0000
-1.5000
-1.0000
8.10 Prove the order-recursive algorithm described by the relations given in (8.5.12). Demonstrate the validity of
this approach, using the data in Example 8.5.1.
8.11 In this problem, we wish to show that the statistical interpretations of innovation and partial correlation for
wm (n) and km+1 in (8.5.12) hold in a deterministic LSE sense. To this end, suppose that the “partial correlation”
between ỹ and x̃m+1 is defined using the residual records ẽm = ỹ − Xm cm and ẽm = x̃m+1 + Xm bm , where
bm is the LSE BLP. Show that kk+1 = β m+1 /ξ m+1 , where β m+1 , ẽmH ẽm and ξ m+1 = ẽmH ẽm . Demonstrate the
validity of these formulas using the data in Example 8.5.1.
8.12 Show that the Cholesky decomposition of a Hermitian positive definite matrix R can be computed by using
the following algorithm
for j = 1 to M
! j −1
li j = (ri j − k=1 |l j k |2 )1/2
for i = j + 1 to M
! j −1
li j = (ri j − k=1 lik∗ l j k )/l j j
end i
end j
and write a Matlab function for its implementation. Test your code using the built-in Matlab function chol.
Statistical and Adaptive Signal Processing - Solution Manual 219
8.13 Compute the LDLT and Cholesky decompositions of the following matrices:
9 3 −6 6 4 −2
X1 = 3 4 1 and X2 = 4 5 3
−6 1 9 −2 3 6
% Part 1. Matrix X1
X1 = [9 3 -6; 3 4 1; -6 1 9];
% R1 = X1’*X1;
chX1 = chol(X1)
chX1 =
3.0000 1.0000 -2.0000
0 1.7321 1.7321
0 0 1.4142
[L1 D1] = ldlt(X1)
L1 =
1.0000 0 0
0.3333 1.0000 0
-0.6667 1.0000 1.0000
D1 =
9
3
2
A1 = L1*diag(sqrt(D1))
A1 =
3.0000 0 0
1.0000 1.7321 0
-2.0000 1.7321 1.4142
% Part 2. Matrix X2
X2 = [6 4 2; 4 5 3; 2 3 6];
%R2=X2’*X2;
[L2,D2] = ldlt(X2)
L2 =
1.0000 0 0
0.6667 1.0000 0
0.3333 0.7143 1.0000
D2 =
6.0000
2.3333
4.1429
chX2 = chol(X2)
chX2 =
2.4495 1.6330 0.8165
0 1.5275 1.0911
0 0 2.0354
A2 = L2*diag(sqrt(D2))
A2 =
220 Statistical and Adaptive Signal Processing - Solution Manual
2.4495 0 0
1.6330 1.5275 0
0.8165 1.0911 2.0354
x_hat=[x y];
[N M]=size(x_hat);
[q,r]=qr(x_hat)
q =
-0.2582 -0.3545 0.8006 0.4082
-0.5164 -0.7089 -0.4804 0.0000
-0.7746 0.4557 0.1601 -0.4082
-0.2582 0.4051 -0.3203 0.8165
r =
-3.8730 -2.0656 -3.3566 -5.1640
0 -1.3166 0.7089 1.2659
0 0 0.4804 -0.4804
0 0 0 1.2247
Rqr=r(1:3,1:3);
Zqr=q’*y
Zqr =
-5.1640
1.2659
-0.4804
1.2247
z1qr=Zqr(1:3);
z2qr=Zqr(4);
Cls_qr=Rqr\z1qr
Cls_qr =
3.0000
-1.5000
-1.0000
Els_qr=z2qr’*z2qr
Els_qr =
1.5000
eqr=q*[zeros(1,3) z2qr’]’
eqr =
0.5000
0.0000
-0.5000
1.0000
Statistical and Adaptive Signal Processing - Solution Manual 221
[R,p]=chol(x_hat’*x_hat);
Rchol=R(1:3,1:3);
Cls_ch=Rchol’\R(1:3,4)
Cls_ch =
1.3333
-3.0534
-14.8224
Els_ch=R(4,4)
Els_ch =
1.2247
-0.0000 1.3333
-0.0000 0.3333
-0.0000 -2.6667
x=X1(2:end,2);
s=norm(x);
sn=sqrt(2*s*(s+abs(x(1))));
w22=(x+[1;0;0]*sign(x(1))*s)/sn;
w2=[0;w22];
H22=eye(length(w22))-2*w22*w22’;
H2=eye(4,4);H2(2:end,2:end)=H22;
X2=H2*X1
X2 =
-2.0000 -3.0000
-0.0000 -3.0000
-0.0000 0
-0.0000 0
R=X2
R =
-2.0000 -3.0000
-0.0000 -3.0000
-0.0000 0
-0.0000 0
Q=H1*H2
Q =
-0.5000 -0.1667 -0.4744 -0.7051
-0.5000 -0.5000 -0.2692 0.6538
-0.5000 -0.1667 0.8333 -0.1667
-0.5000 0.8333 -0.0897 0.2179
Q*R
ans =
1.0000 2.0000
1.0000 3.0000
1.0000 2.0000
1.0000 -1.0000
w1
w1 =
0.8660
0.2887
0.2887
0.2887
w2
w2 =
0
0.8498
0.0654
-0.5230
cls=R(1:2,1:2)’\z(1:2)
cls =
4.0000
-4.0000
Els=z(3:4)’*z(3:4)
Els =
90.0000
% Given’s Rotation
X = [1,2;1,3;1,2;1,-1], A = X;
X =
1 2
1 3
1 2
1 -1
y = [-3;10;3;6];
-0.0000 -2.0412
0 -2.1213
% LS solution
R1 = R(1:2,:)
R1 =
2.0000 3.0000
Statistical and Adaptive Signal Processing - Solution Manual 225
0 -3.0000
r = G*y
r =
8.0000
0
-8.2369
4.7068
r1 = r(1:2)
r1 =
8.0000
0
c = R1\r1
c =
4.0000
0
LSE = norm(r(3:4))^2
LSE =
90
using the GS and MGS methods, and compare the obtained results.
%% GS method
R = zeros(M); Q = zeros(N,M);
% vector q1
R(1,1) = norm(X(:,1));
Q(:,1) = X(:,1)/R(1,1);
226 Statistical and Adaptive Signal Processing - Solution Manual
% vector q2
R(1,2) = Q(:,1)’*X(:,2);
p2 = X(:,2) - R(1,2)*Q(:,1); R(2,2) = norm(p2);
Q(:,2) = p2/R(2,2);
% vector q3
R(1,3) = Q(:,1)’*X(:,3); R(2,3) = Q(:,2)’*X(:,3);
p3 = X(:,3) - R(1,3)*Q(:,1) - R(2,3)*Q(:,2); R(3,3) = norm(p3);
Q(:,3) = p3/R(3,3);
% QR decomposition
Q, R
Q =
0.8000 0.2000 0
0.4000 -0.4000 0.7071
0.4000 -0.4000 -0.7071
0.2000 0.8000 0
R =
5.0000 2.0000 1.0000
0 2.0000 1.0000
0 0 1.4142
% Check
er_GS = norm(X-Q*R)
er_GS =
2.2204e-016
%% MGS method
R = zeros(M); Q = zeros(N,M); X1 = X;
% vector q1
R(1,1) = norm(X(:,1));
Q(:,1) = X(:,1)/R(1,1);
R(1,2) = Q(:,1)’*X(:,2); X(:,2) = X(:,2) - R(1,2)*Q(:,1);
R(1,3) = Q(:,1)’*X(:,3); X(:,3) = X(:,3) - R(1,3)*Q(:,1);
% vector q2
R(2,2) = norm(X(:,2));
Q(:,2) = X(:,2)/R(2,2);
R(2,3) = Q(:,2)’*X(:,3); X(:,3) = X(:,3) - R(2,3)*Q(:,2);
% vector q3
R(3,3) = norm(X(:,3));
Q(:,3) = X(:,3)/R(3,3);
% QR decomposition
Q, R
Q =
Statistical and Adaptive Signal Processing - Solution Manual 227
% Check
er_MGS = norm(X1-Q*R)
er_MGS =
1.5701e-016
−0.4
0.2
r12 = q1T x2 = −2, r22 = )p2 ) = 4, and q2 = p2 / )p2 ) =
−0.8
0.4
228 Statistical and Adaptive Signal Processing - Solution Manual
−0.4
−0.8
0.4
r13 = q1T x3 = 1, r23 = q2T x3 = −1, r33 = )p3 ) = 2, and q3 = p3 / )p3 ) =
0.4
−0.2
Thus
−1
0.2 0.4 0.4 0.8 −1.0
1
Xcls = Q1 Rcls = y ⇒ Rcls = QT1 y = −0.4 0.2 −0.8 0.4 = −1.0
1
−0.8 0.4 0.4 −0.2 2.0
−2
or
5 −2 1 −1.0
0 4 −1 cls = −1.0
0 0 2 2.0
8.20 Show that the computational organization of the MGS algorithm shown in Table 8.4 can be used to compute
the GS algorithm if we replace the step rmi = qmH xi by rmi = qmH qi where qi ’s are initialized as qi = xi ,
1 ≤ i ≤ M.
This follows by observing that the rmi calculations are unchanged while xi ’s play the role of pi ’s in the GS
algorithm.
1 1
8.21 Compute the SVD of X = 1 1 by computing the eigenvalues and eigenvectors of X H X and XX H . Check
0 0
with the results obtained using the svd function.
Consider first XH X
1 1
1 1 0 1 1 = 2 2
XH X =
1 1 0 2 2
0 0
Statistical and Adaptive Signal Processing - Solution Manual 229
[U,S,V] = svd([1,1;1,1;0,0]) U =
0.7071 -0.7071 0
0.7071 0.7071 0
0 0 1.0000
S =
2 0
0 0
0 0
V =
0.7071 -0.7071
0.7071 0.7071
-0.4472 -0.8944
[Ua2,Sa2,Va2] = svd(XXHa)
Ua2 =
0.4472 -0.8944
-0.8944 -0.4472
Sa2 =
100.0000 0
0 25.0000
Va2 =
0.4472 -0.8944
-0.8944 -0.4472
0 1 1
(b) X = .
1 1 0
% part b
X = [0 1 1; 1 1 0];
XHXb=X’*X;
XXHb=X*X’;
[Ub1,Sb1,Vb1] = svd(XHXb)
Ub1 =
0.4082 -0.7071 0.5774
0.8165 0.0000 -0.5774
0.4082 0.7071 0.5774
Sb1 =
3.0000 0 0
0 1.0000 0
0 0 0
Vb1 =
0.4082 -0.7071 0.5774
0.8165 0.0000 -0.5774
0.4082 0.7071 0.5774
[Ub2,Sb2,Vb2] = svd(XXHb)
Ub2 =
0.7071 -0.7071
0.7071 0.7071
Sb2 =
3.0000 0
0 1.0000
Vb2 =
0.7071 -0.7071
0.7071 0.7071
8.23 Write a Matlab program to produce the plots in Figure 8.14, using the matrix X = 6
−7
2
6
. Hint: Use a
parametric description of the circle in polar coordinates.
close all;
set(0,’defaultaxesfontsize’,8);
Hf_1 = figure(’units’,’inches’,’position’,[0.05,0.3,6,6],...
Statistical and Adaptive Signal Processing - Solution Manual 231
% Transformation matrix X
X = [6,2;-7,6];
[U,S,V] = svd(X); V(:,2) = -V(:,2); U(:,2) = -U(:,2);
disp(sprintf(’\n The singular values are %2i and %2i’,S(1,1),S(2,2)));
subplot(2,2,1);
plot(x,y,’g’,[-4,4],[0,0],’w:’,[0,0],[-4,4],’w:’,P(1,1),P(2,1),’yo’,...
P(1,2),P(2,2),’yd’);
axis([-4,4,-4,4]); axis(’equal’);
set(gca,’xtick’,[-3:2:3],’ytick’,[-3:2:3]);
title(’Unit circle with test points’);
% Transformation using V’
Cv = V’*C;
subplot(2,2,3);
plot(Cv(1,:),Cv(2,:),’g’,[-4,4],[0,0],’w:’,[0,0],[-4,4],’w:’,...
Pv(1,1),Pv(2,1),’yo’,Pv(1,2),Pv(2,2),’yd’);
axis([-4,4,-4,4]); axis(’equal’);
set(gca,’xtick’,[-3:2:3],’ytick’,[-3:2:3]);
title(’Transformation using V^H’);
% Transformation using S
Cs = S*Cv; Ps = S*Pv;
subplot(2,2,4);
plot(Cs(1,:),Cs(2,:),’g’,[-11,11],[0,0],’w:’,[0,0],[-11,11],’w:’,...
Ps(1,1),Ps(2,1),’yo’,Ps(1,2),Ps(2,2),’yd’);
axis([-11,11,-11,11]); axis(’equal’);
232 Statistical and Adaptive Signal Processing - Solution Manual
10
3
5
1
−1
−5
−3
−10
−3 −1 1 3 −10 −5 0 5 10
10
3
5
1
−1
−5
−3
−10
−3 −1 1 3 −10 −5 0 5 10
% Transformation using U
Cu = U*Cs; Pu = U*Ps;
hold on;
plot(Cu(1,:),Cu(2,:),’r’,Pu(1,1),Pu(2,1),’yo’,Pu(1,2),Pu(2,2),’yd’);
X=[0 1 1; 1 1 0]’;
[U,S,V]=svd(X);
Splus=zeros(size(S’));
Splus(1:2,1:2)=diag(1./diag(S));
Xplus=V*Splus*U’;
disp(’A is’)
Statistical and Adaptive Signal Processing - Solution Manual 233
A is
disp(Xplus)
-0.3333 0.3333 0.6667
0.6667 0.3333 -0.3333
MP1=X*Xplus*X;
disp(’XAX = X’)
XAX = X
disp(MP1)
-0.0000 1.0000
1.0000 1.0000
1.0000 0.0000
MP2=Xplus*X*Xplus;
disp(’AXA = A’)
AXA = A
disp(MP2)
-0.3333 0.3333 0.6667
0.6667 0.3333 -0.3333
MP3=(X*Xplus)’;
disp(’(XA)^{H} = XA’)
(XA)^{H} = XA
disp(MP3)
0.6667 0.3333 -0.3333
0.3333 0.6667 0.3333
-0.3333 0.3333 0.6667
MP4=(Xplus*X)’;
disp(’(AX)^{H} = AX’)
(AX)^{H} = AX
disp(MP4)
1.0000 -0.0000
0.0000 1.0000
8.25 Prove the four Moore-Penrose conditions in (8.7.22) and explain why XX+ and X+ X are orthogonal projections
onto the range space of X and X H .
Using X = U$VH , X+ = V$ + UH , and A = X+
• Consider
XAX = U$VH V$ + UH U$VH = U$VH V$ + UH U$VH
= U$$ + $VH = U$VH = X
since
$r 0 $r−1 0
$ + $ =$$ + = =I
0 0 0 0
234 Statistical and Adaptive Signal Processing - Solution Manual
• Consider
AXA = V$ + UH U$VH V$ + UH = V$ + UH U$VH V$ + UH
= V$ + $$ + UH = X+ = A
• Consider
H
H
(XA)H = AH XH = V$ + UH U$VH = U$ +H VH V$ H UH
= U$ +H VH V$ H UH = XA
• Similarly
H
H
(AX)H = XH AH = U$VH V$ + UH = V$ H UH U$ +H VH
= V$ H UH U$ +H VH = AX
Consider
XX+ = U$V H + H
V$ U = U$$ +UH
$r 0 $r−1 0 Ir 0
= U U =U
H
UH
0 0 0 0 0 0
= Ur UrH
which by definition are orthogonal projections onto the range space of X (Golub & Van Loan). Similarly X+ X
are orthogonal projections onto the range space of X+ .
8.26 In this problem we examine in greater detail the radio-frequency interference cancellation experiment discussed
in Section 8.4.3. We first explain the generation of the various signals and then proceed with the design and
evaluation of the LS interference canceler.
L
z(n) = Ai sin (ωi n + φ i )
i=1
(c) Compute and plot the periodogram of z(n) to check the correctness of your code.
(d) Generate N samples of white Gaussian noise v(n) ∼ WGN (0, 0.1) and create the observed signal
x(n) = 5s(n − n 0 ) + z(n) + v(n), where n 0 = 1000. Compute and plot the periodogram of x(n).
(e) Design a one-step ahead (D = 1) linear predictor with M = 100 coefficients using the FBLP method
with no windowing. Then use the obtained FBLP to clean the corrupted signal x(n) as shown in Figure
8.7. To evaluate the performance of the canceler, generate the plots shown in Figures 8.8 and 8.9.
8.27 Careful inspection of Figure 8.9 indicates that the D-step prediction error filter, that is, the system with input
x(n) and output ef (n), acts as a whitening filter. In this problem, we try to solve Problem 8.26 by designing a
practical whitening filter using a power spectral density (PSD) estimate of the corrupted signal x(n).
(a) Estimate the PSD R̂x(PA) (e j ωk ), ωk = 2π k/NFFT , of the signal x(n), using the method of averaged
periodograms. Use a segment length of L = 256 samples, 50 percent overlap, and NFFT = 512.
% Common parameters
Fs = 2; % All frequencies are in GHz
N = 4096; n = 0:N-1; % Length of sequence
%% Additive WGN
varv = 0.1; sigv = sqrt(varv);
v = sigv*randn(1,N);
phase by
1 2π NFFT −1
−j k
H̃ (k) = : e NFFT 2
R̂x(PA) (e j ωk )
where H̃ (k) is the DFT of the impulse response of the filter, that is,
FFT −1
N
− j N2π nk
H̃ (k) = h(n) e FFT
n=0
with 0 ≤ k ≤ NFFT − 1.
% (b) Whitening FIR filter
magH = 1./(sqrt(Rx’)); magH = [magH,fliplr(magH(2:end-1))];
k = 0:Nfft/2; phaH = 2*pi*(Nfft-1)/(Nfft*2)*k;
phaH = [phaH,fliplr(phaH(2:end-1))];
H = magH.*exp(-j*phaH);
h = real(ifft(H));
(c) Use the obtained whitening filter to clean the corrupted signal x(n), and compare its performance with
the FBLP canceler by generating plots similar to those shown in Figures 8.8 and 8.9.
% (c) Filtering using the Whitening filter
y = filter(h,1,x);
(d) Repeat part (c) with L = 128, NFFT = 512 and L = 512, NFFT = 1024 and check whether spectral
resolution has any effect upon the performance.
% (d1) L = 128, Nfft = 512
Nfft = 512; L = 128; w_ham = hamming(L)’;
Rx = psd(x,Nfft,Fs,w_ham,L/2,’none’);
magH = 1./(sqrt(Rx’)); magH = [magH,fliplr(magH(2:end-1))];
k = 0:Nfft/2; phaH = 2*pi*(Nfft-1)/(Nfft*2)*k;
phaH = [phaH,fliplr(phaH(2:end-1))];
H = magH.*exp(-j*phaH);
h = real(ifft(H));
y = filter(h,1,x);
8.28 Repeat Problem 8.27, using the multitaper method of PSD estimation.
(a) Estimate the PSD R̂x(PA) (e j ωk ), ωk = 2π k/NFFT , of the signal x(n), using the multitaper method. Use
NFFT = 512.
Statistical and Adaptive Signal Processing - Solution Manual 237
% Common parameters
Fs = 2; % All frequencies are in GHz
N = 4096; n = 0:N-1; % Length of sequence
%% Additive WGN
varv = 0.1; sigv = sqrt(varv);
v = sigv*randn(1,N);
R̂x(PA) (e j ωk )
where H̃ (k) is the DFT of the impulse response of the filter, that is,
FFT −1
N
− j N2π nk
H̃ (k) = h(n) e FFT
n=0
with 0 ≤ k ≤ NFFT − 1.
% (b) Whitening FIR filter
magH = 1./(sqrt(Rx’)); magH = [magH,fliplr(magH(2:end-1))];
k = 0:Nfft/2; phaH = 2*pi*(Nfft-1)/(Nfft*2)*k;
phaH = [phaH,fliplr(phaH(2:end-1))];
238 Statistical and Adaptive Signal Processing - Solution Manual
H = magH.*exp(-j*phaH);
h = real(ifft(H));
(c) Use the obtained whitening filter to clean the corrupted signal x(n), and compare its performance with
the FBLP canceler by generating plots similar to those shown in Figures 8.8 and 8.9.
% (c) Filtering using the Whitening filter
y = filter(h,1,x);
(d) Repeat part (c) with NFFT = 512 and NFFT = 1024 and check whether spectral resolution has any effect
upon the performance.
% (d1) Nfft = 512
Nfft = 512;
Rx = pmtm(x,4,Nfft,Fs);
magH = 1./(sqrt(Rx’)); magH = [magH,fliplr(magH(2:end-1))];
k = 0:Nfft/2; phaH = 2*pi*(Nfft-1)/(Nfft*2)*k;
phaH = [phaH,fliplr(phaH(2:end-1))];
H = magH.*exp(-j*phaH);
h = real(ifft(H));
y = filter(h,1,x);
8.29 In this problem we develop an RFI canceler using a symmetric linear smoother with guard samples defined by
M
e(n) = x(n) − x̂(n) , x(n) + ck [x(n − k) + x(n − k)]
k=D
where 1 ≤ D < M prevents the use of the D adjacent samples to the estimation of x(n).
(a) Following the approach used in Section 8.4.3, demonstrate whether such a canceler can be used to mitigate
RFI and under what conditions.
a=2.3; r=0.4;
f=2; Fs=2; T=1/Fs;
n=[-4:12];
for i=1:length(n)
g(i)=1/(exp(-a*n(i)*T/r)+exp(a*n(i)*T/f));
end
s(1)=g(1);
for i=2:length(n)
Statistical and Adaptive Signal Processing - Solution Manual 239
s(i)=g(i)-g(i-1);
end
S=fft(s,501);
S=fftshift(S);
(b) If there is theoretical justification for such a canceler, estimate its coefficients, using the method of LS
with no windowing for M = 50 and D = 1 for the situation described in Problem 8.26.
% part(b)
F=0.1*[0.6 1 1.8 2.1 3 4.8 5.2 5.7 6.1 6.4 6.7 7 7.8 9.3]’;
L=length(F);
om=2*pi*F/Fs;
A=[0.5 1 1 0.5 0.1 0.3 0.5 1 1 1 0.5 0.3 1.5 0.5]’;
rand(’seed’,1954);
phi=2*pi*rand(L,1);
N=4096;
for i=1:N
z(i)=A’*(sin(om.*i+phi));
end
z=z’;
(c) Use the obtained filter to clean the corrupted signal x(n), and compare its performance with the FBLP
canceler by generating plots similar to those shown in Figures 8.8 and 8.9.
% part(d)
sigmaV=0.1;
v=sqrt(sigmaV)*randn(size(z));
s_delay=zeros(size(z));
for i=1:length(s)
s_delay(i+1000)=s(i);
end
x=5*s_delay+z+v;
M=50;
D=1;
R=lsmatvec(’nowi’,x,2*M+2);
Rb=fliplr(R);
R_bar=R+Rb;
c_bar=R_bar\R_bar(:,50);
(d) Repeat part (c) for D = 2.
8.30 In Example 6.7.1 we studied the design and performance of an optimum FIR inverse system. In this problem,
we design and analyze the performance of a similar FIR LS inverse filter, using training input-output data.
240 Statistical and Adaptive Signal Processing - Solution Manual
(a) First, we generate N = 100 observations of the input signal y(n) and the noisy output signal x(n). We
assume that x(n) ∼ WGN(0, 1) and v(n) ∼ WGN(0, 0.1). To avoid transient effects, we generate 200
samples and retain the last 100 samples to generate the required data records.
% (a)
M=10; sigmaX=1;
sigmaV=0.1; sigmaY=1;
y=sqrt(sigmaY)*randn(250,100);
v=sqrt(sigmaV)*randn(250,100);
x=s(2:end,:)+v;
(b) Design an LS inverse filter with M = 10 for 0 ≤ D < 10, using no windowing, and choose the best
value of delay D.
% (b) No Windowing
X=x(101:200,:);
for j=1:100
for i=1:10
[R dd]=lsmatvec(’nowi’,X(:,j),10,y(99+i:198+i,j));
d(:,i)=dd;
h(:,i,j)=R\d(:,i);
Py=y(99+i:198+i,j)’*y(99+i:198+i,j);
P(i,j)=Py-d(:,i)’*h(:,i,j);
end
end
Hf_1 = figure(’units’,SCRUN,’position’,SCRPOS,...
’paperunits’,PAPUN,’paperposition’,[0,0,4,2]);
plot([0:9],mean(P,2),’g’),
title(’MMSE (no windowing)’,’fontsize’,title_fontsize);
xlabel(’D’,’fontsize’,label_fontsize);
ylabel(’Error’,’fontsize’,label_fontsize);
exportfig(gcf,’p0830a.eps’,’fontmode’,’scaled’,...
’linemode’,’scaled’,’color’,’cmyk’);
Hf_2 = figure(’units’,SCRUN,’position’,SCRPOS,...
’paperunits’,PAPUN,’paperposition’,[0,0,5,4]);
subplot(411);
stem([0:9],mean(h(:,2,:),3),’g’);line([0:9],zeros(10,1));
axis([0 9 -.25 1]),
text(0.85, .8,[’D=1’], ’units’,’normalized’);
title(’Filter Coefficients h_{D} (no windowing)’,’fontsize’,title_fontsize);
subplot(412)
stem([0:9],mean(h(:,4,:),3),’g’);line([0:9],zeros(10,1));
axis([0 9 -.25 1]),
text(0.85, .8,[’D=3’], ’units’,’normalized’,’fontsize’,title_fontsize);
Statistical and Adaptive Signal Processing - Solution Manual 241
25
24
23
22
Error
21
20
19
18
17
0 1 2 3 4 5 6 7 8 9
D
subplot(413)
stem([0:9],mean(h(:,6,:),3),’g’);line([0:9],zeros(10,1));
axis([0 9 -.25 1]),
text(0.85, .8,[’D=5’], ’units’,’normalized’,’fontsize’,title_fontsize);
subplot(414)
stem([0:9],mean(h(:,8,:),3),’g’);line([0:9],zeros(10,1));
axis([0 9 -.25 1]),
text(0.85, .8,[’D=7’], ’units’,’normalized’,’fontsize’,title_fontsize);
xlabel(’n’,’fontsize’,label_fontsize);
The plots of error variance and filter responses are shown in Figures 8.30a and 8.30b.
(c) Repeat part (b) using full windowing.
% (c) full windowing
for j=1:100
for i=1:10
[R dd]=lsmatvec(’full’,X(:,j),10,y(99+i:198+i,j));
d(:,i)=dd;
h(:,i,j)=R\d(:,i);
Py=y(99+i:198+i,j)’*y(99+i:198+i,j);
P(i,j)=Py-d(:,i)’*h(:,i,j);
end
end
Hf_3 = figure(’units’,SCRUN,’position’,SCRPOS,...
’paperunits’,PAPUN,’paperposition’,[0,0,4,2]);
plot([0:9],mean(P,2),’g’);
title(’MMSE (full windowing)’,’fontsize’,title_fontsize);
xlabel(’D’,’fontsize’,label_fontsize);
ylabel(’Error’,’fontsize’,label_fontsize);
exportfig(gcf,’p0830c.eps’,’fontmode’,’scaled’,...
’linemode’,’scaled’,’color’,’cmyk’);
Hf_4 = figure(’units’,SCRUN,’position’,SCRPOS,...
’paperunits’,PAPUN,’paperposition’,[0,0,5,4]);
subplot(411)
242 Statistical and Adaptive Signal Processing - Solution Manual
0 1 2 3 4 5 6 7 8 9
1
D=3
0.5
0 1 2 3 4 5 6 7 8 9
1
D=5
0.5
0 1 2 3 4 5 6 7 8 9
1
D=7
0.5
0 1 2 3 4 5 6 7 8 9
n
Figure 8.30b: Plots of filter responses for various values of D for no windowing
stem([0:9],mean(h(:,2,:),3),’g’);line([0:9],zeros(10,1));
axis([0 9 -.25 1]),
text(0.85, .8,[’D=1’], ’units’,’normalized’,’fontsize’,title_fontsize);
title(’Filter Coefficients h_{D} (full windowing)’,’fontsize’,title_fontsize);
subplot(412)
stem([0:9],mean(h(:,4,:),3),’g’);line([0:9],zeros(10,1));
axis([0 9 -.25 1]),
text(0.85, .8,[’D=3’], ’units’,’normalized’,’fontsize’,title_fontsize);
subplot(413)
stem([0:9],mean(h(:,6,:),3),’g’);line([0:9],zeros(10,1));
axis([0 9 -.25 1]),
text(0.85, .8,[’D=5’], ’units’,’normalized’,’fontsize’,title_fontsize);
subplot(414)
stem([0:9],mean(h(:,8,:),3),’g’);line([0:9],zeros(10,1));
axis([0 9 -.25 1]),
text(0.85, .8,[’D=7’], ’units’,’normalized’,’fontsize’,title_fontsize);
xlabel(’n’,’fontsize’,label_fontsize);
The plots of error variance and filter responses are shown in Figures 8.30c and 8.30d.
(d) Compare the LS filters obtained in parts (b) and (c) with the optimum filter designed in Example 6.7.1.
What are your conclusions?
8.31 In this problem we estimate the equalizer discussed in Example 6.8.1, using input-output training data, and we
evaluate its performance using Monte Carlo simulation.
(a) Generate N = 1000 samples of input-desired response data {x(n), a(n)}0N−1 and use them to estimate the
Statistical and Adaptive Signal Processing - Solution Manual 243
30
25
Error 20
15
10
0 1 2 3 4 5 6 7 8 9
D
0 1 2 3 4 5 6 7 8 9
1
D=3
0.5
0 1 2 3 4 5 6 7 8 9
1
D=5
0.5
0 1 2 3 4 5 6 7 8 9
1
D=7
0.5
0 1 2 3 4 5 6 7 8 9
n
Figure 8.30b: Plots of filter responses for various values of D for full windowing
244 Statistical and Adaptive Signal Processing - Solution Manual
correlation matrix R̂x and the cross-correlation vector d̂ between x(n) and y(n − D). Use D = 7, M = 11,
and W = 2.9. Solve the normal equations to determine the LS FIR equalizer and the corresponding LSE.
% Given Parameters
N = 1000; % Length of sequences
M = 11; % equalizer length
D = 7; % delay in desired signal
varv = 0.001; % Variance of noise
K = 500; % Number of simulations
% Initializations
h = zeros(1,3);
% LS FIR equalizer
c = R_hat\d_hat;
% LSE
LSE = y’*y - c’*d_hat;
% Printout
disp(sprintf(’\n *** The LS FIR equalizer is:\n %7.4f %7.4f %7.4f
Statistical and Adaptive Signal Processing - Solution Manual 245
(b) Repeat part (a) 500 times; by changing the seed of the random number generators, compute the average
(over the realizations) coefficient vector and average LSE, and compare with the optimum MSE equalizer
obtained in Example 6.8.1. What are your conclusions?
1.5 1.5
1 1
h(n)
h(n)
0.5 0.5
0 0
−0.5 −0.5
−1 −1
0 1 2 3 4 5 6 7 8 9 10 0 1 2 3 4 5 6 7 8 9 10
n n
1 1
c(n)
c(n)
0.5 0.5
0 0
−0.5 −0.5
−1 −1
0 1 2 3 4 5 6 7 8 9 10 0 1 2 3 4 5 6 7 8 9 10
n n
Figure 8.31: Plots of filter responses for various values of D for full windowing
Statistical and Adaptive Signal Processing - Solution Manual 247
y = [zeros((M-1)/2,1);a;zeros((M-1)/2,1)]; %y = y(1:N-M+1);
% LS FIR equalizer
c = R_hat\d_hat;
% LSE
LSE = y’*y - c’*d_hat;
% Printout
disp(sprintf(’\n *** The LS FIR equalizer is:\n %7.4f %7.4f %7.4f
%7.4f %7.4f %7.4f %7.4f %7.4f %7.4f %7.4f %7.4f ’,c));
*** The LS FIR equalizer is:
-0.0237 0.0729 -0.1662 0.3532 -0.7476 1.5752 -0.7450
0.3513 -0.1629 0.0700 -0.0236
Plots of Channel responses and their corresponding equalizers are shown in Figure-8.31.
Chapter 9
Rbar = lsmatrix(x,P+1);
if isreal(Rbar)
Rfb = Rbar + flipud(fliplr(Rbar));
else
Rfb = Rbar + flipud(fliplr(conj(Rbar)));
end
[ahat,VarP] = olsigest(Rfb,1);
Matlab Verification:
% Generate x(n)
bh = 1; ba = [1,-2.7607,3.8108,-2.6535,0.9238];
N = 250; w = randn(N,1);
x = filter(bh,ba,w);
248
Statistical and Adaptive Signal Processing - Solution Manual 249
disp(sprintf(’ahat = [%6.4f,%6.4f,%6.4f,%6.4f]’,ahat));
ahat = [-2.8153,3.9155,-2.7413,0.9480]
disp(sprintf(’Error variance: %8.4f’,VarP));
Error variance: 400.1909
(b) The plots are generated using the following Matlab script and shown in Figure 9.1.
% (b) Plot of error variance and MSC vs P
Pmax = 15; V = zeros(Pmax,1);
FPE = V; AIC = V; MDL = V; CAT = V;
for P = 1:Pmax
[ahat,VarP] = armodcov(x,P);
V(P) = VarP;
FPE(P) = (N+P)/(N-P)*VarP;
AIC(P) = N*log10(VarP) + 2*P;
MDL(P) = N*log10(VarP) + P*log10(N);
CAT(P) = sum([N-1:-1:N-P]’./(N*V(1:P)))/N -(N-P)/(N*VarP);
end
P = 1:Pmax;
Hf_1 = figure(’units’,SCRUN,’position’,SCRPOS,...
stem(P,V/max(V),’g’); axis([0,Pmax+1,0,1.1]);
xlabel(’Model order P’,’fontsize’,label_fontsize);
ylabel(’Normalized error variance’,’fontsize’,label_fontsize);
title(’Modified Covariance Method’,’fontsize’,title_fontsize);
set(gca,’xtick’,[1:1:Pmax],’ytick’,[0:0.2:1]);
Hf_2 = figure(’units’,SCRUN,’position’,SCRPOS,...
subplot(2,2,1); plot(P,FPE/max(FPE),’g’);
%xlabel(’Model order P’,’fontsize’,label_fontsize);
ylabel(’Normalized FPE(P)’,’fontsize’,label_fontsize);
title(’Final Prediction Error’,’fontsize’,title_fontsize);
set(gca,’xtick’,[1:1:Pmax],’xlim’,[0,Pmax+1]);
subplot(2,2,2); plot(P,AIC/max(AIC),’g’);
%xlabel(’Model order P’,’fontsize’,label_fontsize);
ylabel(’Normalized AIC(P)’,’fontsize’,label_fontsize);
title(’Akaike Information Criteria’,’fontsize’,title_fontsize);
set(gca,’xtick’,[1:1:Pmax],’xlim’,[0,Pmax+1]);
subplot(2,2,3); plot(P,MDL/max(MDL),’g’);
xlabel(’Model order P’,’fontsize’,label_fontsize);
ylabel(’Normalized MDL(P)’,’fontsize’,label_fontsize);
title(’Minimum Description Length’,’fontsize’,title_fontsize);
set(gca,’xtick’,[1:1:Pmax],’xlim’,[0,Pmax+1]);
subplot(2,2,4); plot(P,CAT/max(-CAT),’g’);
xlabel(’Model order P’,’fontsize’,label_fontsize);
ylabel(’Normalized CAT(P)’,’fontsize’,label_fontsize);
250 Statistical and Adaptive Signal Processing - Solution Manual
Normalized FPE(P)
Normalized AIC(P)
0.8 0.9
1 0.8
0.6
0.7
0.4
0.6
Normalized error variance
0.8
0.2 0.5
0 0.4
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
0.6
Minimum Description Length Criterion Autoregressive Transfer
1 0
Normalized MDL(P)
Normalized CAT(P)
0.4 0.9 −0.2
0.8
−0.4
0.7
0.2 −0.6
0.6
0.5 −0.8
0 0.4 −1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Model order P Model order P Model order P
Nf
Em = fb
{|emf (n)|2 + |emb (n)|2 }
n=Ni
∗
+em−1
f
(n)km−1 em−1
b∗
(n − 1) + km−1 b
em−1 (n − 1)em−1
f∗
(n)
N N
f
f f
b
Emfb = 1 + |km−1 |2 e (n)2 + 1 + |km−1 |2 e (n − 1)2
m−1 m−1
Ni Ni
Nf
Nf
∗
+2km−1 f
em−1 (n)em−1
b∗
(n − 1) + 2km−1 b
em−1 (n − 1)em−1
f∗
(n)
Ni Ni
! N f f 2 b
,E ! N f b 2
!N f f
Using Em−1
f
= Nie m−1 (n) m−1 = Ni em−1 (n − 1) , and β m−1 =
fb∗
Ni em−1 (n)em−1 (n − 1),
b∗
we obtain
f ∗
Emfb = 1 + |km−1 |2 Em−1 + Em−1
b
+ 4 Re km−1 β fb
m−1
Statistical and Adaptive Signal Processing - Solution Manual 251
∂ Emfb
(b) Using ∗
∂km−1
= 0, we obtain
f
2km−1 Em−1 + Em−1
b
m−1 = 0
+ 4β fb
which gives
β fb 2k FP k BP
B
km−1 = − 1 f m−1 b = FP m−1 m−1
2
Em−1 + Em−1 km−1 + km−1
BP
where the last step is obtained by using (9.2.29) and (9.2.32) and the superscript B is used to emphasize
Burg’s contribution.
FP BP
B km−1 ≤ 1 and km−1 ≤ 1 and since km−1 is the harmonic mean of km−1 and km−1 , it is clear that
B FP BP
(c) Since
k ≤ 1.
m−1
IS FP BP
(d) From (9.2.36), km−1 is the geometric mean of km−1 and km−1 , that is,
IS 2 FP BP IS
k = k
m−1 m−1 km−1 ≤ 1 or km−1 ≤ 1
% Generate x(n)
bh = 1; ba = [1,-0.9,0.81];
N = 250; w = randn(N,1);
x = filter(bh,ba,w);
% 2. Initialization
ef0 = x; eb0 = x;
betaFB0 = ef0(2:end)’*eb0(1:end-1);
Ef0 = ef0’*ef0;
Eb0 = eb0(1:end-1)’*eb0(1:end-1);
kFP0 = -betaFB0/Eb0;
kBP0 = -betaFB0/Ef0;
kBurg0 = 2*kFP0*kBP0/(kFP0+kBP0);
kIS0 = -betaFB0/sqrt(Eb0*Ef0);
252 Statistical and Adaptive Signal Processing - Solution Manual
for n = 2:length(x)
ef(n,1) = ef0(n) + kBurg0*eb0(n-1);
eb(n,1) = eb0(n-1) + kBurg0*ef0(n);
end
% 3. Loop: m = 2,...,P
for m = 2:P
betaFB(m-1) = ef(2:end,m-1)’*eb(1:end-1,m-1);
Ef(m-1) = ef(:,m-1)’*ef(:,m-1);
Eb(m-1) = eb(1:end-1,m-1)’*eb(1:end-1,m-1);
kFP(m-1) = -betaFB(m-1)/Eb(m-1);
kBP(m-1) = -betaFB(m-1)/Ef(m-1);
kBurg(m-1) = 2*kFP(m-1)*kBP(m-1)/(kFP(m-1)+kBP(m-1));
kIS(m-1) = -betaFB(m-1)/sqrt(Eb(m-1)*Ef(m-1));
for n = 2:length(x)
ef(n,m) = ef(n,m-1) + kBurg(m-1)*eb(n-1,m-1);
eb(n,m) = eb(n-1,m-1) + kBurg(m-1)*ef(n,m-1);
end
end
% 4. Output:
kFP = [kFP0,kFP]
kFP = -0.4845 0.8483
kBP = [kBP0,kBP]
kBP = -0.4845 0.8407
kBurg = [kBurg0,kBurg]
kBurg = -0.4845 0.8445
kIS = [kIS0,kIS]
kIS = -0.4845 0.8445
Hf_1 = figure(’units’,SCRUN,’position’,SCRPOS,...
’paperunits’,PAPUN,’paperposition’,[0,0,5,3]);
set(Hf_1,’NumberTitle’,’off’,’Name’,’Pr0904a’);
Statistical and Adaptive Signal Processing - Solution Manual 253
L = 10; l = 0:L-1;
K = N/2; f = [0:K]/K; k = 1:K+1;
x = e;
subplot(’position’,[0.1,0.65,0.35,0.3]);
plot(n(1:100),x(1:100),’g’); axis([-1,100,-4,4]);
xlabel(’\itn’,’fontsize’,label_fontsize,’fontname’,’times’);
ylabel(’{\itx}({\itn})’,’fontsize’,label_fontsize,’fontname’,’times’);
title(’Error samples’,’Fontsize’,title_fontsize);
set(gca,’xtick’,[0:20:100],’ytick’,[-4:1:4]);
% Autocorrelation test
r = autoc(x,L+1); rho = r(1:L)/r(1);
conf_lim = 1.96/sqrt(N);
subplot(’position’,[0.6,0.65,0.35,0.3]);
plot([-1,L],[0,0],’w’); hold on;
Hr = stem(l,rho,’filled’,’g’);
set(Hr,’markersize’,3); axis([-1,L,-1.2,1.2]);
plot([-1,L],[-conf_lim,-conf_lim],’r:’);
plot([-1,L],[conf_lim,conf_lim],’r:’);
hold off; conf_lim = round(conf_lim*100)/100;
xlabel(’Lag \itl’,’fontsize’,label_fontsize);
ylabel(’\rho_{\itx}({\itl})’,’fontsize’,label_fontsize,’fontname’,’times’);
title(’Autocorrelation test’,’Fontsize’,title_fontsize);
set(gca,’xtick’,[0:5:L],’ytick’,[-1,-conf_lim,0,conf_lim,1]);
% PSD test
Rx = psd(x,N,2,boxcar(length(x)),’none’);
Ix = cumsum(Rx(1:K+1)); Ix = Ix/Ix(K+1);
Ibl = -1.36/sqrt(K-1) + (k-1)/(K-1);
Ibu = 1.36/sqrt(K-1) + (k-1)/(K-1);
subplot(’position’,[0.1,0.15,0.35,0.3]);
plot(f,Ix,’g’,f,Ibl,’r:’,f,Ibu,’r:’); axis([0,1,-0.2,1.2]);
xlabel(’Frequency (cycles/samp)’,’fontsize’,label_fontsize);
ylabel(’I_{\itx}({\itf})’,’fontsize’,label_fontsize,’fontname’,’times’);
title(’PSD test’,’Fontsize’,title_fontsize);
Ibl(1) = round(Ibl(1)*100)/100;
Ibu(1) = round(Ibu(1)*100)/100;
set(gca,’xtick’,[0:0.2:1],’ytick’,[Ibl(1),0,Ibu(1),1]);
set(gca,’xticklabel’,[’ 0 ’;’0.1’;’0.2’;’0.3’;’0.4’;’0.5’]);
% PARCOR test
Vx=r(1); r=r/Vx;
[a,PACS,var]=durbin(r,L); PACS = [1;PACS(1:L-1)];
conf_lim = 1.96/sqrt(N);
subplot(’position’,[0.6,0.15,0.35,0.3]);
plot([-1,L],[0,0],’w’); hold on;
Hr = stem(l(2:L),PACS(2:L),’filled’,’g’);
set(Hr,’markersize’,3); axis([-1,L,-1.2,1.2]);
254 Statistical and Adaptive Signal Processing - Solution Manual
ρx(l)
x(n)
0.12
0 0
−0.12
−1
−2
−3 −1
−4
0 20 40 60 80 100 0 5 10
n Lag l
PACS
I (f)
0.12
0
x
−0.12
0.12
0
−0.12 −1
plot([-1,L],[-conf_lim,-conf_lim],’r:’);
plot([-1,L],[conf_lim,conf_lim],’r:’);
hold off; conf_lim = round(conf_lim*100)/100;
xlabel(’Lag {\itl}’,’fontsize’,label_fontsize);
ylabel(’PACS’,’fontsize’,label_fontsize);
title(’Partial autocorrelation test’,’Fontsize’,title_fontsize);
set(gca,’xtick’,[0:5:L],’ytick’,[-1,-conf_lim,0,conf_lim,1]);
The plots are shown in Figure 9.4a.
(b) Matlab Script for P = 2:
% (b1) Optimum 2nd-order linear predictor
P = 2;
[a,e,V,FPE]=arls(x,P);
Hf_2 = figure(’units’,SCRUN,’position’,SCRPOS,...
’paperunits’,PAPUN,’paperposition’,[0,0,5,3]);
set(Hf_2,’NumberTitle’,’off’,’Name’,’Pr0904b’);
L = 10; l = 0:L-1;
K = N/2; f = [0:K]/K; k = 1:K+1;
x = e;
subplot(’position’,[0.1,0.65,0.35,0.3]);
plot(n(1:100),x(1:100),’g’); axis([-1,100,-4,4]);
xlabel(’\itn’,’fontsize’,label_fontsize,’fontname’,’times’);
ylabel(’{\itx}({\itn})’,’fontsize’,label_fontsize,’fontname’,’times’);
title(’Error samples’,’Fontsize’,title_fontsize);
set(gca,’xtick’,[0:20:100],’ytick’,[-4:1:4]);
% Autocorrelation test
r = autoc(x,L+1); rho = r(1:L)/r(1);
conf_lim = 1.96/sqrt(N);
Statistical and Adaptive Signal Processing - Solution Manual 255
subplot(’position’,[0.6,0.65,0.35,0.3]);
plot([-1,L],[0,0],’w’); hold on;
Hr = stem(l,rho,’filled’,’g’);
set(Hr,’markersize’,3); axis([-1,L,-1.2,1.2]);
plot([-1,L],[-conf_lim,-conf_lim],’r:’);
plot([-1,L],[conf_lim,conf_lim],’r:’);
hold off; conf_lim = round(conf_lim*100)/100;
xlabel(’Lag \itl’,’fontsize’,label_fontsize);
ylabel(’\rho_{\itx}({\itl})’,’fontsize’,label_fontsize,’fontname’,’times’);
title(’Autocorrelation test’,’Fontsize’,title_fontsize);
set(gca,’xtick’,[0:5:L],’ytick’,[-1,-conf_lim,0,conf_lim,1]);
% PSD test
Rx = psd(x,N,2,boxcar(length(x)),’none’);
Ix = cumsum(Rx(1:K+1)); Ix = Ix/Ix(K+1);
Ibl = -1.36/sqrt(K-1) + (k-1)/(K-1);
Ibu = 1.36/sqrt(K-1) + (k-1)/(K-1);
subplot(’position’,[0.1,0.15,0.35,0.3]);
plot(f,Ix,’g’,f,Ibl,’r:’,f,Ibu,’r:’); axis([0,1,-0.2,1.2]);
xlabel(’Frequency (cycles/samp)’,’fontsize’,label_fontsize);
ylabel(’I_{\itx}({\itf})’,’fontsize’,label_fontsize,’fontname’,’times’);
title(’PSD test’,’Fontsize’,title_fontsize);
Ibl(1) = round(Ibl(1)*100)/100;
Ibu(1) = round(Ibu(1)*100)/100;
set(gca,’xtick’,[0:0.2:1],’ytick’,[Ibl(1),0,Ibu(1),1]);
set(gca,’xticklabel’,[’ 0 ’;’0.1’;’0.2’;’0.3’;’0.4’;’0.5’]);
% PARCOR test
Vx=r(1); r=r/Vx;
[a,PACS,var]=durbin(r,L); PACS = [1;PACS(1:L-1)];
conf_lim = 1.96/sqrt(N);
subplot(’position’,[0.6,0.15,0.35,0.3]);
plot([-1,L],[0,0],’w’); hold on;
Hr = stem(l(2:L),PACS(2:L),’filled’,’g’);
set(Hr,’markersize’,3); axis([-1,L,-1.2,1.2]);
plot([-1,L],[-conf_lim,-conf_lim],’r:’);
plot([-1,L],[conf_lim,conf_lim],’r:’);
hold off; conf_lim = round(conf_lim*100)/100;
xlabel(’Lag {\itl}’,’fontsize’,label_fontsize);
ylabel(’PACS’,’fontsize’,label_fontsize);
title(’Partial autocorrelation test’,’Fontsize’,title_fontsize);
set(gca,’xtick’,[0:5:L],’ytick’,[-1,-conf_lim,0,conf_lim,1]);
The plots are shown in Figure 9.4b.
Matlab Script for P = 3:
% (b2) Optimum 3rd-order linear predictor
P = 3;
[a,e,V,FPE]=arls(x,P);
256 Statistical and Adaptive Signal Processing - Solution Manual
ρx(l)
x(n)
0.12
0 0
−0.12
−1
−2
−3 −1
−4
0 20 40 60 80 100 0 5 10
n Lag l
PACS
I (f)
0.12
0
x
−0.12
0.12
0
−0.12 −1
Hf_3 = figure(’units’,SCRUN,’position’,SCRPOS,...
’paperunits’,PAPUN,’paperposition’,[0,0,5,3]);
set(Hf_3,’NumberTitle’,’off’,’Name’,’Pr0904c’);
L = 10; l = 0:L-1;
K = N/2; f = [0:K]/K; k = 1:K+1;
x = e;
subplot(’position’,[0.1,0.65,0.35,0.3]);
plot(n(1:100),x(1:100),’g’); axis([-1,100,-4,4]);
xlabel(’\itn’,’fontsize’,label_fontsize,’fontname’,’times’);
ylabel(’{\itx}({\itn})’,’fontsize’,label_fontsize,’fontname’,’times’);
title(’Error samples’,’Fontsize’,title_fontsize);
set(gca,’xtick’,[0:20:100],’ytick’,[-4:1:4]);
% Autocorrelation test
r = autoc(x,L+1); rho = r(1:L)/r(1);
conf_lim = 1.96/sqrt(N);
subplot(’position’,[0.6,0.65,0.35,0.3]);
plot([-1,L],[0,0],’w’); hold on;
Hr = stem(l,rho,’filled’,’g’);
set(Hr,’markersize’,3); axis([-1,L,-1.2,1.2]);
plot([-1,L],[-conf_lim,-conf_lim],’r:’);
plot([-1,L],[conf_lim,conf_lim],’r:’);
hold off; conf_lim = round(conf_lim*100)/100;
xlabel(’Lag \itl’,’fontsize’,label_fontsize);
ylabel(’\rho_{\itx}({\itl})’,’fontsize’,label_fontsize,’fontname’,’times’);
title(’Autocorrelation test’,’Fontsize’,title_fontsize);
set(gca,’xtick’,[0:5:L],’ytick’,[-1,-conf_lim,0,conf_lim,1]);
% PSD test
Rx = psd(x,N,2,boxcar(length(x)),’none’);
Statistical and Adaptive Signal Processing - Solution Manual 257
ρx(l)
x(n)
0.12
0 0
−0.12
−1
−2
−3 −1
−4
0 20 40 60 80 100 0 5 10
n Lag l
PACS
Ix(f)
0.12
0
−0.12
0.12
0
−0.12 −1
Ix = cumsum(Rx(1:K+1)); Ix = Ix/Ix(K+1);
Ibl = -1.36/sqrt(K-1) + (k-1)/(K-1);
Ibu = 1.36/sqrt(K-1) + (k-1)/(K-1);
subplot(’position’,[0.1,0.15,0.35,0.3]);
plot(f,Ix,’g’,f,Ibl,’r:’,f,Ibu,’r:’); axis([0,1,-0.2,1.2]);
xlabel(’Frequency (cycles/samp)’,’fontsize’,label_fontsize);
ylabel(’I_{\itx}({\itf})’,’fontsize’,label_fontsize,’fontname’,’times’);
title(’PSD test’,’Fontsize’,title_fontsize);
Ibl(1) = round(Ibl(1)*100)/100;
Ibu(1) = round(Ibu(1)*100)/100;
set(gca,’xtick’,[0:0.2:1],’ytick’,[Ibl(1),0,Ibu(1),1]);
set(gca,’xticklabel’,[’ 0 ’;’0.1’;’0.2’;’0.3’;’0.4’;’0.5’]);
% PARCOR test
Vx=r(1); r=r/Vx;
[a,PACS,var]=durbin(r,L); PACS = [1;PACS(1:L-1)];
conf_lim = 1.96/sqrt(N);
subplot(’position’,[0.6,0.15,0.35,0.3]);
plot([-1,L],[0,0],’w’); hold on;
Hr = stem(l(2:L),PACS(2:L),’filled’,’g’);
set(Hr,’markersize’,3); axis([-1,L,-1.2,1.2]);
plot([-1,L],[-conf_lim,-conf_lim],’r:’);
plot([-1,L],[conf_lim,conf_lim],’r:’);
hold off; conf_lim = round(conf_lim*100)/100;
xlabel(’Lag {\itl}’,’fontsize’,label_fontsize);
ylabel(’PACS’,’fontsize’,label_fontsize);
title(’Partial autocorrelation test’,’Fontsize’,title_fontsize);
set(gca,’xtick’,[0:5:L],’ytick’,[-1,-conf_lim,0,conf_lim,1]);
The plots are shown in Figure 9.4c.
258 Statistical and Adaptive Signal Processing - Solution Manual
L = 10; l = 0:L-1;
K = N/2; f = [0:K]/K; k = 1:K+1;
subplot(’position’,[0.1,0.65,0.35,0.3]);
plot(n(1:100),x(1:100),’g’); axis([-1,100,-4,4]);
xlabel(’\itn’,’fontsize’,label_fontsize,’fontname’,’times’);
ylabel(’{\itx}({\itn})’,’fontsize’,label_fontsize,’fontname’,’times’);
title(’Signal x(n) Samples’,’Fontsize’,title_fontsize);
set(gca,’xtick’,[0:20:100],’ytick’,[-4:1:4]);
% Autocorrelation test
r = autoc(x,L+1); rho = r(1:L)/r(1);
conf_lim = 1.96/sqrt(N);
subplot(’position’,[0.6,0.65,0.35,0.3]);
plot([-1,L],[0,0],’w’); hold on;
Hr = stem(l,rho,’filled’,’g’);
set(Hr,’markersize’,3); axis([-1,L,-1.2,1.2]);
plot([-1,L],[-conf_lim,-conf_lim],’r:’);
plot([-1,L],[conf_lim,conf_lim],’r:’);
hold off; conf_lim = round(conf_lim*100)/100;
xlabel(’Lag \itl’,’fontsize’,label_fontsize);
ylabel(’\rho_{\itx}({\itl})’,’fontsize’,label_fontsize,’fontname’,’times’);
title(’Autocorrelation Test’,’Fontsize’,title_fontsize);
set(gca,’xtick’,[0:5:L],’ytick’,[-1,-conf_lim,0,conf_lim,1]);
% PSD test
Rx = psd(x,N,2,boxcar(length(x)),’none’);
Ix = cumsum(Rx(1:K+1)); Ix = Ix/Ix(K+1);
Ibl = -1.36/sqrt(K-1) + (k-1)/(K-1);
Ibu = 1.36/sqrt(K-1) + (k-1)/(K-1);
subplot(’position’,[0.1,0.15,0.35,0.3]);
plot(f,Ix,’g’,f,Ibl,’r:’,f,Ibu,’r:’); axis([0,1,-0.2,1.2]);
Statistical and Adaptive Signal Processing - Solution Manual 259
ρx(l)
x(n)
0.12
0 0
−0.12
−1
−2
−3 −1
−4
0 20 40 60 80 100 0 5 10
n Lag l
PACS
Ix(f)
0.12
0
−0.12
0.12
0
−0.12 −1
xlabel(’Frequency (cycles/samp)’,’fontsize’,label_fontsize);
ylabel(’I_{\itx}({\itf})’,’fontsize’,label_fontsize,’fontname’,’times’);
title(’PSD Test’,’Fontsize’,title_fontsize);
Ibl(1) = round(Ibl(1)*100)/100;
Ibu(1) = round(Ibu(1)*100)/100;
set(gca,’xtick’,[0:0.2:1],’ytick’,[Ibl(1),0,Ibu(1),1]);
set(gca,’xticklabel’,[’ 0 ’;’0.1’;’0.2’;’0.3’;’0.4’;’0.5’]);
% PARCOR test
Vx=r(1); r=r/Vx;
[a,PACS,var]=durbin(r,L); PACS = [1;PACS(1:L-1)];
conf_lim = 1.96/sqrt(N);
subplot(’position’,[0.6,0.15,0.35,0.3]);
plot([-1,L],[0,0],’w’); hold on;
Hr = stem(l(2:L),PACS(2:L),’filled’,’g’);
set(Hr,’markersize’,3); axis([-1,L,-1.2,1.2]);
plot([-1,L],[-conf_lim,-conf_lim],’r:’);
plot([-1,L],[conf_lim,conf_lim],’r:’);
hold off; conf_lim = round(conf_lim*100)/100;
xlabel(’Lag {\itl}’,’fontsize’,label_fontsize);
ylabel(’PACS’,’fontsize’,label_fontsize);
title(’Partial Autocorrelation Test’,’Fontsize’,title_fontsize);
set(gca,’xtick’,[0:5:L],’ytick’,[-1,-conf_lim,0,conf_lim,1]);
The plots are shown in Figure 9.5a.
(b) The signal x(n) is processed through the AR(1) filter
1
H (z) =
1 + 0.95z −1
to generate y(n). Matlab Script for the whiteness of y(n):
% (b) Whiteness of y(n)
260 Statistical and Adaptive Signal Processing - Solution Manual
bH = 1; aH = [1,0.95];
y = filter(bH,aH,x);
Hf_2 = figure(’units’,SCRUN,’position’,SCRPOS,...
’paperunits’,PAPUN,’paperposition’,[0,0,5,3]);
set(Hf_2,’NumberTitle’,’off’,’Name’,’Pr0905b’);
L = 10; l = 0:L-1;
K = N/2; f = [0:K]/K; k = 1:K+1;
x = y;
subplot(’position’,[0.1,0.65,0.35,0.3]);
plot(n(1:100),x(1:100),’g’); axis([-1,100,-4,4]);
xlabel(’\itn’,’fontsize’,label_fontsize,’fontname’,’times’);
ylabel(’{\itx}({\itn})’,’fontsize’,label_fontsize,’fontname’,’times’);
title(’Signal y(n) samples’,’Fontsize’,title_fontsize);
set(gca,’xtick’,[0:20:100],’ytick’,[-4:1:4]);
% Autocorrelation test
r = autoc(x,L+1); rho = r(1:L)/r(1);
conf_lim = 1.96/sqrt(N);
subplot(’position’,[0.6,0.65,0.35,0.3]);
plot([-1,L],[0,0],’w’); hold on;
Hr = stem(l,rho,’filled’,’g’);
set(Hr,’markersize’,3); axis([-1,L,-1.2,1.2]);
plot([-1,L],[-conf_lim,-conf_lim],’r:’);
plot([-1,L],[conf_lim,conf_lim],’r:’);
hold off; conf_lim = round(conf_lim*100)/100;
xlabel(’Lag \itl’,’fontsize’,label_fontsize);
ylabel(’\rho_{\itx}({\itl})’,’fontsize’,label_fontsize,’fontname’,’times’);
title(’Autocorrelation test’,’Fontsize’,title_fontsize);
set(gca,’xtick’,[0:5:L],’ytick’,[-1,-conf_lim,0,conf_lim,1]);
% PSD test
Rx = psd(x,N,2,boxcar(length(x)),’none’);
Ix = cumsum(Rx(1:K+1)); Ix = Ix/Ix(K+1);
Ibl = -1.36/sqrt(K-1) + (k-1)/(K-1);
Ibu = 1.36/sqrt(K-1) + (k-1)/(K-1);
subplot(’position’,[0.1,0.15,0.35,0.3]);
plot(f,Ix,’g’,f,Ibl,’r:’,f,Ibu,’r:’); axis([0,1,-0.2,1.2]);
xlabel(’Frequency (cycles/samp)’,’fontsize’,label_fontsize);
ylabel(’I_{\itx}({\itf})’,’fontsize’,label_fontsize,’fontname’,’times’);
title(’PSD test’,’Fontsize’,title_fontsize);
Ibl(1) = round(Ibl(1)*100)/100;
Ibu(1) = round(Ibu(1)*100)/100;
set(gca,’xtick’,[0:0.2:1],’ytick’,[Ibl(1),0,Ibu(1),1]);
set(gca,’xticklabel’,[’ 0 ’;’0.1’;’0.2’;’0.3’;’0.4’;’0.5’]);
% PARCOR test
Vx=r(1); r=r/Vx;
Statistical and Adaptive Signal Processing - Solution Manual 261
ρx(l)
x(n)
0.12
0 0
−0.12
−1
−2
−3 −1
−4
0 20 40 60 80 100 0 5 10
n Lag l
PACS
Ix(f)
0.12
0
−0.12
0.12
0
−0.12 −1
where A is real positive constant, θ is unformly distributed between [0, 2π ], ω0 is a constant between [0, π ],
and w(n)˜WGN(0, 1) that is uncorrelated with θ.
.. .. .. .. ..
. . . . .
e− j Pω0 e− j ( P−1)ω0 e− j ( P−2)ω0 ··· 1
Hence
Rx = A2 eeH + σ 2w I
(b) To be completed
(c) To be completed
9.7 An AR(2) process y(n) is observed in noise v(n) to obtain x(n), that is,
(a) Matlab script to compute and plot the true spectrum R(e j ω ):
% (a) Plot of the true spectrum of x(n)
b = [1]; a = [1,-1.27,0.81]; % AR(2) signal y(n) parameters
Rv = 10; sigv = sqrt(Rv); % Additive noise variance
omg = [0:500]*pi/500; % 501 frequency points over 0 to pi
H = freqz(b,a,omg); % AR(2) filter response
Ry = abs(H).*abs(H); % Spectrum of y(n)
Rx = Ry + Rv; % Spetcrum of x(n)
Rx_db = 10*log10(Rx); % Spectrum in dB
Hf_1 = figure(’units’,SCRUN,’position’,SCRPOS,...
’paperunits’,PAPUN,’paperposition’,[0,0,6,4]);
Statistical and Adaptive Signal Processing - Solution Manual 263
set(Hf_1,’NumberTitle’,’off’,’Name’,’Pr0907’);
subplot(2,2,1);
plot(omg/pi,Rx_db,’g’);
title(’True Spectrum’,’fontsize’,title_fontsize);
%xlabel(’normalized frequency’,’fontsize’,label_fontsize);
ylabel(’R_x(e^{j\omega}) in dB’,’fontsize’,label_fontsize);
axis([0,1,floor(min(Rx_db)/10)*10,ceil(max(Rx_db)/10)*10]);
text(0.6,15,’R_v = 10’,’fontsize’,text_fontsize);
The plot is shown in Figure 9.7.
(b) LS estimate of power spectrum using forward-backward linear predictor with P = 2 and σ 2v = 1:
% (b) Spectrum Estimation using LS (FB-predictor) Approach (Rv = 1)
N = 256; n = 0:N-1;
Rv = 1; sigv = sqrt(Rv);
P = 2;
18
5
Rx(ejω) in dB
16 Rv = 1
Rx(ejω)
Rv = 10 0
14
−5
12
10 −10
0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1
30
5
20
Rv = 10
Rx(ejω)
Rx(ejω)
0 10
Rv = 1
0
−5
−10
−10 −20
0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1
normalized frequency normalized frequency
Figure 9.7: Plots of various spectra in P9.7
Rxhatdbmin = 0; Rxhatdbmax = 0;
for i = 1:M
% Generate y(n) and x(n)
w = randn(N,1);
y = filter(b,a,w);
v = sigv*randn(N,1);
x = y + v;
% Estimate model parameters
[ahat,VarP] = armodcov(x,P);
Hhat = freqz(b,[1;ahat]’,omg);
Rxhat = abs(Hhat).*abs(Hhat);
Rxhat_db = 10*log10(Rxhat);
Rxhatdbmin = min([Rxhatdbmin,min(Rxhat_db)]);
Rxhatdbmax = max([Rxhatdbmax,max(Rxhat_db)]);
plot(omg/pi,Rxhat_db,’g’); hold on;
end
title(’Estimated Spectrum’,’fontsize’,title_fontsize);
xlabel(’normalized frequency’,’fontsize’,label_fontsize);
ylabel(’R_x(e^{j\omega})’,’fontsize’,label_fontsize);
axis([0,1,floor(Rxhatdbmin/10)*10,ceil(Rxhatdbmax/10)*10]);
text(0.6,2,[’R_v = ’,num2str(Rv)],’fontsize’,text_fontsize);
The plot is shown in Figure 9.7.
(d) The effect of subtracting a small amount of noise from r x (0) on the LS estimate of power spectrum using
forward-backward linear predictor with P = 2 and σ 2v = 1:
% (d) Spectrum Estimation using LS (FB-predictor) Approach (Rv = 1)
Statistical and Adaptive Signal Processing - Solution Manual 265
N = 256; n = 0:N-1;
Rv = 1; sigv = sqrt(Rv);
P = 2;
9.8 The first five estimated correlation lag values of a process x(n) are
rx = [1;0.75;0.5;0.25;0]; L = length(rx);
Hf_1 = figure(’units’,SCRUN,’position’,SCRPOS,...
’paperunits’,PAPUN,’paperposition’,[0,0,6,4]);
266 Statistical and Adaptive Signal Processing - Solution Manual
Rx(ejω) 3 3
Rx(ejω)
2 2
1 1
0 0
0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1
normalized frequency
AP(4) Spectral Estimates
2
1.5
Rx(ejω)
0.5
0
0 0.2 0.4 0.6 0.8 1
normalized frequency
Figure 9.8: Plots of various spectra in P9.8
set(Hf_1,’NumberTitle’,’off’,’Name’,’Pr0908’);
subplot(2,2,1);
plot(omg/pi,RxBT,’g’,’linewidth’,1);
title(’Blackman-Tuckey Estimates’,’fontsize’,title_fontsize);
%xlabel(’normalized frequency’,’fontsize’,8);
ylabel(’R_x(e^{j\omega})’,’fontsize’,label_fontsize);
axis([0,1,floor(min(RxBT)/1.0)*1.0,ceil(max(RxBT)/1.0)*1.0]);
9.9 The narrowband process x(n) is generated using the AP(4) model
1
H (z) =
1+ 0.98z −1 + 1.92z −2 + 0.94z −3 + 0.92z −4
driven by WGN(0, 0.001).
(a) Matlab script to compute and plot the true spectrum R(e j ω ):
% (a) Plot of the true spectrum of x(n)
b = [1]; a = [1,0.98,1.92,0.94,0.92]; % AP(4) signal y(n) parameters
omg = [0:500]*pi/500; % 501 frequency points over 0 to pi
H = freqz(b,a,omg); % AP(4) filter response
Rx = abs(H).*abs(H); % Spectrum of x(n)
Rx = 10*log10(Rx); % Spectrum in dB
Hf_1 = figure(’units’,SCRUN,’position’,SCRPOS+[0,0,0,0.2],...
’paperunits’,PAPUN,’paperposition’,[0,0,6,6]);
set(Hf_1,’NumberTitle’,’off’,’Name’,’Pr0909’);
subplot(3,2,1);
plot(omg/pi,Rx,’g’); title(’True Spectrum’,’fontsize’,title_fontsize);
%xlabel(’normalized frequency’,’fontsize’,label_fontsize);
ylabel(’R_x(e^{j\omega})’,’fontsize’,label_fontsize);
axis([0,1,floor(min(Rx)/10)*10,ceil(max(Rx)/10)*10]);
The plot is shown in Figure 9.9.
(b) LS estimate of power spectrum using forward linear predictor with P = 4:
% (b) Spectrum Estimation using LS (Forward-predictor) Approach (P = 4)
N = 256; n = 0:N-1;
P = 4;
20 20
Rx(ejω)
Rx(ejω)
10 10
0 0
−10 −10
−20 −20
0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1
20 20
Rx(ejω)
Rx(ejω)
10 10
0 0
−10 −10
−20 −20
0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1
20 20
Rx(ejω)
Rx(ejω)
10 10
0 0
−10 −10
−20 −20
0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1
normalized frequency normalized frequency
Figure 9.9: Plots of various spectra in P9.9
% Generate x(n)
w = randn(N,1);
x = filter(b,a,w);
% Estimate model parameters
Rbar = lsmatrix(x,P+1); [ahat,VarP] = olsigest(Rbar,1);
%[ahat,VarP] = armodcov(x,P);
Hhat = freqz(b,[1;ahat]’,omg);
Rxhat = abs(Hhat).*abs(Hhat); Rxhat = 10*log10(Rxhat);
plot(omg/pi,Rxhat,’g’); hold on;
end
title(’Estimated Spectrum (P = 4)’,’fontsize’,title_fontsize);
%xlabel(’normalized frequency’,’fontsize’,label_fontsize);
ylabel(’R_x(e^{j\omega})’,’fontsize’,label_fontsize);
axis([0,1,floor(min(Rx)/10)*10,ceil(max(Rx)/10)*10]);
The plot is shown in Figure 9.9.
(c) LS estimate of power spectrum using forward linear predictor with P = 8 and P = 12:
Statistical and Adaptive Signal Processing - Solution Manual 269
subplot(3,2,5);
plot(omg/pi,Rx,’g’); title(’True Spectrum’,’fontsize’,title_fontsize);
xlabel(’normalized frequency’,’fontsize’,label_fontsize);
ylabel(’R_x(e^{j\omega})’,’fontsize’,label_fontsize);
axis([0,1,floor(min(Rx)/10)*10,ceil(max(Rx)/10)*10]);
subplot(3,2,6);
for i = 1:M
% Generate x(n)
w = randn(N,1);
x = filter(b,a,w);
% Estimate model parameters
[ahat,VarP] = armodcov(x,P);
Hhat = freqz(b,[1;ahat]’,omg);
Rxhat = abs(Hhat).*abs(Hhat); Rxhat = 10*log10(Rxhat);
plot(omg/pi,Rxhat,’g’); hold on;
end
title(’Estimated Spectrum (FB, P = 4)’,’fontsize’,title_fontsize);
xlabel(’normalized frequency’,’fontsize’,label_fontsize);
ylabel(’R_x(e^{j\omega})’,’fontsize’,label_fontsize);
axis([0,1,floor(min(Rx)/10)*10,ceil(max(Rx)/10)*10]);
The plot is shown in Figure 9.9.
(a) Matlab script to compute and plot the true spectrum R(e j ω ):
% (a) Plot of the true spectrum of x(n)
b = [1,0,-1]; a = [1,0,0,0,0.41]; % AP(4) signal y(n) parameters
omg = [0:500]*pi/500; % 501 frequency points over 0 to pi
H = freqz(b,a,omg); % AP(4) filter response
Rx = abs(H).*abs(H); % Spectrum of x(n)
Rx = 10*log10(Rx + eps); % Spectrum in dB
Hf_1 = figure(’units’,SCRUN,’position’,SCRPOS+[0,0,0,0],...
’paperunits’,PAPUN,’paperposition’,[0,0,6,4]);
set(Hf_1,’NumberTitle’,’off’,’Name’,’Pr0910’);
subplot(2,2,1);
plot(omg/pi,Rx,’g’);
title(’True Spectrum’,’fontsize’,title_fontsize);
%xlabel(’normalized frequency’,’fontsize’,label_fontsize);
ylabel(’R_x(e^{j\omega})’,’fontsize’,label_fontsize);
axis([0,1,-50,20]);
The plot is shown in Figure 9.10.
Statistical and Adaptive Signal Processing - Solution Manual 271
10 10
0 0
Rx(ejω)
Rx(ejω)
−10 −10
−20 −20
−30 −30
−40 −40
−50 −50
0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1
normalized frequency
Est. Spec. NL LS−PZ Method (4,2)
20
10
0
Rx(ejω)
−10
−20
−30
−40
−50
0 0.2 0.4 0.6 0.8 1
normalized frequency
Figure 9.10: Plots of various spectra in P9.10
(b) LS estimate of power spectrum using forward-backward linear predictor with P = 12:
% (b) Spectrum Estimation using LS (Forward-predictor) Approach (P = 12)
N = 256; n = 0:N-1;
P = 12;
where w(n)˜WGN(0, 1) and θ 1 and θ 2 are IID random variables uniformly distributed over [0, 2π ].
(a) Matlab script to compute and plot the true spectrum R(e j ω ):
% (a) Plot of the true spectrum of x(n)
omg1 = pi/3; omg2 = 2*pi/3;
omg = [0:300]*pi/300; % 301 frequency points over 0 to pi
Rx = 2*(1-cos(2*omg)); % Spectrum of x(n)
Hf_1 = figure(’units’,SCRUN,’position’,SCRPOS+[0,0,0,0],...
’paperunits’,PAPUN,’paperposition’,[0,0,6,4]);
set(Hf_1,’NumberTitle’,’off’,’Name’,’Pr0911a’);
subplot(2,2,1);
plot(omg/pi,Rx,’g’);
title(’True Spectrum’,’fontsize’,title_fontsize);
%xlabel(’normalized frequency’,’fontsize’,label_fontsize);
ylabel(’R_x(e^{j\omega})’,’fontsize’,label_fontsize);
axis([0,1,0,5]); hold on;
plot([omg1/pi,omg1/pi],[0,4],’c’);
fill([1/3-0.03,1/3+0.03,1/3,1/3-0.03]’,[4,4,4+0.3,4]’,’c’);
plot([omg2/pi,omg2/pi],[0,4],’m’);
fill([2/3-0.03,2/3+0.03,2/3,2/3-0.03]’,[4,4,4+0.3,4]’,’m’);
Statistical and Adaptive Signal Processing - Solution Manual 273
set(gca,’xtick’,[0,1/3,2/3,1]);
set(gca,’xticklabel’,[’ 0 ’;’ 1/3’;’ 2/3’;’ 1 ’])
The plot is shown in Figure 9.11a.
(b) LS estimate of power spectrum using forward-backward linear predictor with P = 10, 20, and40:
% Generate x(n)
N = 256; n = [0:N-1]’;
w = randn(N,1); y = filter([1,0,-1],1,w);
x = y + cos(pi*n/3+rand(1)*2*pi) + cos(2*pi*n/3+rand(1)*2*pi);
subplot(2,2,2);
plot(omg/pi,Rxhat,’g’); hold on;
title(’Est. Spec. LS FB Method (P = 10)’,’fontsize’,title_fontsize);
%xlabel(’normalized frequency’,’fontsize’,label_fontsize);
ylabel(’R_x(e^{j\omega})’,’fontsize’,label_fontsize); %axis([0,1,-50,20]);
set(gca,’xtick’,[0,1/3,2/3,1]);
set(gca,’xticklabel’,[’ 0 ’;’ 1/3’;’ 2/3’;’ 1 ’])
subplot(2,2,3);
plot(omg/pi,Rxhat,’g’); hold on;
title(’Est. Spec. LS FB Method (P = 20)’,’fontsize’,title_fontsize);
xlabel(’normalized frequency’,’fontsize’,label_fontsize);
ylabel(’R_x(e^{j\omega})’,’fontsize’,label_fontsize); %axis([0,1,-50,20]);
set(gca,’xtick’,[0,1/3,2/3,1]);
set(gca,’xticklabel’,[’ 0 ’;’ 1/3’;’ 2/3’;’ 1 ’])
subplot(2,2,4);
plot(omg/pi,Rxhat,’g’); hold on;
title(’Est. Spec. LS FB Method (P = 40)’,’fontsize’,title_fontsize);
274 Statistical and Adaptive Signal Processing - Solution Manual
4
10
Rx(ejω)
Rx(ejω)
3
2
5
1
0 0
0 1/3 2/3 1 0 1/3 2/3 1
25 100
20 80
Rx(ejω)
Rx(ejω)
15 60
10 40
5 20
0 0
0 1/3 2/3 1 0 1/3 2/3 1
normalized frequency normalized frequency
Figure 9.11a: Plots of various spectra in P9.11a and b
xlabel(’normalized frequency’,’fontsize’,label_fontsize);
ylabel(’R_x(e^{j\omega})’,’fontsize’,label_fontsize); %axis([0,1,-50,20]);
set(gca,’xtick’,[0,1/3,2/3,1]);
set(gca,’xticklabel’,[’ 0 ’;’ 1/3’;’ 2/3’;’ 1 ’])
exportfig(gcf,’p0911a.eps’,’fontmode’,’scaled’,...
’linemode’,’scaled’,’color’,’cmyk’);
The plots are shown in Figure 9.11a.
(c) Nonlinear LS estimate of power spectrum using pole-zero modeling algorithm with P = 4 and Q = 2:
% (c) Spectrum Estimation usinf NL PZ modeling algorithm of Sec. 9.3.3
Hf_2 = figure(’units’,SCRUN,’position’,SCRPOS+[0,0,0,0],...
’paperunits’,PAPUN,’paperposition’,[0,0,6,4]);
set(Hf_2,’NumberTitle’,’off’,’Name’,’Pr0911b’);
subplot(2,2,3);
plot(omg/pi,Rx,’g’); title(’True Spectrum’,’fontsize’,title_fontsize);
xlabel(’normalized frequency’,’fontsize’,label_fontsize);
ylabel(’R_x(e^{j\omega})’,’fontsize’,label_fontsize);
axis([0,1,0,5]); hold on;
plot([omg1/pi,omg1/pi],[0,4],’c’);
fill([1/3-0.03,1/3+0.03,1/3,1/3-0.03]’,[4,4,4+0.3,4]’,’c’);
plot([omg2/pi,omg2/pi],[0,4],’m’);
fill([2/3-0.03,2/3+0.03,2/3,2/3-0.03]’,[4,4,4+0.3,4]’,’m’);
set(gca,’xtick’,[0,1/3,2/3,1]);
set(gca,’xticklabel’,[’ 0 ’;’ 1/3’;’ 2/3’;’ 1 ’])
Statistical and Adaptive Signal Processing - Solution Manual 275
4 5
Rx(ejω)
Rx(ejω)
3
3
2
2
1 1
0 0
0 1/3 2/3 1 0 0.2 0.4 0.6 0.8 1
normalized frequency normalized frequency
Figure 9.11b: Plots of various spectra in P9.11c
9.12 For large values of N , the correlation matrix obtained using no windowing tends to a Toeplitz Hermitian matrix
and as N → ∞, the matrix in fact becomes a Toeplitz Hermitian matrix. Thus the model coefficients can be
obtained by the Levinson-Durbin algorithm. Therefore, the modeling error variance estimates are given by
(7.4.21) and (7.4.16). Using Pm = σ̂ 2m , we obtain
∗
σ̂ 2m = σ̂ 2m−1 + β m−1 km−1
∗
= σ̂ 2m−1 − σ̂ 2m−1 km−1 km−1 = σ̂ 2m−1 1 − |km−1 |2
9.13 To be completed
driven by w(n)˜WGN(0, 10). The PZ model parameters are estimated by using the equation error method of
Section 9.3.1.
x = filter(b,a,w);
Model Parameters
bhat: 1.0000 -0.0254 0.2386
ahat: 1.0000 -0.2932 -0.4198
(b) Estimate of error variance:
% (b) Input variance Estimate
(a) Parameter and error variance estimation using nonlinear LS pole-zero modeling algorithm:
% Generate input and output signal of the PZ(4,2) model
N = 300;
b = [1,0.05,-0.855]; a = [1,-1.8766,2.6192,-1.6936,0.8145];
varw = 10; w = sqrt(varw)*randn(N,1);
x = filter(b,a,w);
Model Parameters
bhat: 1.0000 0.0245 -0.8911
ahat: 1.0000 -1.9019 2.6539 -1.7316 0.8217
Comparison of Spectra
40
True
PZ(4,2)
30 AP(10)
20
10
Rx(ejω) 0
−10
−20
−30
−40
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
normalized frequency
Figure 9.15: Comparison plots of various spectra in P9.15
(c) Plots:
% (c) Plots
Hf_1 = figure(’units’,SCRUN,’position’,SCRPOS,...
’paperunits’,PAPUN,’paperposition’,[0,0,5,3]);
set(Hf_1,’NumberTitle’,’off’,’Name’,’Pr0915’);
% True Spectra
omg = [0:500]*pi/500;
H = freqz(b,a,omg);
Rx = abs(H).*abs(H);
Rx = 10*log10(Rx);
plot(omg/pi,Rx,’g’);
title(’Comparison of Spectra’,’fontsize’,title_fontsize);
xlabel(’normalized frequency’,’fontsize’,label_fontsize);
ylabel(’R_x(e^{j\omega})’,’fontsize’,label_fontsize);
axis([0,1,floor(min(Rx)/10)*10,ceil(max(Rx)/10)*10]); hold on;
legend(’True’,’PZ(4,2)’,’AP(10)’)
278 Statistical and Adaptive Signal Processing - Solution Manual
9.16 To be completed
Comparison of Spectra
40
True
AP(5)
30 AP(10)
AP(50)
20
10
Rx(ejω) 0
−10
−20
−30
−40
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
normalized frequency
Figure 9.17: Comparison plots of various spectra in P9.17
legend(’True’,’AP(5)’,’AP(10)’,’AP(50)’)
The plot is shown in Figure 9.17.
Comparison of Spectra
40
Periodogram
AP(16)
30 PZ(12,6)
20
10
Rx(ejω) in dB
−10
−20
−30
−40
0 500 1000 1500 2000 2500 3000 3500 4000 4500 5000
frequency in Hz
Figure 9.18: Comparison plots of various spectra in P9.18
plot(omg/pi*Fs/2,Rx2,’m--’,’linewidth’,1);
Rxmin = min([min(Rx1),min(Rx2),min(Rx3)]);
Rxmax = max([max(Rx1),max(Rx2),max(Rx3)]);
axis([0,Fs/2,floor(Rxmin/10)*10,ceil(Rxmax/10)*10]); hold off;
legend(’Periodogram’,’AP(16)’,’PZ(12,6)’)
The plots are shown in Figure 9.18.
Nfft = max(Nfft,2*L);
Nfft = 2^(ceil(log10(Nfft)/log10(2)));
x = x-mean(x);
noverlap = L/2;
% Compute residuals
e = filter(a,1,x);
e = e - mean(e); var_e = (std(e))^2;
N = length(e);
Comparison of Spectra
40
Periodogram
LP Prewhiteing
30 PZ(12,6)
Rx(ejω) in dB 20
10
−10
−20
−30
0 1000 2000 3000 4000 5000
frequency in Hz
Figure 9.19: Comparison plots of various spectra in P9.19
% (d) Plots
% Periodogram Spectra
freq = [0:NfftP/2]*Fs/NfftP;
Rx1 = 10*log10(Rx1)-60;
plot(freq,Rx1,’g’); title(’Comparison of Spectra’,’fontsize’,10);
xlabel(’frequency in Hz’,’fontsize’,8);
ylabel(’R_x(e^{j\omega}) in dB’,’fontsize’,8); hold on;
set(gca,’xtick’,[0:1000:Fs/2],’fontsize’,6)
% LP_PREW Spectra
freq = [0:Nfft/2]*Fs/Nfft;
Rx2 = 10*log10(Rx2)-60;
plot(freq,Rx2,’m--’,’linewidth’,1.5);
Rx3 = 10*log10(Rx);
plot(omg/pi*Fs/2,Rx3,’b:’,’linewidth’,1.5);
Rxmin = min([min(Rx1),min(Rx2),min(Rx3)]);
Rxmax = max([max(Rx1),max(Rx2),max(Rx3)]);
axis([0,Fs/2,floor(Rxmin/10)*10,ceil(Rxmax/10)*10]); hold off;
legend(’Periodogram’,’LP Prewhiteing’,’PZ(12,6)’)
The plots are shown in Figure 9.19.
9.20 Consider a white noise process with variance σ 2w . The correlation matrix of this white noise process is given
by
Rx = σ 2w I .
The minimum variance distortionless response weight vector for the MVDR spectrum estimator is given by
√
M Rx−1 v ( f k )
ck =
v H ( f k ) Rx−1 v ( f k )
√
M v ( fk )
= independent of σ 2w
v ( fk ) v ( fk )
H
1
= √ v ( fk )
M
since v H ( f k ) v ( f k ) = M from (9.5.6). Therefore, the MVDR spectral estimate of the white noise process is
given by
j 2π fk
R̂ (mv)
M e = E |y (n)|2
" 2 #
= E ckH x (n)
1 H
= v ( f k ) σ 2w I v ( f k )
M
1
= σ 2w M
M
= σ 2w
where w (n) is white Gaussian noise with variance σ 2w . From pg. 167, the autocorrelation function of the
AP(1) model is
σ 2w
r x (l) = (−a1 )|l|
1 − a1 2
we see that we must solve for the inverse of the correlation matrix. The Mth order correlation matrix of the
AP(1) model is
1 −a1 a12 · · · (−a1 ) M−1
..
−a 1 −a .
σ 2w 1 1
. .
Rx = a1 2
−a1 1 .
1 − a12
.. .. ..
. . . −a1
(−a1 ) M−1 · · · · · · −a1 1
R−1 H −1
x = A D̄ A
where
1 −a1 0 ··· 0
.. ..
0 1 −a1 . .
A = ... 0 1
..
. 0
.. ..
. . −a1
0 ··· 0 1
and
Therefore,
1
D̄−1 = diag 1, 1, . . . , 1 − a12
σw2
R−1 = A H D̄−1 A
x
1 −a1 0 ··· 0
. .. ..
−a1 1 + a 2 −a1 .
1 1
. . . .
= −a1 . .
σ 2w 0 0
.. .. ..
. . . 1 + a12 −a1
0 ··· 0 −a1 1
then
1 −a1 0 ··· 0
.. ..
−a1 1 + a 2 −a1 . .
1
1 H .. ..
v H ( f ) R−1
x v(f) = v ( f ) −a1 . 0
. v(f)
σ 2w 0
.. .. ..
. . . 1 + a12 −a1
0 ··· 0 −a1 1
1
= 2 + (M − 2) 1 + a12 − a1 (M − 1) e j 2π f − a1 (M − 1) e− j 2π f
σw 2
1
= 2 + (M − 2) 1 + a12 − 2a1 (M − 1) cos 2π f
σw 2
we use Lagrange multipliers from Appendix B.2. First, we define the two functions
√
f (ck ) = ckH Rx ck g (ck ) = ckH v ( f k ) − M
where λ is the Lagrange multiplier. We then want to minimize the Lagrangian function with respect to both ck
and λ. Taking the gradient of L (ck , λ) with respect to ck and setting it to zero, we have
∇ ck L (ck , λ) = ckH Rx + λv H ( f k ) = 0
ck = −λR−1
x v ( fk ) (1)
Similarly, taking the gradient of L (ck , λ) with respect to λ and setting it to zero
√
∇ λ L (ck , λ) = ckH v ( f k ) − M = 0 (2)
286 Statistical and Adaptive Signal Processing - Solution Manual
Substituting (3) back into (1), we have the weight vector for the minimum-variance spectral estimator at the
frequency f k
√
MR−1 x v ( fk )
ck = H
v ( f k ) R−1
x v ( fk )
9.23 Recall the relation between the minimum-variance and all-pole model spectrum estimators from (9.5.22)
M H
2
1 vm ( f ) am 1
M
1
= =
?M e
R (mv) j 2π f M Pm M m=1 R (ap)
?m e j 2π f
m=1
Thus, the minimum-variance spectral estimate with a filter of length M is equal to an average of all-pole model
spectral estimates from order m = 1 to m = M. Using this relationship, the minimum-variance spectral
estimate with window length M + 1 is given by
1
M+1
1 1
=
?M+1 e j 2π f
R (mv) (ap)
?m e j 2π f
M + 1 m=1 R
1
M
1 1 1
= · (ap)
+ (ap)
?M+1 e j 2π f
M +1 R ?m e j 2π f
M + 1 m=1 R
1
M
1 1 M 1
= · (ap)
+ ·
?M+1 e j 2π f
M +1 R M + 1 M m=1 R ?m(ap) e j 2π f
1 1 M 1
= · (ap)
+ · (mv)
?M+1 e
M +1 R j 2π f M +1 R ?M e j 2π f
Therefore, the (M + 1)th order minimum-variance spectrum is equal to the Mth order minimum-variance
spectrum refined by the (M + 1)th order all-pole spectral estimate weighted by the M+1
M
and M1 , respectively.
9.24 For the Pisarenko harmonic decomposition, the pseudo-spectrum is given by
1 1
R̄ phd e j 2π f = 2 =
v H ( f ) q M Q M e j 2π f 2
where q M is the eigenvector of the correlation matrix Rx associated with the smallest eigenvalue, i.e., the noise
eigenvector. Recall that the order is chosen to be M = P + 1 where P is the number of complex exponentials.
The frequency estimates are then the P = M − 1 peaks in the pseudo-spectrum fˆ1 , fˆ2 , ... , fˆP . Using the
eigenvector/eigenvalue relation
R x q m = λm q m for m = 1, 2, . . . , M
where recall that the eigenvectors have unit-norm (qmH qm = 1). Multiplying both sides of the eigenvec-
tor/eigenvalue relation by qmH
Recall from the harmonic model, the correlation matrix from (9.6.7) is given by
P
Rx = A p v f p v H f p + σ 2w I (2)
p=1
2
where A p = α p is the power of the pth complex exponential. In the case of the Pisarenko harmonic
decomposition, we have chosen M = P+1 using our a priori knowledge of the number of complex exponentials.
In addition, the smallest eigenvalue corresponding to the noise is λ M = σ 2w . Substituting (2) into (1), we have
P
H
A p qmH v f p v f p qm + σ 2w = λm
p=1
P
2 P
2
A p qmH v f p = A p Q m e j 2π f p = λm − σ 2w
p=1 p=1
where Q m e j 2π f p is the Fourier transform of the eigenvector qm evaluated at the frequency f p . This same
equation can be written for all of the frequency estimates fˆ1 , fˆ2 , . . . , fˆP from the Pisarenko harmonic decom-
position obtained by picking the peaks in the pseudo-spectrum. Writing this set of equations in matrix form
we have
2 2 2
j 2π fˆ1 j 2π fˆ2 j 2π fˆP
Q 1 e Q1 e · · · Q1 e
2 2 2 A1 λ1 − λ M
Q e j 2π fˆ1 ˆ ˆ
Q 2 e j 2π f2 · · · Q 2 e j 2π f P
2 A 2 λ2 − λ M
. = .
.. .. .. .. ..
. . .
2 2 2 AP λ P − λM
ˆ ˆ ˆ
Q P e j 2π f1 Q P e j 2π f2 · · · Q 1 e j 2π f P
This equation can then be solved for the powers of the complex exponentials A1 , A2 , . . . , A P .
9.25 The minimum-norm pseudo-spectrum from (9.6.41) is given by
1
R̄mn e j 2π f =
v H ( f ) umn 2
where umn is the minimum-norm vector from (9.6.40)
Pw δ 1
umn =
δ 1 Pw δ 1
H
where Pw = Qw QwH is the noise subspace projection matrix, Qw is the matrix of noise eigenvectors, and
δ 1 = [1 0 · · · 0]T . This guarantees that umn is in the noise subspace. Since the complex exponentials are all
in the signal subspace which is orthogonal to the noise subspace, they are thus orthogonal to umn . Consider
the denominator of the minimum-norm pseudo-spectrum
M 2
2
v ( f ) umn = − (k−1)
H
umn (k) · e j 2π f
k=1
2
= Umn e j 2π f
where Umn e j 2π f is the Fourier transform of the minimum-norm vector umn . Converting to the z-transform
(z = e− j 2π f )
M−1
Umn (z) = umn (k + 1) z −k
k=0
288 Statistical and Adaptive Signal Processing - Solution Manual
The z-transform of the denominator of the pseudo-spectrum can then be written as the following polynomial
∗ 1
P̄mn (z) = |Umn (z)| = Umn (z) Umn
2
z∗
This (2M −1)th order polynomial has (M −1) pairs of roots with one inside and one outside the unit circle. The
peaks in the pseudo-spectrum correspond to the roots of this polynomial. Since we assume that the complex
exponentials are undamped, their roots should theoretically lie on the unit circle. Therefore, looking at the
M − 1 roots of this polynomial that lie inside the unit circle, we associate the P closest ones to the unit
circle with the P complex exponentials. The phases of these roots are then the root minimum-norm frequency
estimates. A Matlab example of the use of the root minimum-norm method is given below:
% Number of sinusoids
P = 2; % number of complex exponentials
M = 8; % number of samples in time-window
Nsamples = 128; % number of time samples to generate
Q=Q0(:,index(M:-1:1));
M
Rx = λm qm qmH (2)
m=1
M
1
R−1
x = qm qmH (3)
λ
m=1 m
where Q m e j 2π f is the Fourier transform of the mth eigenvector qm . Recall from (9.6.30) and (9.6.31) the
pseudo-spectra of the MUSIC and eigenvector methods, respectively
1
R̄music e j 2π f =
!
M
Q m e j 2π f 2
m=P+1
1
R̄ev e j 2π f =
!
M
1
2
λm Q m e j 2π f
m=P+1
If we assume that the estimated noise eigenvalues are all equal to λm = σ 2w for m = P + 1, . . . M, then
1
R̄music e j 2π f = 4 R̄ev e j 2π f (4)
σw
9.27 Recall the pseudo-spectrum from the MUSIC frequency estimation method from (9.6.30)
1 1
R̄music e j 2π f = =
!
M !
M
v H ( f ) qm 2 Q m e j 2π f 2
m=P+1 m=P+1
where Qw and Qs are matrices whose columns are the noise and signal eigenvectors of the correlation matrix,
respectively. From (9.6.7), the correlation matrix of complex exponentials in noise is
Rx = VAV H + σ 2w I
V = [v ( f 1 ) v ( f 2 ) · · · v ( f P )]
Statistical and Adaptive Signal Processing - Solution Manual 291
Using the matrix inversion lemma from Appendix A, the inverse of the correlation matrix of the harmonic
model from (4) is
1 $ 2 −1
−1 H %
R−1
x = I − V σ w A + V H
V V (5)
σ 2w
For the case of infinite signal-to-noise ratio, the matrix A−1 = 0. Therefore, the inverse of the correlation
matrix in (5) becomes
1 $ H
−1 H %
R−1 = I − V V V V
x
σ 2w
1
= I − Qs QsH
σw 2
1
= Qw QwH
σ 2w
1
= Pw
σ 2w
making use of the projection matrix relation from (9.6.16) for the subspace spanned by the signal frequency
vectors in V. Therefore, for the case of infinite signal-to-noise ratio, the inverse of the correlation matrix
becomes the noise subspace projection matrix from (3) normalized by the noise power σ 2w . Using this result
in the equations for the minimum-variance spectrum in (1)
j 2π f
M
R̂ (mv) e =
M
( f ) R−1
vH x v(f)
2
Mσ w
=
v H ( f ) Pw v ( f )
= Mσ 2w R̄music e j 2π f (6)
which is the MUSIC pseudo-spectrum from (2) weighted by Mσ 2w . Thus, the MUSIC pseudo-spectrum can
be viewed as a minimum-variance spectrum with infinite signal-to-noise ratio. Since the resolution of the
complex exponentials is related to their signal-to-noise ratios, the MUSIC pseudo-spectrum exhibits superior
resolution capability over the minimum-variance spectrum and has led to the MUSIC frequency estimation
method commonly being referred to as a superresolution technique.
9.28 If it has not been done so in your edition, this problem should be restated as:
Find the relationship between the minimum-norm pseudo-spectrum an the all-pole model spectrum in the case
of infinite signal-to-noise ratio. What are the implications of this relationship?
First, let us examine the Mth order all-pole model spectrum
(ap) j 2π f
PM
R̂ M e = H (1)
v ( f ) a M
where
$ %
a M = 1 a1(M) a2(M) · · · a (M)
M−1
292 Statistical and Adaptive Signal Processing - Solution Manual
is the vector of the Mth order all-pole model coefficients which is found by solving the following set of linear
equations
PM
0
Rx a M = .
..
0
a M = PM R−1
x δ1
where δ 1 = [1 0 · · · 0]T , i.e., the column vector with a value of unity in its first element and otherwise all
zeros. Since
a M (1) = δ 1H a M = δ 1H R−1
x δ 1 PM = 1
then
1
PM = (2)
δ 1H R−1
x δ1
and
R−1
x δ1
aM = (3)
δ 1H R−1
x δ1
Substituting (2) and (3) into the all-pole model spectrum in (1), we have
(ap) j 2π f
PM
R̂ M e =
v H ( f ) a M
δ 1H R−1
x δ1
= (4)
v H ( f ) R−1 δ 1 2
x
Rx = VAV H + σ 2w I (5)
V = [v ( f 1 ) v ( f 2 ) · · · v ( f P )]
The correlation matrix can also be written in terms of the signal and noise eigenvector and eigenvalues from
(9.6.14)
Rx = Qs s QsH + σ 2w Qw QwH
where the matrices Qs and Qw are made up of the signal and noise eigenvectors respectively
Qs = q 1 q 2 · · · q P Qw = q P+1 q P+2 · · · q M
Statistical and Adaptive Signal Processing - Solution Manual 293
and
s = diag {λ1 , . . . , λ P }
Also recall the signal and noise subspace projection matrices from (9.6.17)
Ps = Qs QsH Pw = Qw QwH
Using the matrix inversion lemma from Appendix A on the correlation matrix from (5)
1 $ 2 −1
−1 H %
R−1 = I − V σ w A + V H
V V (6)
x
σ 2w
In the case of infinite signal-to-noise ratio, A−1 = 0 and (6) becomes
1 $ H
−1 H % 1
R−1 = I − V V V V = 2 Pw (7)
x
σw2 σw
Substituting (7) into the all-pole model spectrum from (4)
(ap)
1 H
δ P
σ 2w 1 w
δ1
R̂ M e j 2π f =
1 v H ( f ) Pw δ 1 2
σ 4w
σ 2w Pw (1, 1)
= (8)
v H ( f ) Pw δ 1 2
9.29 Recall both the MUSIC and minimum-norm pseudo-spectra from (9.6.30) and (9.6.41)
1
R̄music e j 2π f =
!
M
v H ( f ) qm 2
m=P+1
1
R̄mn e j 2π f =
v H ( f ) umn 2
Pw (1, 1)2
R̄mn e j 2π f =
v H ( f ) Pw δ 1 2
M
= qm (1) v H ( f ) qm 2 (1)
m=P+1
where qm (1) is simply the first element of the mth eigenvector qm . Therefore, the minimum-norm pseudo-
spectrum has the same form as the MUSIC pseudo-spectrum where the contribution from each eigenvector
simply has an alternate weighting, namely the first element of the corresponding eigenvector.
Chapter 10
Adaptive Filters
10.1 Consider the process x(n) generated using the AR(3) model
where w(n) ∼ WGN(0, 1). We want to design a linear predictor of x(n) using the SDA algorithm. Let
(a) Determine the 3 × 3 autocorrelation matrix R of x(n), and compute its eigenvalues {λi }3i=1 .
The AR(3) model system function is given by
1
H (z) =
1 + 0.729 z −3
Hence the autocorrelation sequence of the process x(n) is
−1
−1)
−1 1 1
r x (l) = Z H (z)H (z =Z
1 + 0.729 z −3 1 + 0.729 z 3
1 1
The partial fraction expansion of 1+0.729 z −3 1+0.729 z 3
is given by
1 1 1
=
1 + 0.729 z −3 1 + 0.729 z 3 0.729 z −3 + 1.5314 + 0.729 z 3
0.7114 0.7114
= −
1 + 0.9 z −1
1 + 10
9
z −1
1 − 0.45z −1
+1.4228
1 − 0.9z −1 + 0.81z −2
1 − (5/9) z −1
−1.4228
2
1 − 10
9
z −1 + 10
9
z −2
295
296 Statistical and Adaptive Signal Processing - Solution Manual
Clearly
−1
2.1342 0 0 0 0
0 2.1342 0 0 = 0
0 0 2.1342 −1.5558 0.729
as expected.
(c) Choose the step size µ so that the resulting response is overdamped. Now implement the SDA
% Computation of eigenvalues
lambda = eig(R); lambda = lambda’;
ck(1)
0
−1
0 5 10 15 20 25 30
ck(2)
0
−1
0 5 10 15 20 25 30
1
ck(3)
−0.729
−1
0 5 10 15 20 25 30
Iteration index k
c2 = squeeze(c(2,1,:)); c2 = [0;c2];
c3 = squeeze(c(3,1,:)); c3 = [0;c3];
Hf_1 = figure(’units’,SCRUN,’position’,SCRPOS,...
’paperunits’,PAPUN,’paperposition’,[0,0,5,3]);
subplot(3,1,1); stem(k,c1,’g’,’filled’); axis([-1,N+1,-1,1]);
set(gca,’ytick’,[-1:1:1]);
ylabel(’c_k(1)’,’fontsize’,label_fontsize);
title(’Trajectories of Coefficient Vector: Overdamped case’,...
’fontsize’,title_fontsize);
subplot(3,1,2); stem(k,c2,’g’,’filled’); axis([-1,N+1,-1,1]);
set(gca,’ytick’,[-1:1:1]);
ylabel(’c_k(2)’,’fontsize’,label_fontsize);
subplot(3,1,3); stem(k,c3,’g’,’filled’); axis([-1,N+1,-1,1]);
hold on; plot([-1,N+1],[0,0],’w’);
set(gca,’ytick’,[-1,-0.729,0,1]);
xlabel(’Iteration index k’,’fontsize’,label_fontsize);
ylabel(’c_k(3)’,’fontsize’,label_fontsize);
ck(1)
0
−1
0 5 10 15 20 25 30
1
ck(2)
−1
0 5 10 15 20 25 30
2
ck(3)
0
−0.729
−2
0 5 10 15 20 25 30
Iteration index k
k = 0:N;
c1 = squeeze(c(1,1,:)); c1 = [0;c1];
c2 = squeeze(c(2,1,:)); c2 = [0;c2];
c3 = squeeze(c(3,1,:)); c3 = [0;c3];
Hf_2 = figure(’units’,SCRUN,’position’,SCRPOS,...
’paperunits’,PAPUN,’paperposition’,[0,0,5,3]);
subplot(3,1,1); stem(k,c1,’g’,’filled’); axis([-1,N+1,-1,1]);
set(gca,’ytick’,[-1:1:1]);
ylabel(’c_k(1)’,’fontsize’,label_fontsize);
title(’Trajectories of Coefficient Vector: Underdamped case’,...
’fontsize’,title_fontsize);
subplot(3,1,2); stem(k,c2,’g’,’filled’); axis([-1,N+1,-1,1]);
set(gca,’ytick’,[-1:1:1]);
ylabel(’c_k(2)’,’fontsize’,label_fontsize);
subplot(3,1,3); stem(k,c3,’g’,’filled’); axis([-1,N+1,-2,2]);
hold on; plot([-1,N+1],[0,0],’w’);
set(gca,’ytick’,[-2,-0.729,0,2]);
xlabel(’Iteration index k’,’fontsize’,label_fontsize);
ylabel(’c_k(3)’,’fontsize’,label_fontsize);
10.2 In the SDA algorithm, the index k is an iteration index and not a time index. However, we can treat it as a
time index and use the instantaneous filter coefficient vector ck to filter data at n = k. This will result in an
asymptotically optimum filter whose coefficients will converge to the optimum one. Consider the process x(n)
given in Problem 10.1.
(a) Generate 500 samples of x(n) and implement the asymptotically optimum filter. Plot the signal ŷ(n).
The design and implementation is shown in the following Matlab script and the plot is shown in Fig-
ure 10.2a.
% Generate 500 samples of AR(3) process
Statistical and Adaptive Signal Processing - Solution Manual 299
yhat(n)
0
−5
0 50 100 150 200 250 300 350 400 450 500
−5
0 50 100 150 200 250 300 350 400 450 500
sample index n
Hf_1 = figure(’units’,SCRUN,’position’,SCRPOS,...
300 Statistical and Adaptive Signal Processing - Solution Manual
yhat(n)
0
−5
0 50 100 150 200 250 300 350 400 450 500
−5
0 50 100 150 200 250 300 350 400 450 500
sample index n
’paperunits’,PAPUN,’paperposition’,[0,0,5,3]);
subplot(2,1,1);
plot(n,yhat,’g’); axis([0,N+1,-5,5]);
set(gca,’ytick’,[-5:5:5]);
ylabel(’yhat(n)’,’fontsize’,label_fontsize);
title(’Output of the Asymptotically Optimum Filter’,...
’fontsize’,title_fontsize);
subplot(2,1,2);
plot(n,x,’g’); axis([0,N+1,-5,5]);
set(gca,’ytick’,[-5:5:5]);
ylabel(’x(n)’,’fontsize’,label_fontsize);
xlabel(’sample index n’,’fontsize’,label_fontsize);
title(’AR(3) Process samples’,’fontsize’,title_fontsize);
(b) Implement the optimum filter co on the same sequence, and plot the resulting ŷ(n).
The design and implementation is shown in the following Matlab script and the plot is shown in Fig-
ure 10.2b.
% (b) Design and processing using Optimum filter
c_o = R\d;
yhat = filter([0;c_o],1,x);
Hf_2 = figure(’units’,SCRUN,’position’,SCRPOS,...
’paperunits’,PAPUN,’paperposition’,[0,0,5,3]);
subplot(2,1,1);
plot(n,yhat,’g’); axis([0,N+1,-5,5]);
set(gca,’ytick’,[-5:5:5]);
ylabel(’yhat(n)’,’fontsize’,label_fontsize);
title(’Output of the Optimum Filter’,...
’fontsize’,title_fontsize);
subplot(2,1,2);
Statistical and Adaptive Signal Processing - Solution Manual 301
plot(n,x,’g’); axis([0,N+1,-5,5]);
set(gca,’ytick’,[-5:5:5]);
ylabel(’x(n)’,’fontsize’,label_fontsize);
xlabel(’sample index n’,’fontsize’,label_fontsize);
title(’AR(3) Process samples’,’fontsize’,title_fontsize);
(c) Comment on the above two plots.
The plots are identical after the initial transients.
10.3 Consider the AR(2) process x(n) given in Example 10.3.1. We want to implement the Newton-type algorithm
for faster convergence using
(a) Using a1 = −1.5955 and a2 = 0.95, implement the above method for µ = 0.1 and c0 = 0. Plot the
locus of ck,1 versus ck,2 .
From (10.3.29) and (10.3.35) and choosing σ 2w so that σ 2x = 1, we have
2
−a1 a1
r(0) = 1, r(1) = r(0) = 0.81821, and r(2) = − a2 r(0) = 0.35545
1 + a2 1 + a2
Hence
1 0.81821 0.81821
R= , d=
0.81821 1 0.35545
The Newton-type algorithm is implemented in the Matlab script below and the plot is shown in Figure 10.3.
% Initialization
c0 = zeros(2,1);
subplot(2,2,1);
plot(c(1,:),c(2,:),’md’,c(1,:),c(2,:),’g-’); axis([0,-2*a1,-2*a2,0]);
%xlabel(’c_{k,1}’,’fontsize’,label_fontsize);
ylabel(’c_{k,2}’,’fontsize’,label_fontsize);
302 Statistical and Adaptive Signal Processing - Solution Manual
The Newton-type algorithm is implemented in the Matlab script below and the plot is shown in Figure 10.3.
% (b) a1 = -0.195, a2 = 0.95, and step-size mu = 0.1
a1 = -0.195; a2 = 0.95; mu = 0.1;
r0 = 1; % var_w selected so that var_x = 1
r1 = -(a1/(1+a2))*r0-eps,
r2 = (-a2+a1^2/(1+a2))*r0-eps,
R = toeplitz([r0,r1]); Rinv = R\eye(2);
d = [r1;r2];
c = zeros(2,100);
delP = -d;
c(:,1) = -mu*Rinv*delP;
for k = 2:100
delP = R*c(:,k-1) - d;
c(:,k) = c(:,k-1) - mu*Rinv*delP;
end
c = [c0,c];
subplot(2,2,2);
plot(c(1,:),c(2,:),’md’,c(1,:),c(2,:),’g-’); axis([0,-2*a1,-2*a2,0]);
%xlabel(’c_{k,1}’,’fontsize’,label_fontsize);
ylabel(’c_{k,2}’,’fontsize’,label_fontsize);
title(’Trajectory of c_{k,1} vs c_{k,2}, \mu = 0.1’,...
’fontsize’,title_fontsize);
set(gca,’xtick’,[0,-a1],’ytick’,[-a2,0]);grid;
text(-a1+0.005,-a2+0.05,’c_o’);
text(-a1+.03,-a2+0.7,’a_1 = -0.195’);
text(-a1+.03,-a2+0.5,’a_2 = 0.95’);
(c) Repeat parts (a) and (b), using the optimum step size for µ that results in the fastest convergence.
The optimum step-size is µ = 1. The Matlab script is shown below and the plot is shown in Figure 10.3.
% (c1) a1 = -1.5955, a2 = 0.95, and step-size mu = 1
a1 = -1.5955; a2 = 0.95; mu = 1;
Statistical and Adaptive Signal Processing - Solution Manual 303
a1 = −1.5955 a1 = −0.195
a = 0.95 a = 0.95
2 2
co co
ck,2
ck,2
−0.95 −0.95
0 1.5955 0 0.195
a1 = −1.5955 a1 = −0.195
a = 0.95 a = 0.95
2 2
co co
ck,2
ck,2
−0.95 −0.95
0 1.5955 0 0.195
ck,1 ck,1
subplot(2,2,3);
plot(c(1,:),c(2,:),’md’,c(1,:),c(2,:),’g-’); axis([0,-2*a1,-2*a2,0]);
xlabel(’c_{k,1}’,’fontsize’,label_fontsize);
ylabel(’c_{k,2}’,’fontsize’,label_fontsize);
title(’Trajectory of c_{k,1} vs c_{k,2}, \mu = 1.0’,...
’fontsize’,title_fontsize);
set(gca,’xtick’,[0,-a1],’ytick’,[-a2,0]);grid;
text(-a1+0.05,-a2+0.05,’c_o’);
text(-a1+0.3,-a2+0.7,’a_1 = -1.5955’);
text(-a1+0.3,-a2+0.5,’a_2 = 0.95’);
304 Statistical and Adaptive Signal Processing - Solution Manual
subplot(2,2,4);
plot(c(1,:),c(2,:),’md’,c(1,:),c(2,:),’g-’); axis([0,-2*a1,-2*a2,0]);
xlabel(’c_{k,1}’,’fontsize’,label_fontsize);
ylabel(’c_{k,2}’,’fontsize’,label_fontsize);
title(’Trajectory of c_{k,1} vs c_{k,2}, \mu = 1.0’,...
’fontsize’,title_fontsize);
set(gca,’xtick’,[0,-a1],’ytick’,[-a2,0]);grid;
text(-a1+0.005,-a2+0.05,’c_o’);
text(-a1+.03,-a2+0.7,’a_1 = -0.195’);
text(-a1+.03,-a2+0.5,’a_2 = 0.95’);
10.4 Consider the adaptive linear prediction of an AR(2) process x(n) using the LMS algorithm in which
where w(n) ∼ WGN(0, σ 2w ). The adaptive predictor is a second-order one given by a(n) = [a1 (n) a2 (n)]T .
(a) Implement the LMS algorithm given in Table 10.3 as a Matlab function [c,e] = lplms(x,y,mu,M,c0)
which computes filter coefficients in c and the corresponding error in e, given signal x, desired signal y,
step size mu, filter order M, and the initial coefficient vector c0.
function [c,e] = lplms(x,y,mu,M,c0)
% Computes filter coefficients in c and the corresponding error in
% e, given signal x, desired signal y, step size mu, filter order M, and
% the initialcoefficient vector c0.
%
% [c,e] = lplms(x,y,mu,M,c0)
%
% contour plots
a1p=(Lx(1):0.1:Lx(2))’;
a2p=(Ly(1):0.1:Ly(2))’;
L1=length(a1p);
L2=length(a2p);
for i=1:L1
for j=1:L2
a=[1 -a1p(i) -a2p(j)]’;
P(i,j)=a’*R*a;
end
end
%Plots
Hf_1 = figure(’units’,SCRUN,’position’,SCRPOS,...
’paperunits’,PAPUN,’paperposition’,[0,0,6,4.8],...
’NumberTitle’,’off’,’Name’,’Pr1004’);
subplot(’position’,[0.075,0.55,0.4,0.4]);
contour(a1p,a2p,P’,(1:2:20)/10); hold on;
plot(c1,c2,’r’,c1ma,c2ma,’g.’);
%plot(c1ma,c2ma,’r’,’linewidth’,1.5);
%plot(Lx,[0,0],’w:’,[0,0],Ly,’w:’,Lx,[-a1,-a1],’w:’,[-a2,-a2],[0,0],’w:’);
axis([Lx,Ly]);axis(’square’);
title(’(a) Averaged Trajectory’,’fontsize’,10);
xlabel(’c_{1}’,’fontsize’,8); ylabel(’c_{2}’,’fontsize’,8);
set(gca,’xtick’,[Lx(1),0,-a1,Lx(2)],’ytick’,[Ly(1),-a2,0,Ly(2)],...
’fontsize’,6); grid;
hold off;
subplot(’position’,[0.575,0.55,0.4,0.4]); n = 0:N-1;
plot([-1,N],[-a2,-a2],’w:’,[-1,N],[-a1,-a1],’w:’); hold on;
plot(n,c1,’c’,n,c2,’g’,’linewidth’,0.5);
Statistical and Adaptive Signal Processing - Solution Manual 307
0.95
0
c (n)
1
Coefficients
−0.9
c2
c (n)
2
−0.9
−3
−1 0 0.95 3 0 500
c1 Number of iterations (n)
µ=0.01
0.5
0.1425
0.1425
µ=0.04
0 0
0 500 0 500
Number of iterations (n) Number of iterations (n)
plot(n,c1ma,’w’,n,c2ma,’w’,’linewidth’,1);
axis([-1,N,-1.2,1.2]);
xlabel(’Number of iterations (n)’,’fontsize’,8);
ylabel(’Coefficients’,’fontsize’,8);
title(’(b) {\bf c}(n) Learning Curve’,’fontsize’,10);
set(gca,’xtick’,[0,N-1],’ytick’,[-a2,0,-a1],’fontsize’,6);
text(50, 0.5,’c_1(n)’,’fontsize’,10);
text(50,-0.5,’c_2(n)’,’fontsize’,10);
hold off;
(c) Repeat the above simulation 1000 times to obtain the learning curve, which is obtained by averaging the
squared error |e(n)|2 . Plot this curve and compare its steady-state value with the theoretical MSE.
The Matlab script file is shown below and plots are shown in Figure 10.4 (c) and (d).
subplot(’position’,[0.075,0.1,0.4,0.3]);
plot([-1,N],[varw,varw],’w:’,n,e,’g’,n,e2a,’m’); axis([-1,N,0,1.1]);
xlabel(’Number of iterations (n)’,’fontsize’,8);
title(’(c) MSE P(n) Learning Curve’,’fontsize’,10);
set(gca,’xtick’,[0,N-1],’ytick’,[0,varw,1],’fontsize’,6);
subplot(’position’,[0.575,0.1,0.4,0.3]);
plot([-1,N],[varw,varw],’w:’,n,e2a,’g’,n,em2a,’c’); axis([-1,N,0,1]);
308 Statistical and Adaptive Signal Processing - Solution Manual
10.5 Consider the adaptive echo canceler given in Figure 10.25. The FIR filter co (n) is given by
In this simulation, ignore the far-end signal u(n). The data signal x(n) is a zero-mean, unit-variance white
Gaussian process, and y(n) is its echo.
We will first need the Matlab function firlms to implement the LMS algorithm which is given below.
(a) Generate 1000 samples of x(n) and determine y(n). Use these signals to obtain a fourth-order LMS
echo canceler in which the step size µ is chosen to satisfy (10.4.40) and c(0) = 0. Obtain the final echo
canceler coefficients and compare them with the true ones.
The Matlab script is given below.
Statistical and Adaptive Signal Processing - Solution Manual 309
MSE
1.5
0.5
0
0 200 400 600 800 1000
Number of iterations (n)
(b) Repeat the above simulation 500 times, and obtain the learning curve. Plot this curve along with the
actual MSE and comment on the plot.
The Matlab script is given below and the learning curve is shown in Figure 10.5b.
% (b) Monte-Carlo analysis and the learning curve
Nsim = 500; N = 1000; M = 4; mu = 0.005; c0 = zeros(M,1);
eavg = zeros(1,N,Nsim);
cavg = zeros(M,N,Nsim);
for k = 1:Nsim
x = randn(N,1);y = filter(co,1,x);
[c,e] = firlms(x,y,mu,M,c0);
cavg(:,:,k) = c;
eavg(:,:,k) = e;
end
cavg = mean(cavg,3);
eavg = eavg.^2; eavg = mean(eavg,3);
310 Statistical and Adaptive Signal Processing - Solution Manual
% Theoretical analysis
n = 1:N; alpha = (1-4*mu+4*mu*mu*M);
ethe = var_y*alpha.^n;
% Plots
Hf_1 = figure(’units’,SCRUN,’position’,SCRPOS,...
’paperunits’,PAPUN,’paperposition’,[0,0,5,2],...
’NumberTitle’,’off’,’Name’,’Pr1005’);
subplot(’position’,[0.1,0.15,0.85,0.7]);
plot(n,ethe,’g-.’,n,eavg,’r’);axis([0,N,0,3]);
xlabel(’Number of iterations (n)’,’fontsize’,label_fontsize);
title(’MSE Learning Curve’,’fontsize’,title_fontsize);
ylabel(’MSE’,’fontsize’,label_fontsize);
set(gca,’xtick’,[0:200:N],’ytick’,[0:0.5:3]);
legend(’Actual MSE’,’Computed MSE’,1);
(c) Repeat parts (a) and (b), using a third-order echo canceler.
Modify above Matlab scripts to obtain the necessary results.
(d) Repeat parts (a) and (b), using one-half the value of µ used in the first part.
Modify above Matlab scripts to obtain the necessary results.
10.6 The normalized LMS (NLMS) algorithm is given in (10.4.67), in which the effective step size is time-varying
and is given by µ̃/)x(n))2 , where 0 < µ̃ < 1.
(a) Modify the function firlms to implement the NLMS algorithm and obtain the function [c,e] =
nfirlms(x,y,mu,M,c0).
% Computation of EM(n)
Statistical and Adaptive Signal Processing - Solution Manual 311
0.95
0
c (n)
1
Coefficients
−0.9
c2
c (n)
2
−0.9
−3
−1 0 0.95 3 0 500
c1 Number of iterations (n)
µ=0.04 (LMS)
0.5
0.1425
0.1425
µ=0.1 (NLMS)
0 0
0 500 0 500
Number of iterations (n) Number of iterations (n)
Figure 10.6b: Plots of the NLMS learning curve and its comparison with LMS in Problem 10.6b
w = abs(x).*abs(x);
b = [1,zeros(1,M-1),-1]; a = [1,-1];
EM = filter(b,a,w);
% contour plots
a1p=(Lx(1):0.1:Lx(2))’;
a2p=(Ly(1):0.1:Ly(2))’;
L1=length(a1p);
L2=length(a2p);
for i=1:L1
for j=1:L2
a=[1 -a1p(i) -a2p(j)]’;
P(i,j)=a’*R*a;
end
end
%Plots
Hf_1 = figure(’units’,SCRUN,’position’,SCRPOS,...
’paperunits’,PAPUN,’paperposition’,[0,0,6,4.8],...
’NumberTitle’,’off’,’Name’,’Pr1006a’);
subplot(’position’,[0.075,0.55,0.4,0.4]);
contour(a1p,a2p,P’,(1:2:20)/10); hold on;
plot(cm1,cm2,’r’,cm1ma,cm2ma,’g.’);
%plot(c1ma,c2ma,’r’,’linewidth’,1.5);
%plot(Lx,[0,0],’w:’,[0,0],Ly,’w:’,Lx,[-a1,-a1],’w:’,[-a2,-a2],[0,0],’w:’);
axis([Lx,Ly]);axis(’square’);
title(’(a) Averaged Trajectory’,’fontsize’,10);
xlabel(’c_{1}’,’fontsize’,8); ylabel(’c_{2}’,’fontsize’,8);
set(gca,’xtick’,[Lx(1),0,-a1,Lx(2)],’ytick’,[Ly(1),-a2,0,Ly(2)],...
’fontsize’,6); grid;
hold off;
subplot(’position’,[0.575,0.55,0.4,0.4]); n = 0:N-1;
plot([-1,N],[-a2,-a2],’w:’,[-1,N],[-a1,-a1],’w:’); hold on;
plot(n,cm1,’c’,n,cm2,’g’,’linewidth’,0.5);
plot(n,cm1ma,’w’,n,cm2ma,’w’,’linewidth’,1);
axis([-1,N,-1.2,1.2]);
xlabel(’Number of iterations (n)’,’fontsize’,8);
ylabel(’Coefficients’,’fontsize’,8);
title(’(b) {\bf c}(n) Learning Curve’,’fontsize’,10);
set(gca,’xtick’,[0,N-1],’ytick’,[-a2,0,-a1],’fontsize’,6);
text(50, 0.5,’c_1(n)’,’fontsize’,10);
text(50,-0.5,’c_2(n)’,’fontsize’,10);
hold off;
subplot(’position’,[0.075,0.1,0.4,0.3]);
plot([-1,N],[varw,varw],’w:’,n,em,’g’,n,em2a,’m’); axis([-1,N,0,1.1]);
xlabel(’Number of iterations (n)’,’fontsize’,8);
title(’(c) MSE P(n) Learning Curve’,’fontsize’,10);
set(gca,’xtick’,[0,N-1],’ytick’,[0,varw,1],’fontsize’,6);
314 Statistical and Adaptive Signal Processing - Solution Manual
subplot(’position’,[0.575,0.1,0.4,0.3]);
plot([-1,N],[varw,varw],’w:’,n,e2a,’g’,n,em2a,’c’); axis([-1,N,0,1]);
xlabel(’Number of iterations (n)’,’fontsize’,8);
title(’(d) Step-size effect on MSE’,’fontsize’,10);
set(gca,’xtick’,[0,N-1],’ytick’,[0,varw,0.5,1],’fontsize’,6);
text(30,0.1,’\mu=0.1 (NLMS)’,’fontsize’,8);
text(50,0.7,’\mu=0.04 (LMS)’,’fontsize’,8);
(c) Choose µ̃ = 0.1 and repeat Problem 10.5(a) and (b). Compare your results in terms of convergence
speed.
The Matlab script is shown below and the plots in Figure 10.6c. From the plots we again observe that the
NLMS has the faster convergence.
% (c) NLMS for Echo Cancellation
% Data signal x(n): zero-mean, unit-variance white Gaussian process
% Echo System: co(n) = 0.9^n, 0 <= n <= 2
% Echo signal: y(n) = conv(x(n),co(n))
eavg = zeros(1,N,Nsim);
cavg = zeros(M,N,Nsim);
for k = 1:Nsim
x = randn(N+M,1);y = filter(co,1,x);
[c,e] = nfirlms(x,y,mu,M,c0);
cavg(:,:,k) = c;
eavg(:,:,k) = e;
end
cavg = mean(cavg,3);
Statistical and Adaptive Signal Processing - Solution Manual 315
MSE
1.5
0.5
0
0 200 400
Number of iterations (n)
Figure 10.6c: Plots of the NLMS learning curve and its comparison with LMS in Problem 10.6c
% Theoretical analysis
muo = 0.005;
n = 0:N; alpha = (1-4*muo+4*muo*muo*M);
ethe = var_y*alpha.^n;
% Plots
Hf_2 = figure(’units’,SCRUN,’position’,SCRPOS,...
’paperunits’,PAPUN,’paperposition’,[0,0,5,2],...
’NumberTitle’,’off’,’Name’,’Pr1006c’);
subplot(’position’,[0.1,0.15,0.85,0.7]);
plot(n,ethe,’g-.’,n,eavg,’r’); axis([0,N,0,3]);
xlabel(’Number of iterations (n)’,’fontsize’,label_fontsize);
title(’MSE Learning Curve’,’fontsize’,title_fontsize);
ylabel(’MSE’,’fontsize’,label_fontsize);
set(gca,’xtick’,[0:200:N],’ytick’,[0:0.5:3]);
legend(’Actual LMS MSE’,’Computed NLMS MSE’,1)
10.7 Another variation of the LMS algorithm is called the sign-error LMS algorithm, in which the coefficient update
equation is given by
1 Re[e(n)] > 0
sgn [e(n)] = 0 Re[e(n)] = 0
−1 Re[e(n)] < 0
(a) Modify the function firlms to implement the NLMS algorithm and obtain the function [c,e] = se-
firlms(x,y,mu,M,c0).
% e, given signal x, desired signal y, step size mu, filter order M, and
% the initial coefficient vector c0.
%
% [c,e] = sefirlms(x,y,mu,M,c0)
%
0.95
0
c (n)
1
Coefficients
−0.9
c2
c (n)
2
−0.9
−3
−1 0 0.95 3 0 500
c1 Number of iterations (n)
0.5
µ=0.01 (LMS)
0.1425
0.1425
µ=0.01 (NLMS)
0 0
0 500 0 500
Number of iterations (n) Number of iterations (n)
Figure 10.7b: Plots of the SELMS learning curve and its comparison with LMS in Problem 10.7b
em(n) = x(n)-cm1(n-1)*x(n-1)-cm2(n-1)*x(n-2);
cm1(n) = cm1(n-1)+2*mum*sign(em(n))*x(n-1);
cm2(n) = cm2(n-1)+2*mum*sign(em(n))*x(n-2);
end
c1m = c1m+c1; c2m = c2m+c2; e2 = e2+e.^2;
cm1m = cm1m+cm1; cm2m = cm2m+cm2; em2 = em2+em.^2;
end
% contour plots
a1p=(Lx(1):0.1:Lx(2))’;
a2p=(Ly(1):0.1:Ly(2))’;
L1=length(a1p);
L2=length(a2p);
for i=1:L1
for j=1:L2
a=[1 -a1p(i) -a2p(j)]’;
P(i,j)=a’*R*a;
end
end
(c) Repeat Problem 10.5(a) and (b) and compare your results in terms of convergence speed.
The Matlab script is shown below and the plots in Figure 10.7c. From the plots we again observe that the
NLMS has the faster convergence but a higher steady-state error.
% (ca) Echo Canceller design
M = 4; % LMS filter order
N = 400; x = randn(N,1); % Generate x(n)
y = filter(co,1,x); % Generate y(n)
mu = 0.1; c0 = zeros(M,1); % Initialization
[c,e] = nfirlms(x,y,mu,M,c0); % LMS algorithm
eavg = zeros(1,N,Nsim);
cavg = zeros(M,N,Nsim);
Statistical and Adaptive Signal Processing - Solution Manual 319
MSE
1.5
0.5
0
0 200 400
Number of iterations (n)
Figure 10.7c: Plots of the SELMS learning curve and its comparison with LMS in Problem 10.7c
for k = 1:Nsim
x = randn(N+M,1);y = filter(co,1,x);
[c,e] = sefirlms(x,y,mu,M,c0);
cavg(:,:,k) = c;
eavg(:,:,k) = e;
end
cavg = mean(cavg,3);
eavg = eavg.^2; eavg = mean(eavg,3);
eavg = [var_y,eavg];
% Theoretical analysis
muo = 0.005;
n = 0:N; alpha = (1-4*muo+4*muo*muo*M);
ethe = var_y*alpha.^n;
% Plots
Hf_2 = figure(’units’,SCRUN,’position’,SCRPOS,...
’paperunits’,PAPUN,’paperposition’,[0,0,5,2],...
’NumberTitle’,’off’,’Name’,’Pr1006c’);
subplot(’position’,[0.1,0.15,0.85,0.7]);
plot(n,ethe,’g-.’,n,eavg,’r’); axis([0,N,0,3]);
xlabel(’Number of iterations (n)’,’fontsize’,label_fontsize);
title(’MSE Learning Curve’,’fontsize’,title_fontsize);
ylabel(’MSE’,’fontsize’,label_fontsize);
set(gca,’xtick’,[0:200:N],’ytick’,[0:0.5:3]);
legend(’Actual LMS MSE’,’Computed SELMS MSE’,1)
10.8 Consider an AR(1) process x(n) = ax(n − 1) + w(n), where w(n) ∼ WGN(0, σ 2w ). We wish to design a
one-step first-order linear predictor using the LMS algorithm
(a) Determine the autocorrelation r x (l), the optimum first-order linear predictor, and the corresponding
MMSE.
The z-domain SDF, Rx (z), is given by
1
Rx (z) = H (z) H (z) Rw (z) where H (z) = and Rw (z) = σ 2w
1 − a z −1
2 & '
1 1 σw 1 1
= σw
2
= − ; |a| < |z| < |a|−1
1 − a z −1 1−az 1 − a2 1 − a z −1 1 − a −1 z −1
Thus after inverse z-transformation
σ 2w |l|
r x (l) = a , ∀l
1 − a2
Now the optimum first-order linear predictor is given by
r x (1)
â = =a
r x (0)
and the MMSE is given by
σ 2w σ 2w 2
Pe = r x (0) − â r x (1) = − a = σ 2w
1 − a2 1 − a2
(b) Using the independence assumption, first determine and then solve the difference equation for E{â(n)}.
From (3), (1), and (2), we have
â(n) = â(n − 1) + 2 µ x(n) − â(n − 1) x(n − 1) x(n − 1)
= â(n − 1) + 2 µ x(n)x(n − 1) − 2 µ â(n − 1) x 2 (n − 1)
Taking expectation of both sides using the independence assumption that â(n − 1) and x(n − 1) are
mutually independent (since â(n − 1) depends only on x(m), m < n − 1), we obtain
which is first-order difference equation for E[â(n)] driven by 2 µ r x (1) for n ≥ 1 with E[â(0)] = 0. This
equation can be solved using unilateral z-transform. Substituting
in (4), we have
or
β
y(n) = 1 − α n+1 u(n)
1−α
Using (5), we obtain the solution
r x (1)
E[â(n)] = 1 − [1 − 2µ r x (0)]n u(n − 1) (7)
r x (0)
Note that as n → ∞ we have that E[â(n)] → rrxx (1)(0)
= a (as expected in the absense of noise) if
|1 − 2µ r x (0)| < 1.
(c) For a = ±0.95, µ = 0.025, σ 2x = 1, and 0 ≤ n < N = 500, determine the ensemble average of E{â(n)}
using 200 independent runs and compare with the theoretical curve obtained in part (b).
The Matlab script is shown below and the plots in Figure 10.8c.
% AR(1) process parameters and LMS parameters
a = 0.95; N = 500; n = 0:N; var_x = 1; var_w = var_x*(1 - a*a);
mu = 0.025; Nsim = 200;
eavg = zeros(1,N,Nsim);
cavg = zeros(M,N,Nsim);
for k = 1:Nsim
w = var_w*randn(N+1,1); x = filter(1,[1,-a],w);
y = x(2:end); x = x(1:N);
[c,e] = firlms(x,y,mu,M,c0);
cavg(:,:,k) = c;
eavg(:,:,k) = e;
end
cavg = mean(cavg,3); cavg = [0,cavg];
eavg = eavg.^2; eavg = mean(eavg,3);
eavg = [1,eavg];
% Theoretical analysis
alpha = 1 - 2*mu*var_x;
cthe = a*(1-alpha.^n);
% Plots
Hf_1 = figure(’units’,SCRUN,’position’,SCRPOS,...
’paperunits’,PAPUN,’paperposition’,[0,0,5,2],...
’NumberTitle’,’off’,’Name’,’Pr1008c’);
subplot(’position’,[0.1,0.15,0.85,0.7]);
plot(n,cthe,’g-.’,n,cavg,’r’); axis([0,N,0,1]);
xlabel(’Number of iterations (n)’,’fontsize’,label_fontsize);
title(’Linear-predictor Learning Curve’,’fontsize’,title_fontsize);
ylabel(’ahat(n)’,’fontsize’,label_fontsize);
set(gca,’xtick’,[0:200:N],’ytick’,[0:0.2:1]);
legend(’Theoretical’,’Averaged’,4)
322 Statistical and Adaptive Signal Processing - Solution Manual
0.8
0.6
ahat(n)
0.4
0.2
Theoretical
Averaged
0
0 200 400
Number of iterations (n)
(d) Using the independence assumption, first determine and then solve the difference equation for P(n) =
E{e2 (n)}.
An analysis similar to that in (b) can be used in this part.
(e) Repeat part (c) for P(n) and comment upon the results.
10.9 Using the a-posteriori error ε(n) = y(n) − c H (n)x(n), derive the coefficient updating formulas for the a-
posteriori error LMS algorithm.
The a-posteriori form of the LMS algorithm
or
ε(n) = I − 2µx H (n)x(n) e(n)
10.10 Solve the interference cancellation problem described in Example 6.4.1, using the LMS algorithm, and compare
its performance to that of the optimum canceler.
To be completed.
10.11 Repeat the convergence analysis of the LMS algorithm for the complex case, using formula (10.4.27) instead
of (10.4.28).
This a tedious repetition of the work in Section 10.4.2 and should be given only as a project.
Statistical and Adaptive Signal Processing - Solution Manual 323
in Section 10.4.3.
(a) Show that Ptr(total) can be written as Ptr(total) = λT (I − B)−1 +θ (0), where +θ(0) is the initial (i.e., at n = 0)
deviation of the filter coefficients from their optimum setting.
From (10.4.62) and (10.4.50) we have
∞
∞
Ptr(t ot al) = Ptr (n) = [P(n) − P(∞)]
n=0 n=0
∞ ∞
= λ [θ (n) − θ(∞)] =
T
λT Bn [θ(0) − θ(∞)]
n=0 n=0
(∞ )
= λT Bn θ (0) = λT (I − B)−1 θ(0)
n=0
!∞
where we have used (10.4.41) and n=0 Bn = (I − B)−1 , which holds when the eigenvalues of B have
magnitude less than one.
(b) Starting with the formula in step (a), show that
!
M
θ i (0)
1−2µλi
1
Ptr(total)
i=1
=
4µ !
M
µλi
1− 1−2µλi
i=1
and
4µ2
(I − B)−1 = [I − (ρ)]−1 + [I − (ρ)]−1 λλT [I − (ρ)]−1
1 − 4µ2 λT [I − (ρ)]−1 λ
Hence,
M
λi θ i (0)
−1
β = λ [I − (ρ)]
T
θ(0) =
i=1
1 − ρi
1
M
λi
α=
4µ i=1 1 − 2µλi
1 θ i (0)
M
β=
4µ i=1 1 − 2µλi
and
! M θ i (0)
1 i=1 1−2µλi
Ptrt ot al = ! M µλi
4µ 1 − i=1
1−2µλi
!
M
θ i (0)
1
M
1 i=1
Ptr(total) & & θ i (0)
4µ 1 − µ tr(R) 4µ i=1
! M−1
10.13 The frequency sampling structure for the implementation of an FIR filter H (z) = n=0 h(n) · z −n is specified
by the following relation
1 − z −M H (e j 2πk/M )
M−1
H (z) = , H1 (z) H2(z)
M k=0
1 − e j 2πk/M z −1
where H1 (z) is a comb filter with M zeros equally spaced on the unit circle and H2 (z) is a filter bank of
resonators. Note that H̃ (k) , H (e j 2πk/M ), the DFT of {h(n)}0M−1, is the coefficients of the filter. Derive an
LMS-type algorithm to update these coefficients, and sketch the resulting adaptive filter structure.
If we define
1 1 − zM
Yk (z) , X (x)
1 − e j 2πk/M z −1 M
Statistical and Adaptive Signal Processing - Solution Manual 325
we can obtain the adaptive filter structure shown in Figure 10.13. An adaptive LMS filter is obtained using the
following algorithm
M−1
ŷ(n) = ck (n − 1)yk (n)
k=0
e(n) = y(n) − ŷ(n)
ck (n) = ck (n − 1) + 2µe(n) ŷk (n)
To understand the nature of this structure, consider the frequency response of the kth parallel path of the filter
(resonator)
1 − zM
Hk (z) =
M 1 − e j 2πk/M z −1
or for z = e2π f
1 − e−2π f M e−π f M eπ f M − e−π f M
Hk (e 2π f
)=
= $ %
M 1 − e j 2πk/M e− j 2π f Me j π ( M − f ) e− j π ( M − f ) − e j π ( M − f )
k k k
which leads to
sin π M f &
Hk (e ) = 1 1, f = k
2π f
= M
M sin π Mk − f 0, f = k
M
Therefore, when
M−1
2π k
y(n) = Ak cos n
k=0
M
each coefficient of the adaptive filter can be updated without any interference from the other coefficients.
10.14 There are applications in which the use of a non-MSE criterion may be more appropriate. To this end, suppose
that we wish to design and study the behavior of an “LMS-like” algorithm that minimizes the cost function
P (k) = E{e2k (n)}, k = 1, 2, 3, . . . , using the model defined in Figure 10.19.
Since the cost function is
P (k) = E e2k (n) , k = 1, 2, ...
(a) Use the instantaneous gradient vector to derive the coefficient updating formula for this LMS-like algo-
rithm.
An LMS-type algorithm is obtained using the instantaneous gradient
∂ P (k) ∂e(n)
= 2ke2k−1 (n) = −2ke2k−1 (n)x(n)
∂c ∂c
where we have used e(n) = y(n) − cT x(n). Hence
1 y0 (n)
j 2π 0 x
1−e M z −1
c0 (n − 1) y(n)
1 y1 (n)
x(n) x
1−z M
1−e
j 2π 1
M z −1
M e(n)
-
c1 (n − 1) + +
. ŷ(n)
.
.
1 y M−1 (n)
j 2π (M−1) x
1−e M z −1
c M−1 (n − 1)
Figure 10.13: Adaptive LMS filter using the frequency sampling structure.
or
when c̃(n) takes very small values, that is when the coefficients are changing very slowly.
Statistical and Adaptive Signal Processing - Solution Manual 327
c̃(n) & c̃(n − 1) + 2kµeo2k−1 (n)x(n) − (2k − 1)2µkx(n)xT (n)c̃(n − 1)eo2k−2 (n)
or
c̃(n) & I − 2µk(2k − 1)eo2k−2 (n)x(n)xT (n) c̃(n − 1) + 2µkeo2k−1 (n)x(n)
Taking the expectation of both sides and using the independence assumptions, we have
E {c̃(n)} & I − 2µk(2k − 1)E eo2k−2 (n) R E {c̃(n − 1)}
or
vi (n) & 1 − 2µk(2k − 1)E eo2k−2 (n) λi vi (n − 1)
whose solution is
n
vi (n) = 1 − 2µk(2k − 1)E eo2k−2 (n) λi vi (0)
or equivalently
1
0 < 2µ <
k(2k − 1)E eo2k−2 (n) λmax
(d) Show that for k = 1 the results in parts (a) to (c) reduce to those for the standard LMS algorithm.
For k = 1 we have
1
0 < 2µ <
λmax
which is identical to (10.4.19).
10.15 Consider the noise cancellation system shown in Figure 10.6. The useful signal is a sinusoid s(n) = cos(ω0 n +
φ), where ω0 = π/16 and the phase φ is a random variable uniformly distributed from 0 to 2π . The noise
signals are given by v1 (n) = 0.9 v1 (n − 1) + w(n) and v2 (n) = −0.75 v2 (n − 1) + w(n), where the sequences
w(n) are WGN(0, 1).
328 Statistical and Adaptive Signal Processing - Solution Manual
The input signal to the optimum/adaptive filter is v2 (n) while the “desired signal” is y(n) , s(n) + v1 (n).
Hence we will need the following correlations:
σ 2w 16
rv2 (l) = (−0.75)|l| = (−0.75)|l|
1 − (−0.75) 2 7
1 σ 2w 1 100
r y (l) = rs (l) + rv1 (l) = cos ω0l + (0.9)|l| = cos ω0l + (0.9)|l|
2 1 − (0.9) 2 2 19
r yv2 (l) = rv1 v2 (l) = h 1 (l) ∗ h 2 (−l) ∗ rw (l) = h 1 (l) ∗ h 2 (−l)
where h 1 (n) = (0.9)n u(n), h 2 (n) = (−0.75)n u(n), and rw (l) = δ(l).
(a) Design an optimum filter of length M and choose a reasonable value for Mo by plotting the MMSE as a
function of M.
The optimum filter of length M is given by
Rv2 co = r yv2
Thus the only quantity remains to be computed is r yv2 (l). Consider, for l ≥ 0
∞
r yv2 (l) = h 1 (l) ∗ h 2 (−l) = h 1 (k) h 2 (k − l)
k=−∞
∞
∞
−l
= (0.9) (−0.75)
k k−l
= (−0.75) (−0.675)k
k=l k=l
∞
= (−0.75)−l (−0.675)l (−0.675)k = 0.59701 (0.9)l , l ≥ 0
k=0
The rest of the problem is solved using Matlab. The script is given below and the plot is shown in
Figure 10.15a.
% System Parameters
omg0 = pi/16; a1 = 0.9; a2 = -0.75; var_w = 1;
MMSE
3
1
0.5
0
0 10 20 30 40 50
Filter Length M
Hf_1 = figure(’units’,SCRUN,’position’,SCRPOS,...
’paperunits’,PAPUN,’paperposition’,[0,0,5,2],...
’NumberTitle’,’off’,’Name’,’Pr1015a’);
plot([0,Mmax],[0.5,0.5],’w:’,[20,20],[0,Po(21)],...
’w:’,M,Po,’g’);
axis([0,Mmax,0,6]);
xlabel(’Filter Length M’,’fontsize’,label_fontsize);
title(’MMSE of the Noise Canceller’,’fontsize’,title_fontsize);
ylabel(’MMSE’,’fontsize’,label_fontsize);
set(gca,’xtick’,[0:10:Mmax],’ytick’,[0,0.5,1:6]);
% Choose Mo = 20;
Mo = 20;
Rv2 = toeplitz(var_v2*a2.^[0:Mo-1]);
ryv2 = (1/(1-a1*a2))*a1.^[0:Mo-1]’;
co = Rv2\ryv2;
From the plot in Figure 10.15a a reasonable value for Mo is 20.
(b) Design an LMS filter with Mo coefficients and choose the step size µ to achieve a 10 percent misadjustment.
10.16 A modification of the LMS algorithm, known as the momentum LMS (MLMS), is defined by
(a) Rewrite the previous equation to show that the algorithm has the structure of a low-pass (0 < α < 1) or
a high-pass (−1 < α < 0) filter.
The coefficient updating equation can be written as
which is a low-pass filter for 0 < α < 1 and a high-pass filter for −1 < α < 0. The structure for this
equation is given in Figure 10.16a.
(b) Explain intuitively the effect of the momentum term α[c(n − 1) − c(n − 2)] on the filter’s convergence
behavior.
The term [αc(n − 1) − c(n − 2)] = αc(n−1) adds an extra amount of change to the LMS updating term
2µx(n)e∗ (n). During the transient phase )c(n − 1)) is large and accelerates convergence. However,
the price paid is a larger amount of misadjustement in steady-state. To overcome this problem we can set
α = 0, that is we switch to the LMS algorithm, when )c(n − 1)) becomes small.
(c) Repeat the computer equalization experiment in Section 10.4.4, using both the LMS and the MLMS
algorithms for the following cases, and compare their performance:
i. W = 3.1, µlms = µmlms = 0.01, α = 0.5.
ii. W = 3.1, µlms = 0.04, µmlms = 0.01, α = 0.5.
iii. W = 3.1, µlms = µmlms = 0.04, α = 0.2.
Statistical and Adaptive Signal Processing - Solution Manual 331
−5
500 1000
−10
500 1000
−10
500 1000
−5
500 1000
−5
500 1000
sample index n
-
α
Figure 10.16a: The momentum LMS algorithm.
332 Statistical and Adaptive Signal Processing - Solution Manual
10.17 In Section 10.4.5 we presented the leaky LMS algorithm [see (10.4.88)]
(a) Show that the coefficient updating equation can be obtained by minimizing
We have
Using
we obtain
E {c(n)} = (1 − αµ)E {c(n − 1)} + µE x(n)y ∗ (n) − µE x(n)x H (n)c(n − 1)
(c) Show that if 0 < µ < 2/(α + λmax ), where λmax is the maximum eigenvalue of R, then
Rz = R + αI
Therefore, the leaky LMS algorithm is equivalent to the LMS algorithm with white noise of variance α
added to its input.
10.18 There are various communications and speech signal processing applications that require the use of filters with
linear phase (Manolakis et al. 1984). For simplicity, assume that m is even.
(a) Derive the normal equations for an optimum FIR filter that satisfies the constraints
(lp)
i. cm = Jc(lp)
m (linear phase)
(cgd)
ii. cm = −Jc(cgd)
m (constant group delay).
(lp) (cgd)
(b) Show that the obtained optimum filters can be expressed as cm = 21 (cm + Jcm ) and cm = 12 (cm − Jcm ),
where cm is the unconstrained optimum filter.
(c) Using the results in part (b) and the algorithm of Levinson, derive lattice-ladder structure for the con-
strained optimum filters.
(lp)
(d) Repeat parts (a), (b), and (c) for the linear predictor with linear phase, which is specified by am = Ja(lp)
m .
(lp)
(e) Develop an LMS algorithm for the linear-phase filter cm = Jc(lp)
m and sketch the resulting structure. Can
you draw any conclusions regarding the step size and the misadjustment of this filter compared to those
of the unconstrained LMS algorithm?
To be completed.
10.19 In this problem, we develop and analyze by simulation an LMS-type adaptive lattice predictor introduced in
Griffiths (1977). We consider the all-zero lattice filter defined in (7.5.7), which is completely specified by the
lattice parameters {km }0M−1 . The input signal is assumed wide-sense stationary.
which provides the total prediction error power at the output of the mth stage, and show that
∂ Pmf b
= 2E{emf∗ (n)em−1
b
(n − 1) + em−1
f∗
(n)emb (n)}
∂km
Consider the lattice recursions
f ∗
emf (n) = em−1 (n) + km−1 b
em−1 (n − 1)
f
emb (n) = km−1 em−1 (n) + em−1
b
(n − 1)
∂ Pm
fb " #
f∗ f∗
∗
= E 2e (n)e b
(n − 1) + 2e b
(n)e (n)
∂km−1 m m−1 m m−1
where 0 < α < 1. Explain the role and proper choice of α, and determine the proper initialization of the
algorithm.
An LMS-type algorithm is obtained by using the instantaneous gradient. Therefore
$ %
f∗
km−1 (n) = km−1 (n − 1) − 2µ(n) emf ∗ (n)em−1
b
(n − 1) + emb (n)em−1 (n)
The quantity E m−1 (n) represents the total energy of the forward and backward linear prediction errors at
the input of the mth stage from start to present time n. The updating formula for E m−1 (n) is a first-order
recursive low-pass filter with a pole at z = a. It provides a filter with exponential memory to help track
in a nonstationary SOE.
Statistical and Adaptive Signal Processing - Solution Manual 335
Initialization
emf (−1) = emb (−1) = 0
E m−1 (−1) = δ > 0
km (−1) = 0
For n = 0, 1, 2, ...
f
e0 (n) = e0b (n) = x(n)
For m = 0, 1, ..., M − 1
f ∗
emf (n) = em−1 (n) + km−1 b
em−1 (n − 1)
f
emb (n) = km−1 em−1 (n) + em−1
b
(n − 1)
$ %
f∗
E m−1 (n) = α E m−1 (n − 1) + (1 − α) emf ∗ (n)em−1
b
(n − 1) + emb (n)em−1 (n)
2
µ̃ f 2
km−1 (n) = km−1 (n − 1) − 2
em−1 (n) + em−1 (n − 1)
b
E m−1 (n)
(c) Write a Matlab function to implement the derived algorithm, and compare its performance with that of
the LMS algorithm in the linear prediction problem discussed in Example 10.4.1.
To be completed.
10.20 Consider a signal x(n) consisting of a harmonic process plus white noise, that is,
(a) Determine the output power σ 2y = E{y 2 (n)} of the causal and stable filter
∞
y(n) = h(k)x(n − k)
k=0
and show that we can cancel the harmonic process using the ideal notch filter
1 ω = ω1
H (e j ω ) =
0 otherwise
Is the obtained ideal notch filter practically realizable? That is, is the system function rational? Why?
The output power of the filter is
1 π
E{y (n)} =
2
σ 2y = H (e j ω )2 Rx (e j ω )dω
2π −π
where
1 2 j (ω−ω1 ) 1
Rx (e j ω ) = A δ(e ) + A2 δ(e j (ω+ω1 ) ) + σ 2w
2 2
Therefore
2 1 π
σ 2y = A H (e j ω1 ) + σ 2w
2 H (e j ω )2 dω
2π −π
336 Statistical and Adaptive Signal Processing - Solution Manual
0.8
|H(ejω)|
0.6
0.4
0.2
0
0 0.1 0.2 0.3 0.4 0.5
ω/2π
Figure 10.20b: Magnitude response for pole angle ω0 = 2π (0.2) and various radius.
constitute an adaptive LMS notch filter. Draw its block diagram realization.
The instantaneous gradient is
∂ y 2 (n) ∂ y(n)
= 2y(n)
∂a ∂a
which leads to the following LMS updating
where
∂ y(n)
g(n) =
∂a
We shall compute g(n) in the z-domain. From Y (z) = H (z)X (z) we have
∂Y (z) ∂ H (z)
= X (z)
∂a ∂a
and
∂ H (z) ∂ 1 + az −1 + z −2 (1 − ρ)z −1 (1 − ρz −2 )
= =
2
∂a ∂a 1 + aρz −1 + ρ 2 z −2 1 + aρz −1 + ρ 2 z −2
The direct form II implementations for the filter and the gradient are
−1 −2
X (z)
Y (z) = 1 + az + z
1 + aρz −1 + ρ 2 z −2
S1 (z)
338 Statistical and Adaptive Signal Processing - Solution Manual
and
−2 (1 − ρ)z −1 S1(z)
G(z) = (1 − ρz )
1 + aρz −1 + ρ 2 z −2
S2 (z)
z −1
+ +
−a(n)ρ a(n)
a(n + 1)
z −1 −µ
x +
−ρ 2 z −1
1−ρ
s2 (n)
+ +
g(n)
z −1
+
−a(n)ρ
z −1
−ρ 2 −ρ
Figure 10.20c: Block diagram implementation of the adaptive notch filter.
(d) Simulate the operation of the obtained adaptive filter for ρ = 0.9, ω1 = π/6, and SNR 5 and 15 dB. Plot
ω0 (n) = arccos[−a(n)/2] as a function of n, and investigate the tradeoff between convergence rate and
misadjustment by experiment with various values of µ.
The MATLAB script for simulating this experiment is given below and Figures 10.20d1 and 10.20d2 show
filter input-output signals and frequency tracking for f 0 = 0.2, SNR=5dB, µ = 0.001 and µ = 0.0025.
The trade-off between speed of convergence and misadjustement is clearly evident.
Statistical and Adaptive Signal Processing - Solution Manual 339
µ=0.001
10
Input signal
5 Output signal
−5
−10
0 500 1000 1500 2000 2500 3000 3500 4000 4500 5000
n
0.3
"Uknown" frequency
Adaptive tracking
0.25
f0(n)
0.2
0.15
0 500 1000 1500 2000 2500 3000 3500 4000 4500 5000
n
µ=0.0025
10
Input signal
5 Output signal
−5
−10
0 500 1000 1500 2000 2500 3000 3500 4000 4500 5000
n
0.3
"Uknown" frequency
Adaptive tracking
0.25
f0(n)
0.2
0.15
0 500 1000 1500 2000 2500 3000 3500 4000 4500 5000
n
10.21 Consider the AR(2) process given in Problem 10.4. We will design the adaptive linear predictor using the RLS
algorithm. The adaptive predictor is a second-order one given by c(n) = [c1 (n) c2 (n)]T .
(a) Develop a Matlab function to implement the RLS algorithm given in Table 10.6:
[c,e] = rls(x,y,lambda,delta,M,c0).
which computes filter coefficients in c and the corresponding error in e given signal x, desired signal y,
forgetting factor lambda, initialization parameter delta, filter order M, and the initial coefficient vector
c0. To update P(n), compute only the upper or lower triangular part and determine the other part by
using Hermitian symmetry.
(b) Generate 500 samples of x(n) and obtain linear predictor coefficients using the above function. Use a
very small value for δ (for example, 0.001) and various values of λ = 0.99, 0.95, 0.9, and 0.8. Plot
predictor coefficients as a function of time along with the true coefficients for each λ, and discuss your
observations. Also compare your results with those in Problem 10.4.
(c) Repeat each simulation above 1000 times to get corresponding learning curves, which are obtained by
averaging respective squared errors |e(n)|2 . Plot these curves and compare their steady-state value with
the theoretical MSE.
To be completed.
10.22 Consider a system identification problem where we observe the input x(n) and the noisy output y(n) =
yo (n) + v(n), for 0 ≤ n ≤ N − 1. The unknown system is specified by the system function
0.0675 + 0.1349z −1 + 0.0675z −2
Ho (z) =
1 − 1.1430z −1 + 0.4128z −2
and x(n) ∼ WGN(0, 1), v(n) ∼ WGN(0, 0.01), and N = 300.
(a) Model the unknown system using an LS FIR filter, with M = 15 coefficients, using the no-windowing
method. Compute the total LSE E ls in the interval n 0 ≤ n ≤ N − 1 for n 0 = 20.
(b) Repeat part (a) for 0 ≤ n ≤ n 0 − 1 (do not compute E ls ). Use the vector c(n 0 ) and the matrix P(n 0) =
! N−1 2
R̂−1 (n 0 ) to initialize the CRLS algorithm. Compute the total errors E apr = n=n e (n) and E apost =
! N−1 2 0
To be completed.
10.23 Prove Equation (10.5.25) using the identity det(I1 + AB) = det(I2 + BA), where identity matrices I1 and I2
and matrices A and B have compatible dimensions.
We have
10.24 Derive the normal equations that correspond to the minimization of the cost function (10.5.36), and show that
for δ = 0 they are reduced to the standard set (10.5.2) of normal equations. For the situation described in
Problem 10.22, run the CRLS algorithm for various values of δ and determine the range of values that provides
acceptable performance.
The cost function can be written as
E(n) = δλn c H c + E y (n) − c H d̂(n) − d̂ H (n)c + c H R̂(n)c
Computing the gradient with respect to c gives
∂ E(n) $ %∗
= δλn c∗ − d̂∗ (n) + R̂(n)c = 0
∂c
or
$ %
δλn + R̂(n) c(n) = d̂(n)
For δ = 0, we obtain the standard normal equations. It can be easily shown that the matrix R̃(n) = δλn + R̂(n)
obeys the recursion
R̃(n) = λR̃(n − 1) + x(n)x H (n)
Thus, the development of the CRLS algorithm remains unchanged. Clearly, small values of δ do not significantly
affect the transient response of the filter and have no effect on the long run due to the exponential forgetting
memory.
10.25 Modify the CRLS algorithm in Table 10.6 so that its coefficients satisfy the linear-phase constraint c = Jc∗ .
For simplicity, assume that M = 2L; that is, the filter has an even number of coefficients. To be completed.
10.26 Following the approach used in Section 7.5.1 to develop the structure shown in Figure 7.1, derive a similar
structure based on the Cholesky (not the LDLH ) decomposition.
The LS filter is specified by R̂(n)c(n) = d̂(n). Using the Cholesky decomposition R̂(n) = L̃m (n)L̃mH (n) and
the definitions in Section 10.6.1, we obtain
em (n) = y(n) − ŷm (n) = y(n) − k̃mH (n − 1)w̃m (n)
or
ŷm (n) = ŷm−1 (n) + k̃m∗ (n − 1)w̃m (n)
Using the last equation and the elements of the triangular matrix B̃m (n) , L̃−1
m (n), we can easily modify Figure
7.1 to obtain the desired structure.
10.27 Show that the partitioning (10.7.3) of R̂m+1 (n) to obtain the same partitioning structure as (10.7.2) is possible
only if we apply the prewindowing condition xm (−1) = 0. What is the form of the partitioning if we abandon
the prewindowing assumption?
We have
n
R̂m+1 (n) = λn− j xm+1 ( j )xm+1
H
( j)
j =0
n
xm (i)
= λ n− j
xmH ( j ) x ∗ ( j − m)
j =0
x( j − m)
R̂m (n) r̂mb (n)
=
r̂mbH (n) ρ̂ bm (n)
342 Statistical and Adaptive Signal Processing - Solution Manual
where
n
r̂mb (n) = λn− j xm ( j )x ∗ ( j − m)
j =0
n
ρ̂ bm (n) = λn− j |x( j − m)|2
j =0
we have
f
ρ̂ m (n) r̂mf H (n)
R̂m+1 (n) =
r̂mf (n) R̂m (n − 1)
where
n
λn− j xm ( j − 1)xmH ( j − 1) = λn xm (−1)xmH (−1) + R̂m (n − 1)
j =0
pre-windowing ⇒0
n
r̂mf (n) = λn− j xm ( j − 1)x ∗ ( j )
j =0
n
ρ̂ fm (n) = λn− j |x( j )|2
j =0
10.28 Derive the normal equations and the LSE formulas given in Table 10.11 for the FLP and the BLP methods.
For the FLP, the error is
With the goal to minimize the cost function, the normal equations can be found directly
n
E mf (n) = λn− j |x(n) + amH (n)xm (n − 1)|2
j =0
n
n
= λn− j x(n)x ∗ (n) + λn− j amH (n)xm (n − 1)x ∗ (n)
j =0 j =0
n
n
+ λ n− j
x(n)xmH (n − 1)am (n) + λn− j amH (n)xm (n − 1)xmH (n − 1)am (n)
j =0 j =0
= E x (n) + amH (n)r̂mf (n) + r̂mf H (n)am (n) + amH (n)R̂m (n − 1)am (n)
Statistical and Adaptive Signal Processing - Solution Manual 343
In order to minimize the above cost function, the normal equations are
n
E mb (n) = λn− j |x(n − m) + bmH (n)xm (n)|2
j =0
n
n
= λn− j x(n − m)x ∗ (n − m) + λn− j bmH (n)xm (n)x ∗ (n − m)
j =0 j =0
n
n
+ λ n− j
x(n − m)xmH (n)bm (n) + λn− j bmH (n)xm (n)xmH (n)bm (n)
j =0 j =0
= E x (n − m) + bmH (n)r̂mb (n) + r̂mb H (n)bm (n) + bmH (n)R̂m (n)bm (n)
In order to minimize the above cost function, the normal equations are
10.29 Derive the FLP and BLP a priori and a posteriori updating formulas given in Table 10.12.
To be completed.
10.30 Modify Table10.14 for the FAEST algorithm, to obtain a table for the FTF algorithm, and write a Matlab
function for its implementation. Test the obtained function, using the equalization experiment in Example
10.5.2.
To obtain the FTF algorithm, we replace ᾱ m (n) in Table 10.14 by 1/α m (n) and Equation (h) with
f
|ε m (n)|2
α m+1 (n) = α m (n − 1) − f
E m (n)
and Equation (i) with
α m+1 (n)
α m (n) = (m+1)
1 − α m+1 (n)ḡm+1 (n)emb∗ (n)
The Matlab script is shown below and the learning curve in Figure 10.30.
344 Statistical and Adaptive Signal Processing - Solution Manual
%% Problem 10.30
%%
%%
%%
close all
clear
W=2.9;
N=1000;
Nmc=5;
M=11;
lambda=0.99;
varv=0.001;
h=zeros(3,1);
er=zeros(N,Nmc);
e2a = zeros(1,N);
h(1)=0.5*(1+cos(2*pi*(1-2)/W));
h(2)=0.5*(1+cos(2*pi*(2-2)/W));
h(3)=0.5*(1+cos(2*pi*(3-2)/W));
% Learning curves
t=(1:N)’;
for i=1:Nmc
y=sign(rand(N,1)-0.5);
v=sqrt(varv)*randn(N,1);
x=filter(hc,1,y)+v;
yd=zeros(N,1);
yd(n0:N)=y(1:N-n0+1);
% Time Initialization
aold=zeros(M,1); bold=zeros(M,1); cold=zeros(M,1); xold=zeros(M,1);
alphaold=1; gbarold=zeros(M,1);
Efold=10^3; Ebold=10^3;
xv=zeros(M,1);
for n=1:N
% Order Initialization
%ef(1)=x(n);
Statistical and Adaptive Signal Processing - Solution Manual 345
%eb(1)=x(n);
%e(1)=yd(n);
%alpha(1)=1;
%alphaold=alpha(1);
% Filter update
xv=[x(n); xold(1:end-1)];
e(n) = y(n) - cold’*xv;
epsilon(n) = e(n)*alpha;
c = cold + gbar.*conj(epsilon(n));
% Time Update
aold=a; bold=b; cold=c; xold=xv;
alphaold=alpha; gbarold=gbar;
Efold=Ef(n); Ebold=Eb(n);
end
i
e2a=e2a+e.^2;
end
e2a=e2a./Nmc;
t=(1:N)’;
%plot(t,Ef,’r’,t,Eb,’b’);
%text(250,300,’\leftarrow\fontsize{9pt} E^f’);
%text(100,200,’E^b \rightarrow\fontsize{9pt} ’);
Jmin1=1;
subplot(’position’,[0.1,0.55,0.85,0.4]);
semilogy(t,e2a,’r’); %,...
axis([0,N,10^(-4),10^0]);
title(’(a) MSE Learning Curve’,’fontsize’,10);
346 Statistical and Adaptive Signal Processing - Solution Manual
0
(a) MSE Learning Curve
10
−1
10
Mean squared error
−2
10
−3
10
−4
10
0 100 200 300 400 500
Number of iterations (n)
10.31 If we wish to initialize the fast RLS algorithms (fast Kalman, FAEST, and FTF) using an exact method, we
need to collect a set of data {x(n), y(n)}n00 for any n 0 > M.
(a) Identify the quantities needed to start the FAEST algorithm at n = n 0 . Form the normal equations and
use the LDL H decomposition method to determine these quantities.
(b) Write a Matlab function faestexact.m that implements the FAEST algorithm using the exact initial-
ization procedure described in part (a).
(c) Use the functions faest.m and faestexact.m to compare the two different initialization approaches for
the FAEST algorithm in the context of the equalization experiment in Example 10.5.2. Use n 0 = 1.5M
and n 0 = 3M. Which value of δ gives results closest to the exact initialization method?
To be completed.
10.32 Using the order-recursive approach introduced in Section 7.3.1, develop an order-recursive algorithm for the
solution of the normal equations (10.5.2), and check its validity by using it to initialize the FAEST algorithm,
as in Problem 10.31. Note: In Section 7.3.1 we could not develop a closed-form algorithm because some
recursions required the quantities bm (n − 1) and E mb (n − 1). Here we can avoid this problem by using time
recursions.
Section 7.3.1 provides an incomplete order recursive algorithm for computing the optimum filter. The algorithm
can be completed by using time updatings to determine b(n − 1) and E mb (n − 1). These can be computed using
Statistical and Adaptive Signal Processing - Solution Manual 347
in conjunction with (10.7.2) and (10.7.3) we can easily obtain the desired results.
(c) Show that
E mb (n)
α m (n) = λm
E mf (n)
and use it to explain why the quantity ηαm (n) = E mf (n) − λm E mb (n) can be used as a warning variable.
We have
det R̂m+1 (n)
det R̂m (n − 1) f
E m (n) E b (n)
α m (n) = λm = λm = λm mf
det R̂m (n) det R̂m+1 (n) E m (n)
E m (n)
b
Hence
ηαm (n) = E mf (n) − α m (n)E mf (n) = [1 − α m (n)] E mf (n)
and since 0 ≤ α m (n) ≤ 1 we should have, in theory, that ηαm (n) ≥ 0. Therefore, we can monitor ηαm (n)
and issue a warning when it becomes negative.
(d) Explain how the quantities
eb (n)
η ḡ (n) , ḡ M+1
(M+1)
(n) − , and
λE b (n − 1)
10.34 When the desired response is y( j ) = δ( j − k), that is, a spike at j = k, 0 ≤ k ≤ n, the LS filter cm(k) is known
as a spiking filter or as an LS inverse filter (see Section 8.3).
NOTE: The subscript m is not necessary and it is dropped for convenience.
(a) Determine the normal equations and the LSE E m(k) (n) for the LS filter cm(k) .
When y( j ) = δ( j − k), 0 ≤ k ≤ n we have
n
R̂(n) = λn− j x( j )x H ( j )
j =0
n
d̂(k) (n) = λn− j x( j )δ( j − k) = λn−k x(k)
j =0
Hence, we have
Therefore, the adaptation gain acts like a spiking filter (see Section 8.3).
The LS filter can be expressed as
n n $
%
n
c(n) = R̂−1 (n) λn− j x( j )y ∗ ( j ) = λn− j R̂−1 (n)x( j ) y ∗ ( j ) = c( j ) (n)y ∗ ( j )
j =0 j =0 j =0
that is, the LS filter is a linear combination of spiking filters weighted by each individual sample of the
desired response.
(c) Use the interpretation α m (n) = E m(n) (n) to show that 0 ≤ α m (n) ≤ 1.
The worst spiking filter performance corresponds to c(n) (n) = 0 which implies E (n) (n) = 1. Hence,
0 ≤ E (n) (n) = α(n) ≤ 1.
!
(d) Show that am (n) = nk=0 cm(k) (n − 1)x(k) and explain its meaning.
We have
n
n
a(n) = −R̂−1 (n) λn− j x( j − 1)x ∗ ( j ) = − c( j )(n − 1)x ∗ ( j )
j =0 j =0
therefore the FLP is a linear combination of delayed, by one sampling interval, spiking filters weighted
by the signal.
350 Statistical and Adaptive Signal Processing - Solution Manual
10.35 Derive Equations (10.7.33) through (10.7.35) for the a posteriori LS lattice-ladder structure, shown in Fig-
ure 10.38, starting with the partitionings (10.7.1) and the matrix by inversion by partitioning relations (10.7.7)
and (10.7.8).
Starting with (10.7.1)
xm (n) x(n)
xm+1 (n) = =
x(n − m) xm (n − 1)
The FLP error is
f
ε m+1 (n) = x(n) + am+1
H
(n)xm+1 (n − 1)
f
Using (7.3.27), the order-recursive lattice-ladder forward error ε m+1 (n) is found directly
H
f am (n) bm (n − 1)
ε m+1 (n) = x(n) + + kmf (n) xm+1 (n − 1)
0 1
= x(n) + amH (n)xm (n − 1) + [bmH (n − 1)xm (n − 1) + x(n − 1 − m)]kmf ∗ (n)
= ε mf (n) + kmf ∗ (n)εbm (n − 1)
10.36 Prove relations (10.7.45) and (10.7.46) for the updating of the ladder partial correlation coefficient β cm (n).
Starting with (10.7.40), and using time updating formulas
β cm (n) = bmH (n)d̂m (n) + d̂m+1 (n)
= bmH (n)[λd̂m (n − 1) + x(n)y ∗ (n)] + [λd̂m+1 (n − 1) + x(n − m)y ∗ (n)]
= λbmH (n)d̂m (n − 1) + εbm (n)y ∗ (n) + λd̂m+1 (n − 1)
= λ[bmH (n − 1) − ε bm (n)ḡm (n)]d̂m (n − 1) + λd̂m+1 (n − 1) + ε bm (n)y ∗ (n)
= λ[bmH (n − 1)d̂m (n − 1) + d̂m+1 (n − 1)] + ε bm (n)[y ∗ (n) − λḡm (n)d̂m (n − 1)
= λβ cm (n − 1) + ε bm (n)[y ∗ (n) − λḡm (n)R̂m (n − 1)cm (n − 1)]
= λβ cm (n − 1) + ε bm (n)[y ∗ (n) − xmH (n)cm (n − 1)]
= λβ cm (n − 1) + ε bm (n)em∗ (n)
Statistical and Adaptive Signal Processing - Solution Manual 351
10.37 In Section 7.3.1 we derived order-recursive relations for the FLP, BLP, and FIR filtering MMSEs.
(a) Following the derivation of (7.3.36) and (7.3.37), derive similar order-recursive relations for E mf (n) and
E mb (n).
f fH
E m+1 (n) = E x (n) + r̂m+1 (n)am+1 (n)
f∗ am (n) bm (n − 1)
= E x (n) + [r̂mf H (n) r̂m+1 (n)] + kmf (n)
0 1
f∗
= E x (n) + r̂mf H (n)am (n) + [r̂mf H (n)bm (n − 1) + r̂m+1 (n)]kmf (n)
= E mf (n) + β ∗m (n)kmf (n)
b
E m+1 (n) = E x (n − m − 1) + r̂m+1
bH
(n)bm+1 (n)
0 1
= E x (n − m − 1) + [r̂m+1
b∗
(n) r̂mb H (n − 1)] + kmb (n)
bm (n − 1) am (n)
= E x (n − m − 1) + r̂mb H (n − 1)bm (n − 1) + [r̂mb H (n − 1)am (n) + r̂m+1
b∗
(n)]kmb (n)
= E mb (n − 1) + β ∗m (n)kmb (n)
(b) Show that we can obtain a complete LS lattice-ladder algorithm by replacing, in Table 10.15, the time-
recursive updatings of E mf (n) and E mb (n) with the obtained order-recursive relations.
This is the a posteriori LS lattice-ladder algorithm, which is shown in Table 10.15. Replacing the following
steps in Table 10.15 will produce an order-recursive relation
f∗
ε bm (n − 1)ε m (n)
(b) β m+1 (n) = λβ m+1 (n − 1) +
α m (n − 1)
(c) E m+1 (n) = E mf (n) + β ∗m (n)kmf (n)
f
(d) E m+1
b
(n) = E mb (n − 1) + β ∗m (n)kmb (n)
f −β m+1 (n)
(e) km+1 (n) = b
E m+1 (n − 1)
∗
−β m+1 (n)
( f ) km+1
b
(n) = f
E m+1 (n)
(c) Write a Matlab function for this algorithm, and verify it by using the equalization experiment in Example
10.5.2.
10.38 Derive the equations for the a priori RLS lattice-ladder algorithm given in Table 10.16, and write a Matlab
function for its implementation. Test the function by using the equalization experiment in Example 10.5.2.
Using (10.7.1), (7.3.27) and (e) from Table 10.12, the a priori FLP error is
f
em+1 (n) = x(n) + am+1
H
(n − 1)xm+1 (n − 1)
H
am (n − 1) bm (n − 1) xm (n − 1)
= x(n) + + km (n − 1)
f
0 1 x(n − m − 1)
= x(n) + amH (n − 1)xm (n − 1) + kmf ∗ (n − 1)(bm−1 (n − 1)xm (n − 1) + x(n − m − 1))
= emf (n) + kmf ∗ (n − 1)(bm−1 (n − 1)xm (n − 1) + x(n − m − 1))
= emf (n) + kmf ∗ (n − 1)emb (n − 1)
352 Statistical and Adaptive Signal Processing - Solution Manual
The Matlab function is given below and the MSE learning curve in shown in Figure 10.38.
%% Problem 10.38
%% Implement table 10.16%%
%%
%%
%%
%%
close all
clear all
W=2.9;
N=1000;
Nmc=250;
M=11;
lambda=0.99;
varv=0.001;
h=zeros(3,1);
er=zeros(N,Nmc);
h(1)=0.5*(1+cos(2*pi*(1-2)/W));
h(2)=0.5*(1+cos(2*pi*(2-2)/W));
h(3)=0.5*(1+cos(2*pi*(3-2)/W));
% Learning curves
t=(1:N)’;
for i=1:Nmc
y=sign(rand(N,1)-0.5);
v=sqrt(varv)*randn(N,1);
x=filter(hc,1,y)+v;
yd=zeros(N,1);
yd(n0:N)=y(1:N-n0+1);
Statistical and Adaptive Signal Processing - Solution Manual 353
% Time Initialization
Ef=ones(M+1,1)*10^(3);
Eb=Ef;
Ebold=Ef; Efold=Ef;
ef=zeros(M+1,1); eb=zeros(M+1,1);
ebold=eb;
kf=zeros(M,1); kb=zeros(M,1);
kfold=kf; kbold=kb;
b=zeros(M+1,1); bc=zeros(M+1,1);
bold=b; bcold=bc;
e=zeros(M+1,1); kc=zeros(M,1);
kcold=kc;
alpha=zeros(M+1,1);
alphaold=alpha;
for n=1:N
% Order Initialization
ef(1)=x(n);
eb(1)=x(n);
e(1)=yd(n);
alpha(1)=1;
alphaold(1)=alpha(1);
for m=1:M
%Lattice
ef(m+1) = ef(m) + conj(kfold(m))*ebold(m);
eb(m+1) = ebold(m) + conj(kbold(m))*ef(m);
%b(m) = lambda*bold(m) + (ebold(m)*conj(ef(m)))*alphaold(m);
Ef(m) = lambda*Efold(m) + alphaold(m)*conj(ef(m))*ef(m);
Eb(m) = lambda*Ebold(m) + alpha(m)*conj(eb(m))*eb(m);
kf(m) = kfold(m) - (alphaold(m)*ebold(m)*conj(ef(m+1)))/Ebold(m);
kb(m) = kbold(m) - (alphaold(m)*ef(m)*conj(eb(m+1)))/Ef(m);
alpha(m+1) = alpha(m) - abs(alpha(m)*eb(m))*abs(alpha(m)*eb(m))/Eb(m);
% Ladder
%bc(m)=lambda*bcold(m) + (eb(m)*conj(ef(m)))*alpha(m);
e(m+1)=e(m)-conj(kcold(m))*eb(m);
kc(m)= kcold(m)+(alpha(m)*eb(m)*conj(e(m+1)))/Eb(m);
end
er(n,i)=e(M+1);erf(n,i)=ef(M);erb(n,i)=eb(M);
Erf(n,i)=Eb(1); Erb(n,i)=Eb(M); al(n,i)=alpha(M);
% Time Delay
Ebold=Eb; Efold=Ef;
ebold=eb; efold=ef;
354 Statistical and Adaptive Signal Processing - Solution Manual
bold=b; bcold=bc;
kfold=kf; kbold=kb; kcold=kc;
alphaold=alpha;
end
i
end
er2=er.^2;
er2m=mean(er2,2);
t=(1:N)’;
%plot(t,Erf,’r’,t,Erb,’b’);
%text(250,300,’\leftarrow\fontsize{9pt} E^f’);
%text(100,200,’E^b \rightarrow\fontsize{9pt} ’);
Jmin1=1;
%subplot(’position’,[0.1,0.55,0.85,0.4]);
semilogy(t,er2m,’r’);
axis([0,N,10^(-4), 10^0]);
title([’MSE Learning Curve (\lambda=.99, W=’ num2str(W) ’ )’],’fontsize’,10);
xlabel(’Number of iterations (n)’,’fontsize’,8);
ylabel(’Mean squared error’,’fontsize’,8);
set(gca,’xtick’,[0:100:N],’fontsize’,8);
10.39 Derive the equations for the a priori RLS lattice-ladder algorithm with error feedback (see Table 10.7), and
write a Matlab function for its implementation. Test the function by using the equalization experiment in
Example 10.5.2.
β cm (n) β cm (n − 1) α m emb (n)em∗ (n)
kmc (n) = = λ +
E mb (n) E mb (n) E mb (n)
β c (n − 1) E mb (n − 1) α m emb (n)em∗ (n)
= λ mb +
E m (n − 1) E mb (n) E mb (n)
β cm (n−1)
where kmc (n − 1) = Em b (n−1) . Now
−1
10
Mean squared error
−2
10
−3
10
−4
10
0 100 200 300 400 500 600 700 800 900 1000
Number of iterations (n)
f
Similarly for the lattice parameters km (n) and kmb (n)
β m (n)
kmf (n) = −
E m (n − 1)
b
f∗
λβ m (n − 1) + α m (n − 1)emb (n − 1)em (n)
= −
E mb (n − 1)
f∗
β m (n − 1) E mb (n − 2) α m (n − 1)emb (n − 1)em (n)
= −λ −
E mb (n − 2) E mb (n − 1) E mb (n − 1)
f f∗
km (n − 1) b α m (n − 1)emb (n − 1)em (n)
= [E (n − 1) − α m (n − 1)e b
(n − 1)e b∗
(n)] −
E mb (n − 1) m m m
E mb (n − 1)
α m (n − 1)em (n − 1) f
b
= kmf (n − 1) − [em (n) + kmf (n − 1)emb∗ (n − 1)]
E mb (n − 1)
f∗
α m (n − 1)emb (n − 1)em+1 (n)
= kmf (n − 1) −
E mb (n − 1)
and
β ∗m (n)
kmb (n) = − f
E m (n)
f∗
λβ ∗m (n − 1) + α m (n − 1)emb (n − 1)em (n)
= − f
E m (n)
f∗
β ∗m (n − 1) E m (n − 1)
f
α m (n − 1)emb (n − 1)em (n)
= −λ f f
− f
E m (n − 1) E m (n) E m (n)
f∗
kmb (n − 1) α m (n − 1)emb (n − 1)em (n)
= f
[E mf (n) − α m (n − 1)emf (n)emf ∗ (n)] − f
E m (n) E m (n)
f
α m (n − 1)em (n)
= kmb (n − 1) − f
[emb∗ (n − 1) + kmb (n − 1)emf ∗ (n)]
E m (n)
α m (n − 1)emb (n − 1)em+1
b∗
(n)
= kmb (n − 1) − f
E m (n)
The Matlab script is given below and the MSE learning curve in shown in Figure 10.39.
%% Problem 10.38
%% Implement table 10.16%%
%%
%%
%%
%%
close all
clear all
W=2.9;
N=1000;
Nmc=250;
M=11;
Statistical and Adaptive Signal Processing - Solution Manual 357
lambda=0.99;
varv=0.001;
h=zeros(3,1);
er=zeros(N,Nmc);
h(1)=0.5*(1+cos(2*pi*(1-2)/W));
h(2)=0.5*(1+cos(2*pi*(2-2)/W));
h(3)=0.5*(1+cos(2*pi*(3-2)/W));
% Learning curves
t=(1:N)’;
for i=1:Nmc
y=sign(rand(N,1)-0.5);
v=sqrt(varv)*randn(N,1);
x=filter(hc,1,y)+v;
yd=zeros(N,1);
yd(n0:N)=y(1:N-n0+1);
% Time Initialization
Ef=ones(M+1,1)*10^(3);
Eb=Ef;
Ebold=Ef; Efold=Ef;
ef=zeros(M+1,1); eb=zeros(M+1,1);
ebold=eb;
kf=zeros(M,1); kb=zeros(M,1);
kfold=kf; kbold=kb;
b=zeros(M+1,1); bc=zeros(M+1,1);
bold=b; bcold=bc;
e=zeros(M+1,1); kc=zeros(M,1);
kcold=kc;
alpha=zeros(M+1,1);
alphaold=alpha;
for n=1:N
% Order Initialization
ef(1)=x(n);
eb(1)=x(n);
e(1)=yd(n);
alpha(1)=1;
alphaold(1)=alpha(1);
358 Statistical and Adaptive Signal Processing - Solution Manual
for m=1:M
%Lattice
ef(m+1) = ef(m) + conj(kfold(m))*ebold(m);
eb(m+1) = ebold(m) + conj(kbold(m))*ef(m);
b(m) = lambda*bold(m) + (ebold(m)*conj(ef(m)))*alphaold(m);
Ef(m) = lambda*Efold(m) + alphaold(m)*conj(ef(m))*ef(m);
Eb(m) = lambda*Ebold(m) + alpha(m)*conj(eb(m))*eb(m);
kf(m) = -b(m)/Ebold(m);
kb(m) = -conj(b(m))/Ef(m);
alpha(m+1) = alpha(m) - abs(eb(m))*abs(eb(m))/Eb(m);
% Ladder
bc(m)=lambda*bcold(m) + (eb(m)*conj(ef(m)))*alpha(m);
e(m+1)=e(m)-conj(kcold(m))*eb(m);
kc(m)=bc(m)/Eb(m);
end
er(n,i)=e(M+1);erf(n,i)=ef(M);erb(n,i)=eb(M);
Erf(n,i)=Eb(1); Erb(n,i)=Eb(M); al(n,i)=alpha(M);
% Time Delay
Ebold=Eb; Efold=Ef;
ebold=eb; efold=ef;
bold=b; bcold=bc;
kfold=kf; kbold=kb;
alphaold=alpha;
end
i
end
er2=er.^2;
er2m=mean(er2,2);
t=(1:N)’;
%plot(t,Erf,’r’,t,Erb,’b’);
%text(250,300,’\leftarrow\fontsize{9pt} E^f’);
%text(100,200,’E^b \rightarrow\fontsize{9pt} ’);
Jmin1=1;
%subplot(’position’,[0.1,0.55,0.85,0.4]);
semilogy(t,er2m,’r’);
axis([0,N,10^(-4), 10^0]);
title([’MSE Learning Curve (\lambda=.99, W=’ num2str(W) ’ )’],’fontsize’,10);
xlabel(’Number of iterations (n)’,’fontsize’,8);
ylabel(’Mean squared error’,’fontsize’,8);
set(gca,’xtick’,[0:100:N],’fontsize’,8);
−1
10
Mean squared error
−2
10
−3
10
−4
10
0 100 200 300 400 500 600 700 800 900 1000
Number of iterations (n)
10.40 Derive the equations for the a posteriori RLS lattice-ladder algorithm with error feedback (Ling et al. 1986)
and write a Matlab function for its implementation. Test the function by using the equalization experiment in
Example 10.5.2.
To be completed.
10.41 The a posteriori and the a priori RLS lattice-ladder algorithms need the conversion factor α m (n) because the
updating of the quantities E mf (n), E mb (n), β m (n), and β cm (n) requires both the a priori and a posteriori errors.
Derive a double (a priori and a posteriori) lattice-ladder RLS filter that avoids the use of the conversion factor
by updating both the a priori and the a posteriori prediction and filtering errors.
Combining the a posteriori(Table 10.15) and a priori(Table 10.16) lattice-ladder algorithms, and removing
dependence on α m . The lattice parameters are
−β m (n)
kmf (n) =
E mb (n − 1)
and
−β ∗m (n)
kmb (n) = f
E m (n)
where the time updating of β m (n) is
β m (n) = λβ m (n − 1) + ε bm (n − 1)emf ∗ (n)
360 Statistical and Adaptive Signal Processing - Solution Manual
b
em+1 (n) = emb (n − 1) + kmb∗ (n − 1)emf (n)
εm+1 (n) = ε mf (n) + kmf ∗ (n)εbm (n − 1)
f
−β cm (n)
kmc (n) =
E mb (n)
β cm (n) = λβ cm (n − 1) + ε bm (n)em∗ (n)
em+1 (n) = em (n) − kmc∗ (n − 1)emb (n)
ε m+1 (n) = ε m (n) − kmc∗ (n)εbm (n)
10.42 Program the RLS Givens lattice-ladder filter with square roots (see Table 10.18), and study its use in the
adaptive equalization experiment of Example 10.5.2.
The Matlab script is given below and the MSE learning curve in shown in Figure 10.42.
%% Problem 10.38
%% Implement table 10.16%%
%%
%%
%%
%%
close all
clear all
W=2.9;
N=1000;
Nmc=250;
M=11;
lambda=0.99;
varv=0.001;
h=zeros(3,1);
er=zeros(N,Nmc);
h(1)=0.5*(1+cos(2*pi*(1-2)/W));
h(2)=0.5*(1+cos(2*pi*(2-2)/W));
h(3)=0.5*(1+cos(2*pi*(3-2)/W));
Statistical and Adaptive Signal Processing - Solution Manual 361
% Learning curves
t=(1:N)’;
for i=1:Nmc
y=sign(rand(N,1)-0.5);
v=sqrt(varv)*randn(N,1);
x=filter(hc,1,y)+v;
yd=zeros(N,1);
yd(n0:N)=y(1:N-n0+1);
% Time Initialization
Ef=ones(M+1,1)*10^(3);
Eb=Ef;
Ebold=Ef; Efold=Ef;
ef=zeros(M+1,1); eb=zeros(M+1,1);
ebold=eb;
kf=zeros(M,1); kb=zeros(M,1);
kfold=kf; kbold=kb;
cf=zeros(M+1,1); sf=zeros(M+1,1);
cb=zeros(M+1,1); sb=zeros(M+1,1);
cfold=cf; cbold=cb; sfold=sf; sbold=sb;
e=zeros(M+1,1); kc=zeros(M,1);
kcold=kc;
alpha=zeros(M+1,1);
alphaold=alpha;
for n=1:N
% Order Initialization
ef(1)=x(n);
eb(1)=x(n);
e(1)=yd(n);
alpha(1)=1;
alphaold(1)=alpha(1);
for m=1:M
%Lattice
Ef(m) = (lambda*Efold(m)^2 + conj(ef(m))*ef(m))^(1/2);
cf(m) = lambda^(1/2)*Efold(m)/Ef(m);
sf(m) = ef(m)/Ef(m);
Eb(m) = (lambda*Ebold(m)^2 + conj(eb(m))*eb(m))^(1/2);
cb(m) = lambda^(1/2)*Ebold(m)/Eb(m);
362 Statistical and Adaptive Signal Processing - Solution Manual
sb(m) = eb(m)/Eb(m);
ef(m+1) = cbold(m)*ef(m) + lambda^(1/2)*sbold(m)*conj(kfold(m));
kf(m) = lambda^(1/2)*cbold(m)*kfold(m) - sbold(m)*conj(ef(m));
eb(m+1) = cf(m)*ebold(m) + lambda^(1/2)*sf(m)*conj(kbold(m));
kb(m) = lambda^(1/2)*cf(m)*kbold(m) - sf(m)*conj(ebold(m));
alpha(m+1) = alpha(m) - abs(alpha(m)*eb(m))*abs(alpha(m)*eb(m))/Eb(m);
% Ladder
e(m+1) = cb(m)*e(m) - lambda^(1/2)*sb(m)*kcold(m);
kc(m)= lambda^(1/2)*cb(m)*kcold(m) + sb(m)*conj(e(m));
end
er(n,i)=e(M+1);erf(n,i)=ef(M);erb(n,i)=eb(M);
Erf(n,i)=Eb(1); Erb(n,i)=Eb(M); al(n,i)=alpha(M);
% Time Delay
cbold=cb; cfold=cf;
sbold=sb; sfold=sf;
Ebold=Eb; Efold=Ef;
ebold=eb; efold=ef;
kfold=kf; kbold=kb; kcold=kc;
alphaold=alpha;
end
i
end
er2=er.^2;
er2m=mean(er2,2);
t=(1:N)’;
%plot(t,Erf,’r’,t,Erb,’b’);
%text(250,300,’\leftarrow\fontsize{9pt} E^f’);
%text(100,200,’E^b \rightarrow\fontsize{9pt} ’);
Jmin1=1;
%subplot(’position’,[0.1,0.55,0.85,0.4]);
semilogy(t,er2m,’r’);
axis([0,N,10^(-4), 10^0]);
title([’MSE Learning Curve (\lambda=.99, W=’ num2str(W) ’ )’],’fontsize’,10);
xlabel(’Number of iterations (n)’,’fontsize’,8);
ylabel(’Mean squared error’,’fontsize’,8);
set(gca,’xtick’,[0:100:N],’fontsize’,8);
10.43 Derive the formulas and program the RLS Givens lattice-ladder filter without square roots (see Table 10.18),
and study its use in the adaptive equalization experiment of Example 10.5.2.
Statistical and Adaptive Signal Processing - Solution Manual 363
−1
10
Mean squared error
−2
10
−3
10
−4
10
0 100 200 300 400 500 600 700 800 900 1000
Number of iterations (n)
The square root-free version is a modification of the error feedback form of the a priori LS lattice-ladder
algorithm. If we define
λE mb (n − 1)
cmb (n) = = |c̃mb (n)|2
E mb (n)
and
α m (n)emb (n)
smb (n) =
E mb (n)
then using (10.7.50), the ladder coefficient is
Also the lattice parameters are found using the error feedback a priori updating with
and
where
f
λE m (n − 1)
cmf (n) = f
= |c̃mf (n)|2
E m (n)
and
f
α m (n − 1)em (n)
smf (n) = f
E m (n)
are the forward rotation parameters.
The Matlab script is given below and the MSE learning curve in shown in Figure 10.43.
%% Problem 10.38
%% Implement table 10.16%%
%%
%%
%%
%%
close all
clear all
W=2.9;
N=1000;
Nmc=250;
M=11;
lambda=0.99;
varv=0.001;
h=zeros(3,1);
Statistical and Adaptive Signal Processing - Solution Manual 365
er=zeros(N,Nmc);
h(1)=0.5*(1+cos(2*pi*(1-2)/W));
h(2)=0.5*(1+cos(2*pi*(2-2)/W));
h(3)=0.5*(1+cos(2*pi*(3-2)/W));
% Learning curves
t=(1:N)’;
for i=1:Nmc
y=sign(rand(N,1)-0.5);
v=sqrt(varv)*randn(N,1);
x=filter(hc,1,y)+v;
yd=zeros(N,1);
yd(n0:N)=y(1:N-n0+1);
% Time Initialization
Ef=ones(M+1,1)*10^(3);
Eb=Ef;
Ebold=Ef; Efold=Ef;
ef=zeros(M+1,1); eb=zeros(M+1,1);
ebold=eb;
kf=zeros(M,1); kb=zeros(M,1);
kfold=kf; kbold=kb;
cf=zeros(M+1,1); sf=zeros(M+1,1);
cb=zeros(M+1,1); sb=zeros(M+1,1);
cfold=cf; cbold=cb; sfold=sf; sbold=sb;
e=zeros(M+1,1); kc=zeros(M,1);
kcold=kc;
alpha=zeros(M+1,1);
alphaold=alpha;
for n=1:N
% Order Initialization
ef(1)=x(n);
eb(1)=x(n);
e(1)=yd(n);
alpha(1)=1;
alphaold(1)=alpha(1);
for m=1:M
366 Statistical and Adaptive Signal Processing - Solution Manual
%Lattice
Ef(m) = lambda*Efold(m) + alphaold(m)*conj(ef(m))*ef(m);
cf(m) = lambda*Efold(m)/Ef(m);
sf(m) = alphaold(m)*ef(m)/Ef(m);
Eb(m) = lambda*Ebold(m) + alpha(m)*conj(eb(m))*eb(m);
cb(m) = lambda*Ebold(m)/Eb(m);
sb(m) = alpha(m)*eb(m)/Eb(m);
ef(m+1) = ef(m) + conj(kfold(m))*ebold(m);
kf(m) = cbold(m)*kfold(m) - sbold(m)*conj(ef(m));
eb(m+1) = ebold(m) + conj(kbold(m))*ef(m);
kb(m) = cf(m)*kbold(m) - sf(m)*conj(ebold(m));
alpha(m+1) = alpha(m) - abs(alpha(m)*eb(m))*abs(alpha(m)*eb(m))/Eb(m);
% Ladder
e(m+1)=e(m)-conj(kcold(m))*eb(m);
kc(m)= cb(m)*kcold(m) + sb(m)*conj(e(m));
end
er(n,i)=e(M+1);erf(n,i)=ef(M);erb(n,i)=eb(M);
Erf(n,i)=Eb(1); Erb(n,i)=Eb(M); al(n,i)=alpha(M);
% Time Delay
cbold=cb; cfold=cf;
sbold=sb; sfold=sf;
Ebold=Eb; Efold=Ef;
ebold=eb; efold=ef;
kfold=kf; kbold=kb; kcold=kc;
alphaold=alpha;
end
i
end
er2=er.^2;
er2m=mean(er2,2);
t=(1:N)’;
%plot(t,Erf,’r’,t,Erb,’b’);
%text(250,300,’\leftarrow\fontsize{9pt} E^f’);
%text(100,200,’E^b \rightarrow\fontsize{9pt} ’);
Jmin1=1;
%subplot(’position’,[0.1,0.55,0.85,0.4]);
semilogy(t,er2m,’r’);
axis([0,N,10^(-4), 10^0]);
title([’MSE Learning Curve (\lambda=.99, W=’ num2str(W) ’ )’],’fontsize’,10);
xlabel(’Number of iterations (n)’,’fontsize’,8);
ylabel(’Mean squared error’,’fontsize’,8);
Statistical and Adaptive Signal Processing - Solution Manual 367
−1
10
Mean squared error
−2
10
−3
10
−4
10
0 100 200 300 400 500 600 700 800 900 1000
Number of iterations (n)
set(gca,’xtick’,[0:100:N],’fontsize’,8);
10.44 In this problem we discuss the derivation of the normalized lattice-ladder RLS algorithm, which uses a smaller
number of time and order updating recursions and has better numerical behavior due to the normalization of
its variables.
β m (n) β cm (n)
k̄m (n) = k̄mc (n) = √
E mf (n) E mb (n − 1) E m (n) E mb (n)
and show that the normalized errors and the partial correlation coefficients k̄m (n) and k̄mc (n) have magni-
tude less than 1.
368 Statistical and Adaptive Signal Processing - Solution Manual
For m = 0 to M − 1
k̄m (n) = 1 − |ēmf (n)|2 1 − |ēmb (n − 1)|2 k̄m (n − 1) + ēmf∗ (n)ēmb (n − 1)
−1
f
ēm+1 (n) = 1 − |emb (n − 1)|2 1 − |k̄m (n)|2 [ēmf (n) − k̄m (n) ēmb (n − 1)]
−1
b
ēm+1 (n) = 1 − |ēmf (n)|2 1 − |k̄m (n)|2 [ēmb (n − 1) − k̄m (n) ēmf (n)]
k̄mc (n) = 1 − |ēm (n)|2 1 − |ēmb (n)|2 k̄mc (n − 1) + ēm∗ (n)ēmb (n)
: −1
ēm+1 (n) = 1 − |ēm (n)| 1 − |k̄m (n)|
b 2 c 2 [ēm (n) − k̄mc (n)ēmb (n)]
(c) Write a Matlab function to implement the derived algorithm, and test its validity by using the equalization
experiment in Example 10.5.2.
To be completed.
10.46 Derive the formulas for the QR-RLS lattice predictor (see Table 10.18), using the approach introduced in
Section 10.6.3 (Yang and Böhme 1992).
To be completed.
Statistical and Adaptive Signal Processing - Solution Manual 369
10.47 Demonstrate how the systolic array in Figure 10.55, which is an extension of the systolic array structure shown
in Figure 10.36, can be used to determine the LS error e(n) and the LS coefficient vector c(n). Determine
the functions to be assigned to the dotted-line computing elements and the inputs with which they should be
supplied.
To be completed.
10.48 (new version) The implementation of adaptive filters using multiprocessing involves the following steps:
(1) partitioning of the overall computational job into individual tasks, (2) allocation of computational and
communications tasks to the processors, and (3) synchronization and control of the processors. Figure 10.56
shows a cascade multiprocessing architecture used for adaptive filtering. To avoid latency (i.e., a delay between
the filter’s input and output that is larger than the sampling interval), each processor should complete its task
in time less than the sampling period and use results computed by the preceding processor and the scalar
computational unit at the previous sampling interval. This is accomplished by the unit delays inserted between
the processors.
(a) Draw the block diagram of a section that updates one coefficient of the FLP using equations (a)-(h), given
in Table 10.13. Then, use the obtained diagram to explain why the fast Kalman algorithm does not satisfy
the multiprocessing requirements.
The block diagram of equation (g) is given in Figure 10.48a1 while that of (h) is given in Figure 10.48a2.
-M.
g M+1 (n)
b(n − 1)
g(n)
−g (M+1)
M+1 (n) 1
(M+1)
1−g M+1 (n)eb* (n)
g(n)
b(n)
z −1
eb* (n)
Figure 10.48a2: Block diagram for equation (h).
Combining these diagrams with equations (a)-(f) in Table 10.13 leads to the block diagram 10.48(a). The
lack of delay elements in the paths for g-M.
M+1 (n) and g M+1 (n) violates the multiprocessing architecture.
370 Statistical and Adaptive Signal Processing - Solution Manual
a(n)
ε f (n)
x
E f (n)
+ g M+1 (n)
b(n − 1) g(n − 1)
x −g (M+1)
M+1 (n)
+ z −1
g-M.
M+1 (n)
1
X
1− g (M+1)
M+1 (n)e (n)
b∗
x −eb∗ (n)
+ g(n)
z −1 b(n)
x −ef∗ (n − 1)
a(n) +
a(n + 1)
z −1
Figure 10.48a2: Multiprocessing element for the fast Kalman algorithm using equations (a)-(h) in table 10.13.
Statistical and Adaptive Signal Processing - Solution Manual 371
a(n) b(n − 1)
f∗
−e (n)
a(n)
z −1 z −1
ε f (n − 1) a(n − 1)
g(n − 1) z −1
E f (n − 1)
g(n − 1)
z −1 z −1
g(n − 2)
z −1 b(n − 1)
−eb∗ (n − 1)
g-M.
M+1 (n)
g (M+1)
M+1 (n − 1) 1
1− g (M+1)
M+1 (n
− 1)eb∗ (n − 1)
Figure 10.48b: Section for the multiprocessing implementation of the fast Kalman algorithm using Table 10.13 and
equations (g) and (h).
(b) Rearrange the formulas in Table 10.13 as follows: (e), (g), (h), (a), (b), (c), (d), (f ). Replace n by n − 1
in (e), (k), and (l). Show that the resulting algorithm leads to the multiprocessing section shown in Figure
10.57. Identify the input-output quantities and the various multiplier factors and show that this section can
be used in the multiprocessing architecture shown in Figure 10.56. Each processor in Figure 10.56 can
be assigned to execute one or more of the designed sections. Note: You may find useful the discussions
in Lawrence and Tewksbury (1983) and in Manolakis and Patel (1992).
Working as in (a) we obtain the results shown in Figure 10.48(b).
Comments: $ %
The multiplier factors ε f (n − 1)/E f (n − 1), g (M+1)
M+1 (n), 1/ 1 − g (M+1)
M+1 (n − 1)em
b∗
(n − 1) , −eb∗ (n − 1),
and −e f ∗ (n) at each element, should be available after the processing of the sample x(n − 1) has been
completed and the sample x(n) has arrived. To start processing the sample x(n) all these quantities should
be available to each processing section.
• e f (n − 1), eb (n − 1), E f (n − 1) are available from the previous sampling interval.
• ε f (n − 1)/E f (n − 1) and g (M+1)
M+1 (n) are computed at the first section as the first and last elements
of g M+1 (n). However, since they are used$ by all processors they should
% be computed separately at
(M+1)
the beginning. Then, we compute 1/ 1 − g M+1 (n − 1)em (n − 1) . Therefore, these quantities
b∗
should be computed “outside” the sections before we start processing the sample x(n).
• e f (n) should be available before each section finishes the computation of b(n − 1) (see Figure ?).
The solution is to compute x̂(n) = a H (n − 1)x(n − 1) at the previous processing cycle and then
compute e f (n) = x(n) + x̂(n) after the arrival of x(n).
(c) Prove the formulas
-M.
b(n − 1) − g M+1 (n)eb∗ (n)
b(n) = (k)
1 − g (M+1)
M+1 (n) e (n)
b∗
If we eliminate gm (n) from (10.7.13) using (10.7.14), we obtain equations (k) and (l).
(d) Draw a block diagram of a single multiprocessing section for the obtained algorithm and show that this
section can be used in the architecture of Figure 10.56.
Figure 10.48(c) shows the updating section for the fast Kalman algorithm described by (a)-(f), (k), (l). The
lack of delay elements in the paths for g-M.
M+1 (n) and g M+1 (n) violates the multiprocessing requirements.
The multiprocessing section for this version of the fast Kalman algorithm is given in Figure 10.48(d).
(e) Rearrange the formulas (a)-(l),in Table 10.14, to obtain a version of the FAEST algorithm that complies
with the multiprocessing architecture of Figure 10.56 and draw a block diagram of the resulting updating
section.
Repeat (a) and (b).
10.49 (new version) Show that the LMS algorithm given in Table 10.3 satisfies the multiprocessing architecture in
Figure 10.56.
If we modify the LMS algorithm as follows
we can easily see that the LMS algorithm complies with the multiprocessing architecture of Figure 10.56.
10.50 Show that the a priori RLS linear prediction lattice (i.e., without the ladder part) algorithm with error feedback
complies with the multiprocessing architecture of Figure 10.56. Explain why the addition of the ladder part
violates the multiprocessing architecture. Can we rectify these violations? (See Lawrence and Tewksbury
1983.)
The lattice predictor has a modular structure
Multiprocessing is impossible because there is no delay in the emf (n) path (if emf (n) could be replaced by
emf (n − 1) there would be no problem). To overcome this problem, we notice that
which is initialized x̂0 (n) = 0. Since e0f (n) = x(n) only x(n) is not available at time n. Thus, instead of
f
em+1 (n) we can compute x̂m+1 (n) in advance, store it and have it ready for use at time n when x(n) becomes
available. These observations lead to the lattice section shown in Figure 10.50.
10.51 The fixed-length sliding window RLS algorithm is given in (10.8.4) through (10.8.10).
(a) Derive the above equations of this algorithm (see Manolakis et al. 1987).
Statistical and Adaptive Signal Processing - Solution Manual 373
a(n)
ε f (n)
x
E f (n)
g(n − 1)
+
g M+1 (n)
x −eb∗ (n)
-M.
g M+1 (n) b(n − 1)
+
1
X
1− g (M+1)
M+1 (n)e (n)
b∗
b(n) z −1
x −g (M+1)
M+1 (n)
g(n − 1)
g(n) −1
z
x −e f ∗ (n + 1)
a(n) +
z −1 a(n + 1)
Figure 10.48c: Section for the multiprocessing implementation of the fast Kalman algorithm using Table 10.13 and
equations (k) and (l).
374 Statistical and Adaptive Signal Processing - Solution Manual
b(n − 1) a(n)
a(n − 1)
a(n) z −1 z −1
z −1
−1 a(n)
z x
-M.
g M+1 (n − 1) b(n − 1)
1 x
1 − g (M+1)
M+1 (n − 1)e (n − 1)
b∗ g (M+1)
M+1 (n − 1) g(n − 1)
+
Figure 10.48c: Section for the multiprocessing implementation of the fast Kalman algorithm using Table 10.13 and
equations (k) and (l) This is the version proposed by Lawrence and Tewksbury.
x(n)
f∗
f
em (n) km (n − 1) f
em+1 (n)
-
+ z −1 +
kmb∗ (n − 1)
f∗
km (n − 1)
emb (n) b
em+1 (n − 1)
−1 −1
z + z
b
em+1 (n)
Figure 10.50: Multiprocessing session for the a-priori RLS lattice filter.
Statistical and Adaptive Signal Processing - Solution Manual 375
where w(n) is a zero-mean, unit-variance white noise process. We want to obtain a second-order linear
predictor using adaptive algorithms. Use the sliding window RLS algorithm on the data and choose
L = 50 and 100. Obtain plots of the filter coefficients and mean square error.
(d) Now use the growing memory RLS algorithm by choosing λ = 1. Compare your results with the sliding-
window RLS algorithm.
(e) Finally, use the exponentially growing memory RLS by choosing λ = (L − 1)/(L + 1) that produces the
same MSE. Compare your results.
To be completed.
10.52 Consider the definition of the MSD D(n) in (10.2.29) and that of the trace of a matrix (A.2.16).
(a) Show that D(n) = tr{(n)}, where (n) is the correlation matrix of c̃(n).
(b) For the evolution of the correlation matrix in (10.8.58), show that
tr(R−1 Rψ )
D(∞) & µMσ 2ν +
4µ
To be completed.
10.53 Consider the analysis model given in Figure 10.42. Let the parameters of this model be as follows:
0.9
co (n) model parameters: co (0) = M =2 ρ = 0.95
−0.8
ψ(n) ∼ WGN(0, Rψ ) Rψ = (0.01)2 I
Simulate the system, using three values of µ that show slow, matched, and optimum adaptations of the LMS
algorithm.
(a) Obtain the tracking plots similar to Figure 10.43 for each of the above three adaptations.
(b) Obtain the learning curve plots similar to Figure10.44 for each of the above three adaptations.
To be completed.
376 Statistical and Adaptive Signal Processing - Solution Manual
10.54 Consider the analysis model given in Figure 10.42. Let the parameters of this model be as follows
0.9
co (n) model parameters co (0) = M =2 ρ = 0.95
−0.8
ψ(n) ∼ WGN(0, Rψ ) Rψ = (0.01)2 I
Simulate the system, using three values of µ that show slow, matched, and optimum adaptations of the RLS
algorithm.
(a) Obtain the tracking plots similar to Figure 10.49 for each of the above three adaptations.
(b) Obtain the learning curve plots similar to Figure 10.50 for each of the above three adaptations.
(c) Compare your results with those obtained in Problem 10.53.
To be completed.
10.55 Consider the time-varying adaptive equalizer shown in Figure 10.58 in which the time variation of the channel
impulse response is given by
h(n) = ρh(n − 1) + 1 − ρ η(n), with
√
ρ = 0.95 η(n) ∼ WGN(0, 10) h(0) = 0.5
(a) Simulate the system for three different adaptations; that is, choose µ for slow, matched, and fast adaptations
of the LMS algorithm.
(b) Repeat part (a), using the RLS algorithm.
To be completed.
Chapter 11
Array Processing
11.1 The 2 element array with inter-element spacing of d has a signal impinging on it from and angle of φ = 0◦ at
a rate of propagation c.
since φ = 0◦ . The signal arrives at the two sensors at the same time.
(b) The same delay of 0 seconds between sensors is produced by any other signals for which sin φ = 0.
Therefore, signals impinging on the array from φ = 180◦ will also produce a delay of zero.
(c) With a single sensor we cannot determine the angle from which a signal arrives because we cannot
determine a difference in arrival time. In other words, signals from all directions will have the same
characteristics.
11.2 This problem is a Matlab based problem. Below is the Matlab code and beampatterns at φ = 45◦ and
φ = 60circ . Note that mechanical steering is modeled as the beampattern for electronic steering to broadside
and shifting the angle to the desired mechanical steering angle. In both cases we observe a smaller mainbeam
for the mechanical steering than the electronic steering due to the fact that spatial frequency is a function of
sin φ and not simply φ. This effect is more pronounced the greater the steering angle, so it is more noticeable
for the case of φ = 60◦ .
%
% Problem 11.2
%
clear
377
378 Statistical and Adaptive Signal Processing - Solution Manual
phi = -90:90;
V = exp(-j*2*pi*spacing*[0:(M-1)]’*sin(phi*pi/180))/sqrt(M);
0 0
−5 −5
−10 −10
Power Response (dB)
−20 −20
−25 −25
−30 −30
−35 −35
−40 −40
−45 −45
−50 −50
−90 −75 −60 −45 −30 −15 0 15 30 45 60 75 90 −90 −75 −60 −45 −30 −15 0 15 30 45 60 75 90
Angle (deg) Angle (deg)
Figure 11.2a: Beampatterns for a M = 20 λ/2-spaced ULA with electronic steering (solid) and mechanical
steering (dashed).
11.3 This problem is a Matlab based problem. Below is the Matlab code and three output figures. The code is
broken up into parts (a), (b), and (c) and presented sequentially along with the accompanying figures.
(a) Both signals are clearly visible in the steered responses. The expected steered response is so close to the
estimated steered response that the two overlay in Figure 11.3a.
%
% Problem 11.3
%
clear
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Part A
380 Statistical and Adaptive Signal Processing - Solution Manual
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
60 60
50 50
Steered Response (dB)
30 30
20 20
10 10
0 0
−90 −75 −60 −45 −30 −15 0 15 30 45 60 75 90 −90 −75 −60 −45 −30 −15 0 15 30 45 60 75 90
Angle (deg) Angle (deg)
Figure 11.3a: Steered responses with estimated and true correlation matrices for scenario in Problem 11.3(a) with
signals at φ = −10◦ and φ = 30◦ with powers of 20 and 25 dB, respectively.
(b) The beampattern for the beamformer steered to φ = 30◦ is shown in Figure 11.3b. The gain at φ = 30◦
is one (0 dB) so that the steered response in Figure 11.3a shows the correct power of the 25 dB signal at
φ = 30◦ . The same is true of the signal at φ = −10◦ . Elsewhere, we see the two signals leaked through the
first few principal sidelobes in the steered response near the two sources, but otherwise the response is near 0
dB, the noise level, since the two signals are not strong enough to leak through the further out sidelobes of the
beamformer.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Part B
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
−5
−10
−20
−25
−30
−35
−40
−45
−50
−90 −75 −60 −45 −30 −15 0 15 30 45 60 75 90
Angle (deg)
(c) The steered response of the spatial matched filter is shown in Figure 11.3c. Clearly the 60-dB signal is
so strong that it leaks through sidelobes of all the beamformers used to compute the steered response and the
25 dB signal at φ = 30◦ is no longer visible. Using a tapered beamformer with a Chebyshev window with
−65-dB sidelobes is sufficient to suppress this 60-dB signal when not steered to φ = −10◦ , as seen in the
steered response in Figure 11.3c. Note, however, that a slight loss is incurred for both signals and that each
one spreads out slightly further in angle as opposed to the untapered spatial matched filter.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Part C
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
60 60
50 50
Steered Response (dB)
30 30
20 20
10 10
0 0
−90 −75 −60 −45 −30 −15 0 15 30 45 60 75 90 −90 −75 −60 −45 −30 −15 0 15 30 45 60 75 90
Angle (deg) Angle (deg)
Figure 11.3c: Steered responses for scenario in Problem 11.3(c) with signals at φ = −10◦ and φ = 30◦ with
powers of 60 and 25 dB, respectively.
11.4 This problem is a Matlab based problem. Below is the Matlab code and six output figures. Note that for
this problem the signals should be at φ = 0◦ and φ = 3◦ . If your text does not have this correction, please
pass this along to the students. The code is broken up into parts (a), (b), (c), and (d) and presented sequentially
along with the accompanying figures.
(a) The two signal at φ = 0◦ and φ = 3◦ are not resolved in the steered response. The cause is the limited
aperture and the proximity of the two signals in angle.
%
% Problem 11.4
%
clear
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Part A
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
25
20
10
−5
−90 −75 −60 −45 −30 −15 0 15 30 45 60 75 90
Angle (deg)
Figure 11.4a: Steered responses for scenario in Problem 11.4(a) for an array with M = 30 λ/2-spaced elements
with signals at φ = 0◦ and φ = 3◦ both with powers of 20 dB.
(b) Now the two signals have been resolved in the steered response because we have doubled the aperture of
386 Statistical and Adaptive Signal Processing - Solution Manual
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Part B
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Clear out the entire workspace and start with 60 elements
clear
25
20
10
−5
−90 −75 −60 −45 −30 −15 0 15 30 45 60 75 90
Angle (deg)
Figure 11.4b: Steered responses for scenario in Problem 11.4(a) for an array with M = 60 λ/2-spaced elements
with signals at φ = 0◦ and φ = 3◦ both with powers of 20 dB.
axis([-90 90 -5 25]);
grid
set(gca,’xtick’,-90:15:90);
(c) Despite the fact that the array only has M = 30 elements as in part (a), we are able to resolve the two
signals. The reason is that the aperture for the M = 30 λ-spaced element array is equal to the aperture of the
M = 60 λ/2-spaced element. Note that in this case due to the increased element spacing we observe spatial
aliasing in the steered response in the form of the additional peaks at φ ≈ 75◦ and φ ≈ 90◦
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Part C
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Clear out the entire workspace and start with 30 elements but with
% element spacing of lambda
clear
25
20
10
−5
−90 −75 −60 −45 −30 −15 0 15 30 45 60 75 90
Angle (deg)
Figure 11.4c: Steered responses for scenario in Problem 11.4(a) for an array with M = 60 λ-spaced elements with
signals at φ = 0◦ and φ = 3◦ both with powers of 20 dB.
v1 = exp(-j*2*pi*spacing*[0:(M-1)]’*sin(phi1*pi/180))/sqrt(M);
v2 = exp(-j*2*pi*spacing*[0:(M-1)]’*sin(phi2*pi/180))/sqrt(M);
(d) The beampatterns for the spatial matched filter (beamformer) at φ = 0◦ used to compute the steered response
are plotted in Figure 11.4d. Increasing the number of λ/2-spaced elements from M = 30 to M = 60 increases
the resolution of the beamformer by a factor of two as is evidenced by a mainbeam with half the size. In the
Statistical and Adaptive Signal Processing - Solution Manual 389
case of the M = 30 λ-spaced element array, the mainbeam size is the same as for the M = 60 λ/2-spaced
element array since the aperture of the two arrays is the same. However, in the case of the λ element spacing,
we observe a grating lobe at φ = 90◦ for the beamformer steered to φ = 0◦ .
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Part D
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Clear out the entire workspace and compute the beampatterns for
% the spatial matched filters in parts a, b, and c steered to array broadside
clear
0 0 0
−5 −5 −5
Figure 11.4d: Beampatterns for the spatial matched filters steered to φ = 0◦ with (a) M = 30 λ/2-spaced
elements, (b) M = 60 λ/2-spaced elements and (c) M = 30 λ-spaced elements.
11.5 This problem is a Matlab based problem. Below is the Matlab code and four output figures. Note that for
this problem the signals should be at φ = 0◦ and φ = 3◦ . If your text in Problem 11.4 does not have this
correction, please pass this along to the students.
%
% Problem 11.5
%
clear
Statistical and Adaptive Signal Processing - Solution Manual 391
grid
set(gca,’xtick’,-90:15:90);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Repeat the same process for 50% array thinning
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clear
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Generate 3 randomly thinned arrays both at 50% and 75% and compute
% the beampatterns for the spatial matched filter at 0 degrees
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clear
c3_75 = exp(-j*2*pi*spacing*[elements-1]’*sin(phi_steer*pi/180))/sqrt(M);
V3_75 = exp(-j*2*pi*spacing*[elements-1]’*sin(phi*pi/180))/sqrt(M);
C3_75_bp = V3_75’*c3_75;
figure
plot(phi,10*log10(abs(C2_75_bp).^2),’b’,’linewidth’,2.5);
xlabel(’Angle (deg)’,’fontweight’,’bold’,’fontsize’,20);
ylabel(’Power Response (dB)’,’fontweight’,’bold’,’fontsize’,20);
set(gca,’fontweight’,’bold’,’fontsize’,18);
axis([-90 90 -50 0]);
grid
set(gca,’xtick’,-90:15:90);
figure
plot(phi,10*log10(abs(C3_75_bp).^2),’b’,’linewidth’,2.5);
xlabel(’Angle (deg)’,’fontweight’,’bold’,’fontsize’,20);
ylabel(’Power Response (dB)’,’fontweight’,’bold’,’fontsize’,20);
set(gca,’fontweight’,’bold’,’fontsize’,18);
axis([-90 90 -50 0]);
grid
set(gca,’xtick’,-90:15:90);
V2_50 = exp(-j*2*pi*spacing*[elements-1]’*sin(phi*pi/180))/sqrt(M);
C2_50_bp = V2_50’*c2_50;
figure
plot(phi,10*log10(abs(C2_50_bp).^2),’b’,’linewidth’,2.5);
xlabel(’Angle (deg)’,’fontweight’,’bold’,’fontsize’,20);
ylabel(’Power Response (dB)’,’fontweight’,’bold’,’fontsize’,20);
set(gca,’fontweight’,’bold’,’fontsize’,18);
axis([-90 90 -50 0]);
grid
set(gca,’xtick’,-90:15:90);
figure
plot(phi,10*log10(abs(C3_50_bp).^2),’b’,’linewidth’,2.5);
xlabel(’Angle (deg)’,’fontweight’,’bold’,’fontsize’,20);
ylabel(’Power Response (dB)’,’fontweight’,’bold’,’fontsize’,20);
set(gca,’fontweight’,’bold’,’fontsize’,18);
axis([-90 90 -50 0]);
grid
set(gca,’xtick’,-90:15:90);
The steered responses for the case of 75% (45 element) and 50% (30 element) thinned arrays are shown in
Figures 11.5a and 11.5b. In both cases we are able to resolve the two signals at φ = 0◦ and φ = 3◦ since
the aperture is equal to the M = 60 λ/2-spaced array. Due to the reduced number of elements in the random
spacing the background levels in the steered response are raised. The beampatterns for the three different
random spacings for the 75% and 50% thinning are shown in Figures 11.5c and 11.5d. Here, we see that the
increase in the background level was due to the elevated sidelobes that get worse the more thinning is done. In
addition, we see that the sidelobes exhibit random behavior caused by the random thinning of the arrays.
396 Statistical and Adaptive Signal Processing - Solution Manual
25
20
10
−5
−90 −75 −60 −45 −30 −15 0 15 30 45 60 75 90
Angle (deg)
Figure 11.5a: Steered responses for scenario in Problem 11.4(a) for an array with M = 60 λ/2-spaced element
array thinned by 75% with signals at φ = 0◦ and φ = 3◦ both with powers of 20 dB.
25
20
Steered Response (dB)
15
10
−5
−90 −75 −60 −45 −30 −15 0 15 30 45 60 75 90
Angle (deg)
Figure 11.5b: Steered responses for scenario in Problem 11.4(a) for an array with M = 60 λ/2-spaced element
array thinned by 50% with signals at φ = 0◦ and φ = 3◦ both with powers of 20 dB.
0 0 0
−5 −5 −5
(a) 1st thinned array. (b) 2nd thinned array. (c) 3rd thinned array.
Figure 11.5c: Beampatterns for three different randomly thinned M = 60 λ/2-spaced element array thinned by
75% (M = 45 elements).
Statistical and Adaptive Signal Processing - Solution Manual 397
0 0 0
−5 −5 −5
(a) 1st thinned array. (b) 2nd thinned array. (c) 3rd thinned array.
Figure 11.5d: Beampatterns for three different randomly thinned M = 60 λ/2-spaced element array thinned by
50% (M = 30 elements).
11.6 We have an M = 20 element array whose even-numbered elements have a gain of 1 and whose odd-numbered
elements have a gain of 3/4. For an array whose elements all have equal gain, the beamforming gain is simply
the ratio of the array and element SNR
SNRarray
G bf =
SNRelement
Since the signal and noise powers at the array output are
Ps = (Mσ s )2 = M 2 σ 2s
2
M
Pn = E wm (n) = Mσ 2w
m=1
G bf = M
Now for the scenario described above with unequal gain on the elements of the array with half the elements
having a gain of 1 and half having a gain of 3/4. The signal power at the output of the array is
2
M M3
Ps = σs + σs
2 2 4
2
7
= Mσ s
8
49 2
= M
64
398 Statistical and Adaptive Signal Processing - Solution Manual
−1
c = −λRi+n v φs (1)
Similarly, taking the gradient of L (c, λ) with respect to λ and setting it to zero
∇ λ L (c, λ) = c H v φ s − 1 = 0 (2)
Substituting for (1) into (2), yields
−1
−λ v H φ s Ri+n v φs − 1 = 0
and solving for λ
−1
λ=
−1
(3)
vH φ s Ri+n v φ s
Substituting (3) back into (1), we have the minimum variance or optimum beamformer weight vector for the
look-direction φ s
−1
Ri+n v φs
co =
−1
v H φ s Ri+n v φs
Statistical and Adaptive Signal Processing - Solution Manual 399
11.8 This problem is a Matlab based problem. Below is the Matlab code and one output figure. Use a total of
M = 30 λ/2-spaced elements if not stated in your text. If your text does not have this correction, please pass
this along to the students.
%
% Problem 11.8
%
clear
for n = 1:length(phi)
v0 = exp(-j*2*pi*spacing*[0:(M-1)]’*sin(phi(n)*pi/180))/sqrt(M);
c_unnorm = R_in\v0;
norm_mvdr = 1/(c_unnorm’*v0);
norm_amf = 1/sqrt(c_unnorm’*v0);
norm_noise = 1/sqrt(v0’*(inv(R_in).^2)*v0);
c_mvdr = norm_mvdr * c_unnorm;
c_amf = norm_amf * c_unnorm;
c_noise = norm_noise * c_unnorm;
R_steer_mvdr(n) = c_mvdr’ * R_in * c_mvdr;
R_steer_amf(n) = c_amf’ * R_in * c_amf;
R_steer_noise(n) = c_noise’ * R_in * c_noise;
end
plot(phi,10*log10(abs(R_steer_mvdr)),’b’,’linewidth’,2.5);
xlabel(’Angle (deg)’,’fontweight’,’bold’,’fontsize’,20);
ylabel(’Steered Response (dB)’,’fontweight’,’bold’,’fontsize’,20);
set(gca,’fontweight’,’bold’,’fontsize’,18);
axis([-90 90 -32 32]);
set(gca,’xtick’,-90:30:90);
set(gca,’ytick’,-30:10:30);
grid
set(gca,’xtick’,-90:15:90);
figure
plot(phi,10*log10(abs(R_steer_amf)),’b’,’linewidth’,2.5);
xlabel(’Angle (deg)’,’fontweight’,’bold’,’fontsize’,20);
ylabel(’Steered Response (dB)’,’fontweight’,’bold’,’fontsize’,20);
set(gca,’fontweight’,’bold’,’fontsize’,18);
axis([-90 90 -32 32]);
set(gca,’xtick’,-90:30:90);
set(gca,’ytick’,-30:10:30);
grid
set(gca,’xtick’,-90:15:90);
figure
plot(phi,10*log10(abs(R_steer_noise)),’b’,’linewidth’,2.5);
xlabel(’Angle (deg)’,’fontweight’,’bold’,’fontsize’,20);
ylabel(’Steered Response (dB)’,’fontweight’,’bold’,’fontsize’,20);
set(gca,’fontweight’,’bold’,’fontsize’,18);
axis([-90 90 -32 32]);
set(gca,’xtick’,-90:30:90);
set(gca,’ytick’,-30:10:30);
grid
set(gca,’xtick’,-90:15:90);
In this problem, the optimum beamformers with the three different normalizations are computed for the scenario
with two interference sources at φ = 45◦ and φ = 20◦ with powers of 30 and 15 dB, respectively. The steered
response is computed for the three different normalizations and shown in Figure 11.8a. The steered response
for the MVDR-normed optimum beamformer has the correct power estimates for both of the interference
sources as well as the noise background at 0 dB. Thus, the MVDR normalization generates a spatial power
spectrum. On the other hand, the output level of the AMF-normed optimum beamformer is constant by design
(unit-gain on interference-plus-noise). This normalization is particularly useful if we want to set a detection
threshold independent of angle to generate a constant probability of detection. The steered response for the
optimum beamformer with unit-gain on noise normalization produces the reciprocal of the MVDR-normed
steered response.
11.9
11.10 Starting with the correlation matrix with the signal at φ s with amplitude σ s present
Rx = Ri+n + σ 2s v φ s v H φ s (1)
Statistical and Adaptive Signal Processing - Solution Manual 401
30 30 30
0 0 0
(a) MVDR normalization. (b) AMF normalization. (c) Unit noise gain normalization.
Figure 11.8: Steered responses for scenario in Problem 11.8 for optimum beamformers with (a) MVDR , (b) AMF
and (c) unit-gain on noise normalizations.
we want to show that the optimum beamformer weights do not change when the signal is present in the case
of no mismatch, i.e.,
−1
R−1
x v φs Ri+n v φs
co = H
−1
=
−1
v φ s Rx v φ s v H φ s Ri+n v φs
Using the matrix inversion lemma from Appendix A, the inverse correlation matrix from (1) is
2 −1
H
−1
−1 σ R v φ s v φ s Ri+n
R−1x = Ri+n −
s i+n
−1
1 + σ s v φ s Ri+n
2 H v φs
Multiplying by v φ s , we have
−1
−1
−1
σ 2s Ri+n v φ s v H φ s Ri+n v φs
R−1
φ s = Ri+n v φ s −
x v
−1
1 + σ 2s v H φ s Ri+n v φ s
−1
−1
σ 2s v H φ s Ri+n v φs
= Ri+n v φ s 1 −
−1
1 + σ 2s v H φ s Ri+n v φ s
−1
1
= Ri+n v φs
−1
(2)
1 + σ s v φ s Ri+n v φ s
2 H
Similarly, we can compute v H φ s R−1
x v φ s , by multiplying (1) by v φ s
−1
v H φ s Ri+n v φs
v φ s R−1
H
x v φs =
−1
(3)
1 + σ 2s v H φ s Ri+n v φ s
Substituting (1) and (2) for the numerator and denominator of the optimum beamformer, we have
R−1
x v φs
co =
v H φ s R−1x v φs
−1
−1
Ri+n v φs 1 + σ 2s v H φ s Ri+n v φs
=
−1
·
−1
1 + σ s v φ s Ri+n v φ s
2 H v φ s Ri+n v φ s
H
−1
R v φs
= i+n
−1
v H φ s Ri+n v φs
402 Statistical and Adaptive Signal Processing - Solution Manual
Therefore, in the case of no signal mismatch, the optimum beamformer is not affected by the presence of the
signal of interest in the correlation matrix. Note that in practice it may not be possible to perfectly match the
signal of interest which can have significant performance implications.
11.11 This problem is a Matlab based problem. Below is the Matlab code and two output figures. The code is
broken up into parts (a) and (b) and presented sequentially along with the accompanying figures.
(a) In this part of the problem, we examine the effect of mismatch when the signal is not in the correlation
matrix. The output powers for the cases of no mismatch (signal at φ = 0◦ ) and mismatch in angle (signal at
φ = −1◦ ) shown by the dashed and solid lines in Figure 11.11a. The mismatch loss is simply the difference
between these two lines in decibels (or their ratio). From the figure, we observe an approximate loss of −3
dB for all angles independent of the signal-to-noise ratio of the signal since the signal is not included in the
correlation matrix. This result can be compared to that predicted by (11.4.12).
%
% Problem 11.11
%
clear
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Part A
%
Statistical and Adaptive Signal Processing - Solution Manual 403
35
30
25
15
10
−5
0 5 10 15 20 25 30
Signal SNR (dB)
Figure 11.11a: Output power as a function of signal-to-noise ratio for the case of no mismatch (φ = 0◦ , dashed
line) and angle mismatch (φ = −1◦ , solid line) when the signal is not contained in the correlation matrix.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Compute the optimum beamformer to the desired angle
phi0 = 0; % angle to which we are steering (deg)
v0 = exp(-j*2*pi*spacing*[0:(M-1)]’*sin(phi0*pi/180))/sqrt(M);
c_unnorm = R_in\v0; % unnormalized optimum beamformer
c_opt = c_unnorm/(v0’*c_unnorm); % MVDR norm on optimum beamformer
% Plot out the output SNR in decibels vs. the signal SNR
figure
plot(SNR_db,10*log10(abs(P_s)),’b’,...
SNR_db,10*log10(abs(P0)),’r--’,’linewidth’,2.5);
xlabel(’Signal SNR (dB)’,’fontweight’,’bold’,’fontsize’,20);
ylabel(’Output SNR (dB)’,’fontweight’,’bold’,’fontsize’,20);
set(gca,’fontweight’,’bold’,’fontsize’,18);
axis([0 30 -5 35]);
grid
(b) In this part of the problem, we examine the effect of mismatch when the signal is in the correlation matrix.
Here, we observe that, as predicted, the loss is strongly dependent on the signal-to-noise ratio. The stronger
the signal, the larger the loss incurred is. This loss should be compared to the loss predicted by (11.4.17). Note
that the loss computed and plotted in this problem is combination of the mismatch losses L sm and L sp .
404 Statistical and Adaptive Signal Processing - Solution Manual
−10
−20
Loss (dB)
−30
−40
−50
−60
0 5 10 15 20 25 30
Signal SNR(dB)
Figure 11.11b: Mismatch loss versus signal-to-noise ratio for a mismatched steering direction (φ = −1◦ ) when the
signal is contained in the correlation matrix .
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Part B
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Plot out the mismatch loss versus the signal SNR in decibels
figure
plot(SNR_db,10*log10(L_mismatch),’b’,’linewidth’,2.5);
xlabel(’Signal SNR(dB)’,’fontweight’,’bold’,’fontsize’,20);
ylabel(’Loss (dB)’,’fontweight’,’bold’,’fontsize’,20);
set(gca,’fontweight’,’bold’,’fontsize’,18);
axis([0 30 -65 0]);
grid
11.12 This problem is a Matlab based problem. Below is the Matlab code and two output figures. The code is
broken up into parts (a) and (b) and presented sequentially along with the accompanying figures. The signal
Statistical and Adaptive Signal Processing - Solution Manual 405
level should be Mσ 2s = 20 dB instead of 30 dB. In both parts (a) and (b), the problem should read: ”Compute
and plot the mismatch loss for diagonal loading levels of 0 to 20 dB". If your text does not have this correction,
please pass this along to the students.
(a) In this part of the problem, we examine the effect of diagonal loading on the mismatch loss when the signal
is not in the correlation matrix. The output powers for the cases of no mismatch (signal at φ = 0◦ , dashed
line) and mismatch in angle (signal at φ = −1◦ , solid line) are plotted in Figure 11.12a. The mismatch loss
is simply the difference between these two lines in decibels (or their ratio). From the figure, we observe an
approximate loss of −3 dB for all diagonal loading levels since the signal is not included in the correlation
matrix.
%
% Problem 11.12
%
clear
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Part A
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Compute the optimum beamformer to the desired angle
phi0 = 0; % angle to which we are steering (deg)
406 Statistical and Adaptive Signal Processing - Solution Manual
35
30
25
15
10
−5
0 5 10 15 20 25 30
Diagonal Loading Level (dB)
Figure 11.12a: Output power as a function of diagonal loading level for the case of no mismatch (φ = 0◦ , dashed
line) and angle mismatch (φ = −1◦ , solid line) when the signal is not contained in the correlation matrix.
v0 = exp(-j*2*pi*spacing*[0:(M-1)]’*sin(phi0*pi/180))/sqrt(M);
% Plot out the output powers versus diagonal loading level in decibels
figure
plot(DLL_db,10*log10(abs(P_s)),’b’,...
DLL_db,10*log10(abs(P0)),’r--’,’linewidth’,2.5);
xlabel(’Diagonal Loading Level (dB)’,’fontweight’,’bold’,’fontsize’,20);
ylabel(’Output SNR (dB)’,’fontweight’,’bold’,’fontsize’,20);
set(gca,’fontweight’,’bold’,’fontsize’,18);
axis([0 30 -5 35]);
grid
(b) In this part of the problem, we examine the effect of diagonal loading on mismatch loss when the signal is
in the correlation matrix. We observe that the more heavily we diagonally load the more signal we are able to
protect from mismatch loss. This protection from mismatch loss when the signal is in the correlation matrix is
achieved at the expense of interference cancellation performance in the case of diagonal loading. Note that the
loss computed and plotted in this problem is combination of the mismatch losses L sm and L sp . Therefore, the
Statistical and Adaptive Signal Processing - Solution Manual 407
mismatch loss can never exceed the -3-dB level due to the steering direction mismatch loss that was observed
in part (a).
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Part B
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Plot out the mismatch loss versus diagonal loading level in decibels
figure
plot(DLL_db,10*log10(L_mismatch),’b’,’linewidth’,2.5);
xlabel(’Diagonal Loading Level (dB)’,’fontweight’,’bold’,’fontsize’,20);
ylabel(’Loss (dB)’,’fontweight’,’bold’,’fontsize’,20);
set(gca,’fontweight’,’bold’,’fontsize’,18);
axis([0 30 -65 0]);
grid
11.13 The linearly constrained minimum variance (LCMV) beamformer weights clcmv are found by solving the
constrained minimization from (11.6.5)
min c H Rx c subject to CH c = δ
where C is the constraint matrix and δ is the vector of corresponding responses to the constraints. Using
Lagrange multiplers from Appendix B.2, the LCMV beamformer weights are found to be
H −1
−1
clcmv = R−1
x C C Rx C δ
which minimizes the Lagrangian function. Using Lagrange multiplers from Appendix B.2, we define the
following two functions
f (c) = c H Rx c g (c) = C H c − δ
The Lagrangian function is then given by
L (c, λ) = f (c) + λ H g (c)
= c H Rx c + λ H C H c − δ
408 Statistical and Adaptive Signal Processing - Solution Manual
−10
−20
Loss (dB)
−30
−40
−50
−60
0 5 10 15 20 25 30
Diagonal Loading Level (dB)
Figure 11.12b: Mismatch loss versus diagonal loading level for a mismatched steering direction (φ = −1◦ ) when
the signal is contained in the correlation matrix.
where λ is the vector of Lagrange multipliers whose length is equal to the number of constraints (same length
as the constraint response vector δ). Taking the gradient of the Lagrangian function with respect to c, we have
∇ c L (c, λ) = Rx c + Cλ
For the method of steepest descent (Frost’s algorithm), the adaptive weights at time n+1 are found by modifying
the weights at time n by the gradient of the Lagrangian function scaled by the update factor µ
c (n + 1) = c (n) − µ∇ c L (c, λ)
= c (n) − µ [Rx c (n) + Cλ (n)] (1)
Let us now define the non-adaptive portion of the weight update equation
−1
cna = C C H C δ
Statistical and Adaptive Signal Processing - Solution Manual 409
11.15 In this problem, we study the performance of the sidelobe canceler. Let us start by defining the main channel
signal as
where i mc (n) = gi i (n) is the interference signal i (n) with a main channel gain gi . The interference signal is
assumed to be temporally uncorrelated with unit variance. The main channel thermal noise signal wmc (n) is
also temporally uncorrelated and has a variance of σ 20 . Likewise, the signal in the auxiliary channel, consisting
of an M-element λ/2-spaced ULA, is given by
xa (n) = s (n) v φ s + σ i i (n) v φ i + w (n)
where w (n) is the the thermal noise signal in the array with a variance of σ 2w in each channel (element).
where Ps = |s (n)|2 . The cross-correlation vector between the auxiliary channels and the main channel
is
∗
rma = E xa (n) xmc (n)
= Ps gs∗ v (φ s ) + σ i gi∗ v (φ i )
yi+n (n) = i i+n (n) + wi+n (n) − σ i i (n) caH v (φ i ) − caH w (n)
Recall that
Ra = Ri+n + Ps v (φ s ) v H (φ s )
Here, we make the assumption that Ps << σ 2w < σ 2i so that the correlation matrix and cross-correlation
vector from part (a) are
Ra ≈ Ri+n
rma ≈ σ i gi∗ v (φ i )
Substituting (2) and (3) back into (1), we find the interference-plus-noise output power is
2
Pi+n = gi2 + σ 20 + σ 2i gi∗ v H (φ i ) Ri+n
−1
Ri+n Ri+n−1
v (φ i )
" #
−2 · Real σ i gi∗ v H (φ i ) Ri+n −1
2
v (φ i )
= gi2 + σ 20 + σ 2i gi∗ v H (φ i ) Ri+n
−1
2
v (φ i )
σ 2
= σ 20 + 1 − 2 i 2 gi2 (4)
σi + σw
where
Recall the expressions for the correlation matrix Ra and the cross-correlation vector rma from part (a).
Using the matrix inversion lemma from Appendix A, we have
−1 2 −1
−1 Ri+n σ s v (φ s ) v H (φ s ) Ri+n
Ra−1 = Ri+n + −1
(7)
1 + σ 2s v H (φ s ) Ri+n v (φ s )
Also using the matrix inversion lemma on the interference-plus-noise correlation matrix as was done for
part (b), we have
−1 1 σ 2i v (φ i ) v H (φ i )
Ri+n = 2 I − (8)
σw σ 2w + σ 2i
Substituting (8) into (7), and (7) into (5), and finally (5) into (6), along with some algebraic manipulation,
we have the expression for the output signal power
σ 2i + σ 2w
Ps = ·
σ2
σ 2i + σ 2w + σ 2s 1 + σ 2i 1 − v H (φ i ) v H (φ s )
w
σ 2
σ2
2
|gs |2 − 2 2 i 2 Real gi gs∗ v H φ i v φ s + 2 i 2 |gi |2 v H φ i v φ s (9)
σi + σw σi + σw
The first term in (8) represents the signal cancellation due to its inclusion in the auxiliary channels. One can
see that this term has a maximum value of unit when σ 2s = 0. The second term in the expression for the output
signal power represents the signal gain due to interference cancellation of the sidelobe canceler.
412 Statistical and Adaptive Signal Processing - Solution Manual
−1
H −1
−1
cmvdr = Ri+n v φ s v φ s Ri+n v φs
−1
Ri+n v φs
=
H −1
v φ s Ri+n v φ s
= co
Pi+n = c H Ri+n c
Pi+n = clcmv
H
Ri+n clcmv
H −1
−1 H −1 −1
−1
−1
= δ C Ri+n C C Ri+n Ri+n Ri+n
H
C C H Ri+n C δ
−1
−1
= δ H C H Ri+n C δ
11.17 As with the minimum variance distortionless response (MVDR) beamformer, the linearly constrained minimum
variance (LCMV) beamformer can also be implemented using a generalized sidelobe canceler (GSC). Recall
the constrained minimization for the LCMV beamformer from (11.6.1)
where C is the M × K matrix consisting of K constraint vectors
δ is the K ×1 vector of constraint responses.
and
Recall that for the single constraint MVDR beamformer v φ s B formed a basis for the M-dimensional
space in which the beamforming weight vector lies.
B is the M × (M − 1) blocking matrix that is orthogonal
to the look-direction constraint vector, i.e., B H v φ s = 0. In the case of the multiple constraints in the LCMV
beamformer with K constraints, [C B] must span the M-dimensional space for the LCMV beamformer weight
vector and, thus, the blocking matrix B is a M × (M − K ) matrix. Again, we require that B H C = 0. As with
the GSC for the MVDR beamformer, the GSC for the LCMV beamformer consists of an upper branch that
satisfies the constraint using a quiescent or non-adaptive weight vector cq and a lower branch with the blocking
matrix B and the unconstrained adaptive weight vector c B . The overall weight vector can then be written as
c = cq − Bc B (1)
cq = Cc̃
is a linear combination of the K constraints, i.e. it must lie in the constraint subspace. Requiring (1) to satisfy
the LCMV constraint C H c = δ, we find that
C H cq = C H Cc̃ = δ
Statistical and Adaptive Signal Processing - Solution Manual 413
and the quiescent weight vector or the non-adaptive portion in the upper branch of the GSC is
−1
cq = Cc̃ = C C H C δ
Now, looking at the unconstrained minimization that computes an adaptive weight vector c B in the lower branch
of the GSC that minimizes the overall output power Pi+n given by
H
Pi+n = cq − Bc B Ri+n cq − Bc B
= cqH Ri+n cq − cqH Ri+n Bc B − c BH B H Ri+n cq + c BH B H Ri+n Bc B
−1 H
If we complete the square by adding and subtracting the term cqH Ri+n B B H Ri+n B B Ri+n cq from Pi+n , we
have
$
−1 %H $
−1 %
Pi+n = c B − B H Ri+n B B H Ri+n Bcq B H Ri+n B c B − B H Ri+n B B H Ri+n Bcq
−1
+cqH Ri+n cq − cqH Ri+n B B H Ri+n B B H Ri+n cq (3)
If we minimize Pi+n with respect to c B by taking the derivative with respect to c B and setting it to zero, we see
that the last two terms in (3) drop out since they are independent of c B . Thus ,the adaptive weight vector in the
lower branch of the GSC is
−1 H
c B = B H Ri+n B B Ri+n cq (4)
Note that correlation matrix in the lower branch following the blocking matrix is
R B = E x B (n) x BH (n) = B H Ri+n B
and the cross-correlation vector between the lower branch of the GSC and the upper branch is
r B = E x B (n) y0∗ (n)
= E B H x (n) x H (n) cq
= B H Ri+n cq
Using these expressions, we can put the adaptive weight vector for the GSC of the LCMV beamformer from
(4) in the familiar form from (11.3.42)
c B = R−1
B rB
11.18 This problem is a Matlab based problem. Below is the Matlab code and three output figures. The code is
broken up into parts (a), (b) and (c) and presented sequentially along with the accompanying figures. Note that
the interference scenario is not stressing enough to illustrate the fact that too few degrees of freedom (number
of subarrays) will compromise interference nulling capability. See the new problem 11.22 that is not included
in your textbook but instead found in this solution manual. This problem, however, is useful for students to
learn how to beamform using subarrays.
(a) The signal is clearly visible at φ = 0◦ with a SNR = 20 dB. The M = 20 element array has sufficient
degrees of freedom to cancel the interferer at φ = 30◦ .
414 Statistical and Adaptive Signal Processing - Solution Manual
%
% Problem 11.18
%
clear
% Compute the array response vectors for the signal of interest and
% the interference
v_s = exp(-j*2*pi*spacing*[0:(M-1)]’*sin(phi_s*pi/180))/sqrt(M);
v_i = exp(-j*2*pi*spacing*[0:(M-1)]’*sin(phi_i*pi/180))/sqrt(M);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Part A
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
20
0 100 200 300 400 500 600 700 800 900 1000
Sample
Figure 11.18a: Output signal for the full array SMI adaptive beamformer with M = 20 elements.
(b) As in part (a), the signal is clearly visible at φ = 0◦ with a SNR = 20 dB. The Q = 4 subarrays or degrees
of freedom are sufficient to cancel the single interferer at φ = 30◦ .
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Part B
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Q = 4; % number of non-overlapping subarrays
M_sub = 5; % number of elements per subarray
20
0 100 200 300 400 500 600 700 800 900 1000
Sample
Figure 11.18b: Output signal for the SMI partially adaptive beamformer with Q = 4 nonoverlapping subarrays
with M̃ = 5 elements.
(c) As in parts (a) and (b), the signal is clearly visible at φ = 0◦ with a SNR = 20 dB. The Q = 2 subarrays
or degrees of freedom are sufficient to cancel the single interferer at φ = 30◦ . The interference scenario is not
stressing enough to illustrate the fact that too few degrees of freedom will limit the ability to cancel interferers.
See problem 11.22 in this solutions manual for a more stressing case.
Statistical and Adaptive Signal Processing - Solution Manual 417
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Part C
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Q = 2; % number of non-overlapping subarrays
M_sub = 10; % number of elements per subarray
11.19 This problem is a Matlab based problem. Below is the Matlab code and three output figures. The code is
broken up into parts (a), (b) and (c) and presented sequentially along with the accompanying figures. Note that
the interference scenario is not stressing enough to illustrate the fact that too few degrees of freedom (number
of beams) will compromise interference nulling capability. See the new problem 11.23 that is not included in
your textbook but instead found in this solution manual. This problem, however, is useful for students to learn
how to implement an adaptive beamformer in beamspace which is commonly done in practical applications.
418 Statistical and Adaptive Signal Processing - Solution Manual
20
0 100 200 300 400 500 600 700 800 900 1000
Sample
Figure 11.18c: Output signal for the SMI partially adaptive beamformer with Q = 2 nonoverlapping subarrays
with M̃ = 10 elements.
(a) The signal is clearly visible at φ = 0◦ with a SNR = 20 dB. The M = 40 element array has sufficient
degrees of freedom to cancel the interferer at φ = 20◦ .
%
% Problem 11.19
%
clear
% Compute the array response vectors for the signal of interest and
% the interference
v_s = exp(-j*2*pi*spacing*[0:(M-1)]’*sin(phi_s*pi/180))/sqrt(M);
v_i = exp(-j*2*pi*spacing*[0:(M-1)]’*sin(phi_i*pi/180))/sqrt(M);
x_s(:,N_s) = (10^(P_s_db/20))*v_s;
x_i = (10^(P_i_db/20))*v_i*(randn(1,N) + i*randn(1,N))/sqrt(2);
x_n = (randn(M,N) + i*randn(M,N))/sqrt(2);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Part A
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
(b) As in part (a), the signal is clearly visible at φ = 0◦ with a SNR = 20 dB. The 11 beams or degrees of
freedom are sufficient to cancel the single interferer at φ = 20◦ .
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Part B
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Angles of beam in beamspace
phi_bs = -5:5;
B = length(phi_bs);
20
0 100 200 300 400 500 600 700 800 900 1000
Sample
Figure 11.19a: Output signal for the full array SMI adaptive beamformer with M = 40 elements.
for b = 1:B
v_bs = exp(-j*2*pi*spacing*[0:(M-1)]’*sin(phi_bs(b)*pi/180))/sqrt(M);
T_bs(1:M,b) = v_bs;
end
(c) As in parts (a) and (b), the signal is clearly visible at φ = 0◦ with a SNR = 20 dB. The 3 beams or degrees
of freedom are sufficient to cancel the single interferer at φ = 20◦ The interference scenario is not stressing
Statistical and Adaptive Signal Processing - Solution Manual 421
20
0 100 200 300 400 500 600 700 800 900 1000
Sample
Figure 11.19b: Output signal for the SMI partially adaptive beamformer with 11 beams between −5◦ ≤ φ ≤ 5◦ at
1◦ increments.
enough to illustrate the fact that too few degrees of freedom will limit the ability to cancel interferers. See
problem 11.23 in this solutions manual for a more stressing case.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Part C
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clear T_bs
20
0 100 200 300 400 500 600 700 800 900 1000
Sample
Figure 11.19c: Output signal for the SMI partially adaptive beamformer with 3 beams at φ = −1◦ , 0◦ , and1◦ .
11.20 Starting with the SINR loss for a beamformer steered to φ s from (11.3.18)
SINRout φ s
L sinr = (1)
SNR0
where SINRout φ s is the output SINR at φ s and SNR0 is the output signal-to-noise ratio in the absence of
interference (noise-only) given by
σ 2s
SNR0 = M (2)
σ 2w
The weight vector for the partially adaptive beamformer with a rank-reducing transformation T in a Q-
dimensional subspace is given by
−1
c̃ = α R̃i+n ṽ φ s
R̃i+n = T H Ri+n T
Statistical and Adaptive Signal Processing - Solution Manual 423
ṽ φ s = T H v φ s
are the interference-plus-noise correlation matrix and steering vector projected into the Q-dimensional sub-
space. If we include the rank-reducing transformation, the resulting M × 1 beamforming weight vector is
cpa = Tc̃
Mσ 2s
=
c̃ H T H Ri+n Tc̃
Mσ 2s
=
˜ c̃
c̃ H Ri+n
Mσ 2
2
−1
=
−1 s −1
· ṽ H φ s R̃i+n ṽ φ s
ṽ H φ s R̃i+n R̃i+n R̃i+n ṽ φ s
−1
= Mσ 2s ṽ H φ s R̃i+n ṽ φ s (3)
Substituting (2) and (3) back into the SINR loss equation in (1), we have the SINR loss for a partially adaptive
beamformer
−1
Mσ 2s ṽ H φ s R̃i+n ṽ φ s
L sinr =
Mσ s /σ w
2 2
−1
= σ w ṽ φ s R̃i+n ṽ φ s
2 H
11.21 This problem is a Matlab based problem. Below is the Matlab code and three output figures. The code is
broken up into parts (a) and (c) [no code for part(b)] and presented sequentially along with the accompanying
figures.
(a) The SINR loss for the scenario with a single interferer is plotted in Figure 11.21a. Note that the SINR loss
is computed by finding the optimum beamformer at each angle −90 ≤ φ < 90. The SINR loss has a minimum
value of the interference power at the angle of the interference. Otherwise, the SINR loss is near 0 dB since
the interference has been effectively canceled at these other angles.
%
% Problem 11.21
%
clear
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Part A
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
for n = 1:length(phi)
% steering vector to current angle
u_s = spacing*sin(phi(n)*pi/180); % spatial frequency
v = exp(-j*2*pi*[0:(M-1)]’*u_s)/sqrt(M); % steering vector
−10
−30
−40
grid
(b) From (11.3.39), the spatial frequencies of the spatial matched filters that are orthogonal to the spatial
matched filter in the upper branch of the generalized sidelobe cacneler (GSC) with spatial frequency u s are
m
um = us +
M
for m = 1, 2, . . . , M − 1. For φ s = 0◦ the spatial frequency of its spatial matched filter is u s = 0. Therefore,
the spatial frequencies of the spatial matched filters for the blocking matrix B for a beamspace GSC are
m
um =
M
(c) In this part of the problem, we first compute the SINR loss for the full-rank GSC which is equivalent to the
optimum beamformer. This should serve as a check to make sure the the GSC has been implemented correctly.
Again, the SINR loss is found by computing a different GSC at each angle φ and computing the SINR loss of
that beamformer to the given interference scenario. Note that since the lower branch signal is
xB (n) = B H x (n)
and the upper branch signal is
y0 (n) = v H φ s x (n)
then the theoretical value of the lower branch correlation matrix is
RB = E xB (n) xBH (n) = B H Ri+n B
and the theoretical value of the cross-correlation vector between the lower branch and the upper branch is given
by
rB = E xB (n) y0∗ (n) = B H Ri+n v φ s
as are used in the accompanying Matlab code.
We see that the full-rank SINR loss matches the SINR loss of the optimum beamformer from Figure 11.2a for
part (a). The SINR loss of the partially adaptive GSC, however, also matches the SINR loss of the optimum
beamformer. That is, the same performance is achieved with 2 degrees of freedom as with the full-rank M = 20
array since only one interferer is present requiring only one degree of freedom to effectively cancel it.
426 Statistical and Adaptive Signal Processing - Solution Manual
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Part C
%
% - first compute the SINR loss for the full-rank GSC which is
% equivalent to the optimum beamformer
% - then compute the partially adaptive GSC only using 2 beams in
% the lower branch
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
for n = 1:length(phi)
% steering vector to current angle
u_s = spacing*sin(phi(n)*pi/180); % spatial frequency
v = exp(-j*2*pi*[0:(M-1)]’*u_s)/sqrt(M); % array response
% Compute the array output SINR for the partially adaptive GSC
SINR_pa = (abs(c_total_pa’*v)^2)/(c_total_pa’*R_in*c_total_pa);
% Plot out the SINR loss in decibels for the full-rank GSC
figure
plot(phi,10*log10(abs(L_sinr_full)),’b’,’linewidth’,2.5);
xlabel(’Angle (deg)’,’fontweight’,’bold’,’fontsize’,20);
ylabel(’SINR Loss (dB)’,’fontweight’,’bold’,’fontsize’,20);
set(gca,’fontweight’,’bold’,’fontsize’,18);
axis([-90 90 -45 2]);
set(gca,’xtick’,-90:30:90);
set(gca,’ytick’,-40:10:0);
grid
% Plot out the SINR loss in decibels for the partially adaptive GSC
figure
plot(phi,10*log10(abs(L_sinr_pa)),’b’,’linewidth’,2.5);
xlabel(’Angle (deg)’,’fontweight’,’bold’,’fontsize’,20);
ylabel(’SINR Loss (dB)’,’fontweight’,’bold’,’fontsize’,20);
set(gca,’fontweight’,’bold’,’fontsize’,18);
axis([-90 90 -45 2]);
set(gca,’xtick’,-90:30:90);
set(gca,’ytick’,-40:10:0);
grid
PROBLEM STATEMENT
Consider the case of a M = 20 element array with d = λ/2 inter-element spacing and thermal noise power
σ 2w = 1. Two interference sources are present at φ = 3◦ and φ = −5◦ both with powers of 50 dB. Generate
one realization of 1000 samples of this interferer. In addition a signal of interest is present at φ s = 0◦ with a
power of σ s = 100 (20 dB) in the n = 100th sample only.
428 Statistical and Adaptive Signal Processing - Solution Manual
0 0
−10 −10
SINR Loss (dB)
−30 −30
−40 −40
(a) SINR loss for full-rank GSC. (b) SINR loss for partially adaptive GSC.
Figure 11.21b: SINR loss for full-rank and partially adaptive GSC with 2 spatial matched filters in the lower
branch.
(a) Using an SMI adaptive beamformer for the full array compute the output signal. Is the signal of interest
visible?
(b) Using a partially adaptive beamformer with Q = 4 non-overlapping sub-arrays with M̃ = 5 elements,
compute the output of an SMI adaptive beamformer. What can you say about the signal of interest now?
(c) Repeat part (b) with Q = 2 and M̃ = 10. What are your observations now?
SOLUTION
This problem is a Matlab based problem. Below is the Matlab code and three output figures. The code is
broken up into parts (a), (b) and (c) and presented sequentially along with the accompanying figures.
(a) The signal is clearly visible at φ = 0◦ with a SNR = 20 dB. The M = 20 element array has sufficient
degrees of freedom to cancel the two interferers at φ = 3◦ and φ = −5◦ .
%
% Problem 11.22 -- new problem that is like 11.18 but with
% a more challenging interference scenario
%
clear
phi_i2 = -5;
% Compute the array response vectors for the signal of interest and
% the interference
v_s = exp(-j*2*pi*spacing*[0:(M-1)]’*sin(phi_s*pi/180))/sqrt(M);
v_i1 = exp(-j*2*pi*spacing*[0:(M-1)]’*sin(phi_i1*pi/180))/sqrt(M);
v_i2 = exp(-j*2*pi*spacing*[0:(M-1)]’*sin(phi_i2*pi/180))/sqrt(M);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Part A
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
20
0 100 200 300 400 500 600 700 800 900 1000
Sample
Figure 11.22a: Output signal for the full array SMI adaptive beamformer with M = 20 elements.
set(gca,’ytick’,0:10:40);
grid
(b) As in part (a), the signal is clearly visible at φ = 0◦ with a SNR = 20 dB. The Q = 4 subarrays or degrees
of freedom are sufficient to cancel the two interferers at φ = 3◦ and φ = −5◦ .
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Part B
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Q = 4; % number of non-overlapping subarrays
M_sub = 5; % number of elements per subarray
20
0 100 200 300 400 500 600 700 800 900 1000
Sample
Figure 11.22b: Output signal for the SMI partially adaptive beamformer with Q = 4 nonoverlapping subarrays
with M̃ = 5 elements.
c_opt_sub = c_opt_sub_unnorm/(c_opt_sub_unnorm’*v_s_sub);
(c) Unlike parts (a) and (b), the signal is no longer visible at φ = 0◦ . The Q = 2 subarrays or degrees of
freedom are not enough to cancel the two interferers at φ = 3◦ and φ = −5◦ . Note that one degree of freedom
is used by the constraint at φ = 0◦ of the optimum beamformer.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Part C
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Q = 2; % number of non-overlapping subarrays
M_sub = 10; % number of elements per subarray
20
0 100 200 300 400 500 600 700 800 900 1000
Sample
Figure 11.22c: Output signal for the SMI partially adaptive beamformer with Q = 2 nonoverlapping subarrays
with M̃ = 10 elements.
for q = 1:Q
index = (1:M_sub) + (q-1)*M_sub;
T_sub(index,q) = v_sub;
end
PROBLEM STATEMENT
Consider the case of a M = 40 element array with d = λ/2 inter-element spacing and thermal noise power
σ 2w = 1. Three interference sources are present at φ = −5◦ , −10◦ and 5◦ with powers of 50, 40 and 45 dB,
respectively . Generate one realization of 1000 samples of this interferer. In addition a signal of interest is
present at φ s = 0◦ with a power of σ s = 100 (20 dB) in the n = 100th sample only.
(a) Using an SMI adaptive beamformer for the full array compute the output signal. Is the signal of interest
visible?
(b) Using a beamspace partially adaptive beamformer 11 beams at the angles −5◦ ≤ φ ≤ 5◦ at 1◦ increments,
compute the output of an SMI adaptive beamformer. What can you say about the signal of interest now?
(c) Repeat part (b) with beams only at φ = −1◦ , 0circ , and 1circ . What are your observations now?
SOLUTION
This problem is a Matlab based problem. Below is the Matlab code and three output figures. The code is
broken up into parts (a), (b) and (c) and presented sequentially along with the accompanying figures.
(a) The signal is clearly visible at φ = 0◦ with a SNR = 20 dB. The M = 40 element array has sufficient
degrees of freedom to cancel the three interferers at φ = −5◦ , −10◦ , and 5◦ .
%
% Problem 11.23 -- new problem that is like 11.19 but with
% a more challenging interference scenario
%
clear
% Compute the array response vectors for the signal of interest and
% the interference
v_s = exp(-j*2*pi*spacing*[0:(M-1)]’*sin(phi_s*pi/180))/sqrt(M);
v_i1 = exp(-j*2*pi*spacing*[0:(M-1)]’*sin(phi_i1*pi/180))/sqrt(M);
v_i2 = exp(-j*2*pi*spacing*[0:(M-1)]’*sin(phi_i2*pi/180))/sqrt(M);
v_i3 = exp(-j*2*pi*spacing*[0:(M-1)]’*sin(phi_i3*pi/180))/sqrt(M);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Part A
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
(b) As in part (a), the signal is clearly visible at φ = 0◦ with a SNR = 20 dB. The 11 beams or degrees of
Statistical and Adaptive Signal Processing - Solution Manual 435
20
0 100 200 300 400 500 600 700 800 900 1000
Sample
Figure 11.23a: Output signal for the full array SMI adaptive beamformer with M = 40 elements.
freedom are sufficient to cancel the three interferers at φ = −5◦ , −10◦ , and 5◦ .
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Part B
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Angles of beam in beamspace
phi_bs = -5:5;
B = length(phi_bs);
20
0 100 200 300 400 500 600 700 800 900 1000
Sample
Figure 11.23b: Output signal for the SMI partially adaptive beamformer with 11 beams between −5◦ ≤ φ ≤ 5◦ at
1◦ increments.
(c) Unlike parts (a) and (b), the signal is no longer visible at φ = 0◦ . The 3 beams or degrees of freedom are
not enough to cancel the three interferers at φ = −5◦ , −10◦ , and 5◦ . Note that one degree of freedom is used
by the constraint at φ = 0◦ of the optimum beamformer.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Part C
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
clear T_bs
20
0 100 200 300 400 500 600 700 800 900 1000
Sample
Figure 11.23c: Output signal for the SMI partially adaptive beamformer with 3 beams at φ = −1◦ , 0◦ , and1◦ .
Further Topics
12.1 Prove (12.1.27), which relates the output and input fourth-order cumulants of a linear, time-invariant system.
We have
r y(4) (l1 , l2 , l3 ) = E y ∗ (n)y ∗ (n + l1 )y(n + l2 ) + y(n + l3 )
= E h ∗ (k0 )x ∗ (n − k0 ) h ∗ (k1 )x ∗ (n − k1 ) h(k2 )x(n − k2 ) h(k3 )x(n − k3 )
k0 k1 k2 k3
∗ ∗ ∗ ∗
= h (k0 )h (k1 )h(k2 )h(k3 )E x (n − k0 )x (n − k1 )x(n − k2 )x(n − k3 )
k0 k1 k2 k3
= h ∗ (k0 )h ∗ (k1 )h(k2 )h(k3 )r x(4) (l1 − k1 + k0 , l2 − K 2 + k0 , l3 − k3 + k0 )
k0 k1 k2 k3
using the linearity property of mathematical expectation and the definitions of higher order moments.
12.2 Derive (12.1.35) and (12.1.36), using the formulas for the cumulant of the sum of IID random variables,
developed in Section 3.2.4.
From (12.1.28) and (12.1.34), we have
∞
κ (4) (4)
x (l1 , l2 , l3 ) = γ w h(n)h(n + l1 )h(n + l2 )h(n + l3 )
n=0
or for l1 = l2 = l3 = 0
∞
κ (4)
x = γ (4)
w h 4 (n)
n=0
12.3 If x(n) is a stationary Gaussian process, show that E{x(n)x 2 (n − l)} = ρ 2x (l) and explain how it can be used
to investigate the presence of nonlinearities.
From (3.2.53) we obtain
E {x(n)x(n)x(n + l)x(n + l)} = E x 2 (n) E x 2 (n + l)
+E {x(n)x(n + l)}2 + E {x(n)x(n + l)}2
= r x2 (0) + 2r x2 (l)
We can check for non-Gaussianity or nonlinearities by exciting a system with a Gaussian input w(n), computing
the output x(n), and then computing and comparing the autocorrelation of x(n) with the autocorrelation of
x 2 (n).
12.4 In this problem we use an MA(2) model to explore some properties of cumulants and bispectra.
(a) Write a MATLAB function k=cuma(b) that computes the cumulant κ (3)
x (l1 , l2 ) of the MA(2) model
H (z) = b0 + b1 z −1 + b2 z −2 for −L ≤ l1 , l2 ≤ L .
438
Statistical and Adaptive Signal Processing - Solution Manual 439
(b) Use the functions k=cuma(b), X=fft(x), and X=shiftfft(X) to compute the bispectra of the three
MA(2) models in Table 12.1. Plot your results and compare with those in Figure 12.2.
(c) Compute the bispectra of the models using the formula
Rx(3) (e j ω1 , e j ω2 ) = κ (3)
w H (e
j ω1
)H (e j ω2 )H ∗ (e j (ω1 +ω2 ) )
for ω1 = ω2 = 2π k/N, 0 ≤ k ≤ N − 1. Compare with the results in part b and Figure 12.2.
(d) Show that the bispectrum can be computed in MATLAB using the following segment of code:
H=freqz(h,1,N,’whole’);
Hc=conj(H);
R3x=(H*H’).*hankel(Hc,Hc([N,1:N-1]));
R3x=shiftfft(R3x);
The Matlab script is given below and plots are shown in Figures 12.4a through 12.4d.
% Problem 12.04
clear
close all
j=sqrt(-1);
z1=0.8*exp(j*0.6*pi);
z2=0.8*exp(j*0.9*pi);
hmin=poly([z1 conj(z1) z2 conj(z2)]);
hmax=poly([1/z1 1/conj(z1) 1/z2 1/conj(z2)]);
a=0.5;b=0.9;
hmin=[1 -(a+b) a*b];
hmax=fliplr(hmin); %hmax=hmax/hmax(1);
[Hmin,om]=freqz(hmin,1,1000);
[Hmax,om]=freqz(hmax,1,1000);
f=om/(2*pi);
ylabel(’\angle H(e^{j\omega})’);
xlabel(’\omega/2\pi’);
title(’Maximum phase system’)
NFFT=128;
H=freqz(hmin,1,NFFT,’whole’);
Hc=conj(H);
for i=1:NFFT
for k=1:NFFT
ik=mod(i+k,NFFT);
if ik==0 ik=1; end
R3min(i,k)=H(i)*H(k)*Hc(ik);
end
end
R3min=fftshift(R3min);
H=freqz(hmax,1,NFFT,’whole’);
Hc=conj(H);
for i=1:NFFT
for k=1:NFFT
ik=mod(i+k,NFFT);
if ik==0 ik=1; end
R3max(i,k)=H(i)*H(k)*Hc(ik);
end
end
R3max=fftshift(R3max);
exportfig(gcf,’p1204a.eps’,’fontmode’,’scaled’,...
’linemode’,’scaled’,’color’,’cmyk’);
figure
om = [-NFFT/2:NFFT/2-1]’/NFFT;
subplot(2,2,1),contour(om,om,abs(R3min))
title(’Bispectrum magnitude: Min phase’)
xlabel(’f_1’);
ylabel(’f_2’);
subplot(2,2,3),contour(om,om,angle(R3min))
title(’Bispectrum phase: Min phase’)
xlabel(’f_1’);
ylabel(’f_2’);
subplot(2,2,2),contour(om,om,abs(R3max))
title(’Bispectrum magnitude: Max phase’)
xlabel(’f_1’);
ylabel(’f_2’);
subplot(2,2,4),contour(om,om,angle(R3max))
Statistical and Adaptive Signal Processing - Solution Manual 441
exportfig(gcf,’p1204b.eps’,’fontmode’,’scaled’,...
’linemode’,’scaled’,’color’,’cmyk’);
figure
[R3min,om]=bispectrum(hmin,NFFT);
[R3max,om]=bispectrum(hmax,NFFT);
exportfig(gcf,’p1204c.eps’,’fontmode’,’scaled’,...
’linemode’,’scaled’,’color’,’cmyk’);
figure
subplot(2,2,1),contour(om,om,abs(R3min))
title(’Bispectrum magnitude: Min phase’)
xlabel(’f_1’);
ylabel(’f_2’);
subplot(2,2,3),contour(om,om,angle(R3min))
title(’Bispectrum phase: Min phase’)
xlabel(’f_1’);
ylabel(’f_2’);
subplot(2,2,2),contour(om,om,abs(R3max))
title(’Bispectrum magnitude: Max phase’)
xlabel(’f_1’);
ylabel(’f_2’);
subplot(2,2,4),contour(om,om,angle(R3max))
title(’Bispectrum phase: Max phase’)
xlabel(’f_1’);
ylabel(’f_2’);
exportfig(gcf,’p1204d.eps’,’fontmode’,’scaled’,...
’linemode’,’scaled’,’color’,’cmyk’);
12.5 Using the minimum-, maximum-, and mixed-phase systems discussed in Example 12.1.1, write a MATLAB
program to reproduce the results shown in Figures 12.3 and 12.4. Use a = 0.4, b = 0.8, and N = 300
samples.
442 Statistical and Adaptive Signal Processing - Solution Manual
2.5 2.5
2 2
|H(e )|
|H(ejω)|
jω
1.5 1.5
1 1
0.5 0.5
∠ H(e )
1
jω
jω
0
0.5
−2
0
0 0.1 0.2 0.3 0.4 0 0.1 0.2 0.3 0.4
ω/2π ω/2π
Figure 12.4a: Plots of system responses in 12.4a
0.4 0.4
0.2 0.2
0 0
f2
f2
−0.2 −0.2
−0.4 −0.4
−0.4 −0.2 0 0.2 0.4 −0.4 −0.2 0 0.2 0.4
f1 f1
Bispectrum phase: Min phase Bispectrum phase: Max phase
0.4 0.4
0.2 0.2
0 0
f2
f2
−0.2 −0.2
−0.4 −0.4
−0.4 −0.2 0 0.2 0.4 −0.4 −0.2 0 0.2 0.4
f1 f1
0.4
0.3
0.2
0.1
0
2
f
−0.1
−0.2
−0.3
−0.4
−0.5
−0.5 −0.4 −0.3 −0.2 −0.1 0 0.1 0.2 0.3 0.4
f1
0.4 0.4
0.2 0.2
0 0
f2
f2
−0.2 −0.2
−0.4 −0.4
−0.4 −0.2 0 0.2 0.4 −0.4 −0.2 0 0.2 0.4
f1 f1
Bispectrum phase: Min phase Bispectrum phase: Max phase
0.4 0.4
0.2 0.2
0 0
f2
f2
−0.2 −0.2
−0.4 −0.4
−0.4 −0.2 0 0.2 0.4 −0.4 −0.2 0 0.2 0.4
f1 f1
The Matlab script is given below and plots are shown in Figures 12.5a and 12.5b.
close all
a=0.4; b=0.8;
N=300;
w=randn(N,1);title(’Gaussian’);
x=filter(1,hmin,w);
wmin=filter(hmin,1,x);
wmax=filter(hmax,1,x);
wmix=filter(hmix,1,x);
subplot(5,1,1),plot(w); ylabel(’w(n)’);title(’Gaussian’);
subplot(5,1,2),plot(x); ylabel(’x(n)’);
subplot(5,1,3),plot(wmin); ylabel(’w_{min}(n)’);
subplot(5,1,4),plot(wmax); ylabel(’w_{max}(n)’);
subplot(5,1,5),plot(wmix); ylabel(’w_{mix}(n)’);
xlabel(’Sample index (n)’);
exportfig(gcf,’p1205a.eps’,’fontmode’,’scaled’,...
’linemode’,’scaled’,’color’,’cmyk’);
figure
w=-log(rand(N,1));
x=filter(1,hmin,w);
wmin=filter(hmin,1,x);
wmax=filter(hmax,1,x);
wmix=filter(hmix,1,x);
subplot(5,1,1),plot(w); ylabel(’w(n)’);title(’Non-Gaussian’);
subplot(5,1,2),plot(x); ylabel(’x(n)’);
subplot(5,1,3),plot(wmin); ylabel(’w_{min}(n)’);
subplot(5,1,4),plot(wmax); ylabel(’w_{max}(n)’);
subplot(5,1,5),plot(wmix); ylabel(’w_{mix}(n)’);
xlabel(’Sample index (n)’);
exportfig(gcf,’p1205b.eps’,’fontmode’,’scaled’,...
’linemode’,’scaled’,’color’,’cmyk’);
12.6 Use the Levinson-Durbin algorithm, developed in Chapter 7, to derive expressions (12.5.20), direct-form
coefficients, and (12.5.21) for the lattice parameters of the fractional pole model.
We first determine the partial correlation coefficients for m = 1 and m = 2. Then we go from order m − 1 to
order m using induction.
Statistical and Adaptive Signal Processing - Solution Manual 445
Gaussian
5
w(n)
0
−5
0 50 100 150 200 250 300
x(n) 10
−10
0 50 100 150 200 250 300
5
(n)
min
0
w
−5
0 50 100 150 200 250 300
5
(n)
max
0
w
−5
0 50 100 150 200 250 300
5
(n)
mix
0
w
−5
0 50 100 150 200 250 300
Sample index (n)
Figure 12.5a: Signal plots in 12.5a
Non−Gaussian
5
w(n)
0
0 50 100 150 200 250 300
20
x(n)
10
0
0 50 100 150 200 250 300
5
wmin(n)
0
0 50 100 150 200 250 300
5
wmax(n)
−5
0 50 100 150 200 250 300
5
wmix(n)
−5
0 50 100 150 200 250 300
Sample index (n)
Figure 12.5b: Signal plots in 12.5b
446 Statistical and Adaptive Signal Processing - Solution Manual
For m = 1 we have
d
k1 = a1(1) = −ρ(1) = −
1−d
For m = 2 we use the Levinson-Durbin recursion. Indeed, we have
and
−2d
a1(2) = a1(1) + k2 a1(1) =
2−d
which is identical to (12.5.20) for m = 2 and k = 1.
Let us assume now that formula (12.5.20) is true for m − 1. Using the Levinson-Durbin recursion, we have
a (m)
j = a (m−1)
j
(m−1)
+ km am− j
m − 1 ( j − d − 1)!(m − 1 − d − j )!
a (m−1) =
j
j (−d − 1)!(m − 1 − d)!
m ( j − d − 1)!(m − d − j )!(m − j )(m − d)
=
j (−d − 1)!(m − d)!m(m − d − j )
But
m ( j − d − 1)!(m − d − j )!(−d) j
a (m) (m−1)
j am− j =
j (−d − 1)!(m − d)!m(m − d − j )
Using the previous relations we can show that
m ( j − d − 1)!(m − d − j )!
a (m−1) + k a (m−1)
m m− j = = a (m)
j
j (−d − 1)!(m − d)! j
where − 12 < d < 12 and −1 < a < 1. Compute and plot the impulse response, autocorrelation, and spectrum
for a = ±0.9 and d = ±0.2, ±0.4. Identify which models have long memory and which have short memory.
The Matlab script is given below and plots are shown in Figures 12.7a and 12.7b.
% Problem 12.7
close all;
clear;
ap=0.9; am=-0.9;
d=[-0.2 -0.4 0.2.0.4];
Statistical and Adaptive Signal Processing - Solution Manual 447
PSD1=zeros(1000,4);
PSD2=PSD1;
f=(1:1000)’/2000;
om=2*pi*f;
for i=1:length(d)
PSDfp=(2*sin(om/2)).^(-2*d(i));
PSDar1=(abs(1+ap*exp(j*om))).^2;
PSD1(:,i)=PSDfp./PSDar1;
end
for i=1:length(d)
PSDfp=(2*sin(om/2)).^(-2*d(i));
PSDar1=(abs(1+am*exp(j*om))).^2;
PSD2(:,i)=PSDfp./PSDar1;
end
loglog(f,PSD1);
xlabel(’f’);
ylabel(’PSD’)
title(’a=0.9’);
exportfig(gcf,’p1207a.eps’,’fontmode’,’scaled’,...
’linemode’,’scaled’,’color’,’cmyk’);
figure
loglog(f,PSD2);
xlabel(’f’);
ylabel(’PSD’)
title(’a=-0.9’);
exportfig(gcf,’p1207b.eps’,’fontmode’,’scaled’,...
’linemode’,’scaled’,’color’,’cmyk’);
12.8 Compute and plot the PSD of the FGN process, using the following approaches, and compare the results.
!∞
(a) The definition Rx (e j ω ) = l=−∞ r x (l)e
− j ωl
and formula (12.6.36) for the autocorrelation.
(b) The theoretical formula (12.6.37).
The Matlab script is given below and plots are shown in Figures 12.8a and 12.8b.
close all
clear
448 Statistical and Adaptive Signal Processing - Solution Manual
a=0.9
3
10
2
10
1
10
PSD
0
10
−1
10
−2
10
−3
10 −4 −3 −2 −1 0
10 10 10 10 10
f
Figure 12.7a: PSD plot in 12.7a
a=−0.9
4
10
3
10
2
10
PSD
1
10
0
10
−1
10 −4 −3 −2 −1 0
10 10 10 10 10
f
Figure 12.7b: PSD plot in 12.7b
Statistical and Adaptive Signal Processing - Solution Manual 449
H=0.3;
f=(0:0.001:0.5)’;
om=2*pi*f;
K=50;
H1=(0.1:0.1:0.9)’;
for i=1:length(H1)
H=H1(i);
al=zeros(size(om));
for k=-K:1:K
al=al+1./(abs(om+2*k*pi).^(2*H+1));
end
Rx(:,i)=(abs(1-exp(-j*om))).^2;
Rx1(:,i)=Rx(:,i).*al;
end
loglog(f,Rx1); grid;
%xlabel(’f’);
%ylabel(’R_x(e^{j2\pif})’)
xlabel(’NORMALIZED FREQUENCY (F/Fs)’)
ylabel(’POWER SPECTRUM’)
exportfig(gcf,’p1208a.eps’,’fontmode’,’scaled’,...
’linemode’,’scaled’,’color’,’cmyk’);
figure
L=20;
l=(0:L)’;
H1=(0.1:0.1:0.9)’;
for i=1:length(H1)
H=H1(i);
rx(:,i)=(abs(l-1).^(2*H)-2*abs(l).^(2*H)+abs(l+1).^(2*H))/2;
end
plot(l,rx’,’.-’); grid
%xlabel(’\fontname{times}\itl’);
%ylabel(’\fontname{times}r_x(\itl)’);
xlabel(’LAG’)
ylabel(’AUTOCORRELATION’)
exportfig(gcf,’p1208b.eps’,’fontmode’,’scaled’,...
’linemode’,’scaled’,’color’,’cmyk’);
12.9 Use the algorithm of Schür to develop a more efficient implementation of the fractional pole noise generation
method described by Equations (12.5.24) to (12.5.28).
To be completed.
12.10 In this problem we study the properties of the harmonic fractional unit-pole model specified by the system
450 Statistical and Adaptive Signal Processing - Solution Manual
2
10
1
10
POWER SPECTRUM
0
10
−1
10
−2
10 −3 −2 −1 0
10 10 10 10
NORMALIZED FREQUENCY (F/Fs)
Figure 12.8a: Power spectrum plot in 12.8a
1
AUTOCORRELATION
0.5
−0.5
0 5 10 15 20
LAG
Figure 12.8b: Autocorrelation plot in 12.8b
Statistical and Adaptive Signal Processing - Solution Manual 451
(a) Compute and plot h θ,d (n) for various values of θ and d.
(b) Demonstrate the validity of the above formula by evaluating h θ,d (n) from Hθ,d (z) for the same values of
θ and d.
(c) Illustrate that the model is minimum-phase if | cos θ| < 1 and − 12 < d < 1
2
or cos θ = ±1 and
− 14 < d < 14 .
(d) Illustrate that the harmonic minimum-phase model, like the FPZ(0, d, 0) one, exhibits long-memory
behavior only for positive values of d.
(e) Show that for 0 < d < 14 and cos θ = 1, the autocorrelation equals that of the FPZ(0, 2d, 0) model
[multiplied by (−1)l if cos θ = −1]. When | cos θ| < 1 and 0 < d < 12 , illustrate numerically that the
autocorrelation can be approximated by ρ(l) ∼ −l 2d−1 sin(θl − πd) as l → ∞.
(f) Compute and plot the spectrum of the model for θ = π /3 and various values of d.
(g) Generate and plot realizations of Gaussian HFPZ noise for θ = π /6 and d = −0.3, 0.1, and 0.4.
To be completed.
12.11 Determine the variogram of the process x(n) obtained by exciting the system
1
H (z) = |a| < 1
(1 − z −1 )(1 − az −1 )
Unfortunately, the system H (z) has a pole on the unit circle. Hence, the output process is nonstationary. To
determine the variagram we note that x(n) can be obtained by integrating an AR(1) process
Therefore
and
1 1
vx (l) = E{[x(n + l) − x(n)]2 } = E{[s(n + 1) + . . . + s(n + l)]2 }
2 2
The autocorrelation of s(n) is
Hence
1 1
vx (1) = E{[s(n + 1)]2 } = σ 2
2 2
1 1 2
1
vx (2) = E{[s(n + 1) + s(n + 2)]2 } = σ + 2σ 2 a + σ 2 = σ 2 (2 + 2a)
2 2 2
1 1
vx (3) = E{[s(n + 1) + s(n + 2) + s(n + 3)]2 } = σ 2 3 + 4a + 2a 2
2 2
1 2
vx (3) = σ 4 + 6a + 4a 2 + a 3
2
or in general
1 2
l−1
vx (l) = σ l + 2 (l − k)a k
2 k=1
12.12 Following the steps leading to (12.6.26), show that the fractal (Haussdorff) dimension D is related to the Hurst
exponent H by
D =2− H
Consider an arbitrary trace of a fractional Brownian motion with Hurst exponent H . Let us assume that this
trace is enclosed by a box of length (time-axis) A and height (amplitude-axis) B. We will use the method of
box counting. If we extract a piece of this trace of length r A where 0 ≤ r ≤ 1 then to preserve self-similarity
of the process, the scaled subbox needed to enclose the piece will have height r H B. On the other hand, if we
did not have this self-similarity property, then the height of the unscaled subbox would be r B. Hence the total
number of such unscaled subboxes that we can fit in one scaled subbox is equal to
area of scaled subbob (r A) r H B 1
= = 1−H
area of unscaled subbox (r A) (r B) r
However the total number of subtraces (of length r A) are 1/r. Hence the total number of unscaled boxes (that
is, the identical units carved out of the original one) are
1 1 1 1
N = 1−H
= 2−H = D
r r r r
Hence
D =2− H
12.13 Develop a Matlab function to generate the ordinary Brownian motion trace according to the steps given for
the cumulative sum method in Section 12.6.3. The format of the function should be x = obm_cumsum(N).
The Matlab function x = obm_cumsum(N) is given below.
Statistical and Adaptive Signal Processing - Solution Manual 453
200
150
x(t)
100
50
0
0 0.25 0.5 0.75 1
function x = obm_cumsum(N)
% Function to generate N samples of an ordinary Brownian motion trace x
% using the cumulative sum method
% x = obm_cumsum(N)
x = randn(N,1); x = cumsum(x);
Hf_1 = figure(’Units’,SCRUN,’position’,SCRPOS,’color’,[0,0,0],...
’Paperunits’,PAPUN,’PaperPosition’,[0,0,4.9,1.5]);
set(Hf_1,’NumberTitle’,’off’,’Name’,’P1213a’);
plot(n,x,’g’); axis([0,1,min(x),max(x)]);
xlabel(’Time \itt’,’fontsize’,label_fontsize);
ylabel(’\it{x}(\it{t})’,’fontsize’,label_fontsize);
title(’Sample function of an ordinary Brownian motion’,’fontsize’,title_fontsize);
set(gca,’xtick’,[0:0.25:1],’ytick’,[floor(min(x)/50)*50:50:ceil(max(x)/50)*50]);
(b) Investigate the self-affine property of x(t) by reproducing a figure similar to Figure 12.23.
The Matlab script is given below and the plots are shown in Figure 12.13b.
% (b) Self-affine property
Hf_2 = figure(’Units’,SCRUN,’position’,SCRPOS,’color’,[0,0,0],...
’Paperunits’,PAPUN,’PaperPosition’,[0,0,4.9,4.5]);
set(Hf_2,’NumberTitle’,’off’,’Name’,’P1213b’);
200
150
x(t)
100
50
0
0 0.375 0.5 0.625 1
Time t
225
200
175
150
200
190
180
% Zoom-1
subplot(3,1,2); plot(n(6145:1:10240),x(6145:1:10240),’g’); hold on;
axis([0.375,0.625,min(x(6145:1:10240)),max(x(6145:1:10240))]);
plot([15/32,15/32],[min(x(6145:1:10240)),max(x(6145:1:10240))],’w:’,...
[17/32,17/32],[min(x(6145:1:10240)),max(x(6145:1:10240))],’w:’);
set(gca,’xtick’,[3/8,15/32,1/2,17/32,5/8],’fontsize’,8);
set(gca,’ytick’,[floor(min(x(6145:1:10240))/25)*25:25:...
ceil(max(x(6145:1:10240))/25)*25]); hold off;
hold off;
% Zoom-2
subplot(3,1,3); plot(n(7681:1:8704),x(7681:1:8704),’g’);
axis([15/32,17/32,min(x(7681:1:8704)),max(x(7681:1:8704))]);
set(gca,’xtick’,[15/32,1/2,17/32],’fontsize’,8);
set(gca,’ytick’,[floor(min(x(7681:1:8704))/10)*10:10:...
ceil(max(x(7681:1:8704))/10)*10]); hold off;
12.14 Develop a Matlab function to generate the fractional Brownian motion trace according to the steps given for the
spectral synthesis method in Section 12.6.3. The format of the function should be x = fbm_spectral(H,N).
The Matlab function x = fbm_spectral(H,N) is given below.
Statistical and Adaptive Signal Processing - Solution Manual 455
function x = fbm_spectral(H,N);
% Function to generate N samples of a fraction Brownian motion trace x
% of self-similarity index H using the Spectral Synthesis method
% x = fbm_spectral(H,N)
N1 = N; N = 2^nextpow2(2*N1);
beta = 2*H+1;
x = randn(N,1);
X = fft(x,2*N);
phase = (rand(N+1,1)-0.5)*pi;
k = (1:N)’;
X_H = 10*(k.^(-beta/2)).*abs(X(2:N+1));
X_H = [0; X_H; flipud(X_H(1:N-1))];
phase = [phase;-flipud(phase(2:N))];
X_H = X_H.*exp(j*phase);
x_H = ifft(X_H); N = length(x_H);
x_H = real(x_H(N/2-N1/2+1:N/2+N1/2));
x = x_H;
(a) Generate 1024 samples of the FBM B H (t) over 0 ≤ t ≤ 1 for H = 0.3. Investigate the self-affine
property of B0.3 (t).
The Matlab script is given below and the plots are shown in Figure 12.14a.
close all; clc;
set(0,’defaultaxesfontsize’,default_fontsize);
% Zoom-1
I1 = (3/8)*N+1; I2 = (5/8)*N+1;
subplot(2,1,2); plot(n(I1:1:I2),x(I1:1:I2),’g’); hold on;
axis([0.375,0.625,min(x(I1:1:I2)),max(x(I1:1:I2))]);
456 Statistical and Adaptive Signal Processing - Solution Manual
0.3
0.2
0.1
x(t)
0
−0.1
−0.2
−0.3
0.2
0.16
0.12
x(t)
0.08
0.04
−0.04
xlabel(’Time \itt’,’fontsize’,label_fontsize);
ylabel(’\it{x}(\it{t})’,’fontsize’,label_fontsize);
set(gca,’xtick’,[3/8,1/2,5/8],’fontsize’,8); vr = 0.04;
set(gca,’ytick’,[floor(min(x(I1:1:I2))/vr)*vr:vr:...
ceil(max(x(I1:1:I2))/vr)*vr]); hold off;
(b) Generate 1024 samples of the FBM B H (t) over 0 ≤ t ≤ 1 for H = 0.7. Investigate the self-affine
property of B0.7 (t).
The Matlab script is given below and the plots are shown in Figure 12.14b.
% (b) Generate 1024 samples for H = 0.7
N = 1024; n = [0:N-1]/N;
H = 0.7; x = fbm_spectral(H,N);
−0.05
x(t)
−0.1
−0.15
−0.2
0 0.375 0.5 0.625 1
Time t
−0.04
x(t)
−0.08
−0.12
set(gca,’xtick’,[0,0.375,0.5,0.625,1]); vr = 0.05;
set(gca,’ytick’,[floor(min(x)/vr)*vr:vr:ceil(max(x)/vr)*vr]); hold off;
% Zoom-1
I1 = (3/8)*N+1; I2 = (5/8)*N+1;
subplot(2,1,2); plot(n(I1:1:I2),x(I1:1:I2),’g’); hold on;
axis([0.375,0.625,min(x(I1:1:I2)),max(x(I1:1:I2))]);
xlabel(’Time \itt’,’fontsize’,label_fontsize);
ylabel(’\it{x}(\it{t})’,’fontsize’,label_fontsize);
set(gca,’xtick’,[3/8,1/2,5/8],’fontsize’,8); vr = 0.04;
set(gca,’ytick’,[floor(min(x(I1:1:I2))/vr)*vr:vr:...
ceil(max(x(I1:1:I2))/vr)*vr]); hold off;
12.15 Develop a Matlab function to generate the fractional Brownian motion trace according to the steps given
for the random midpoint replacement method in Section 12.6.3. The format of the function should be x =
fbm_replace(N).
The Matlab function x = fbm_replace(H,N) is given below.
function x = fbm_replace(H,N)
% This function generates a fractional Brownian motion with a given
% self-similarity index H, using the mipoint displacement method.
% The function receives as inputs, the self-similarity index H,
% and the number of points N to be generated.
%
458 Statistical and Adaptive Signal Processing - Solution Manual
f = f - ((1:M)-1)/M;
x = f(1:N);
(a) Generate 1024 samples of the FBM B H (t) over 0 ≤ t ≤ 1 for H = 0.5. Compare visually B0.5 (t) with
that obtained by using the cumulative-sum method. Comment on your observations.
The Matlab script is given below and the plots are shown in Figure 12.15a. Visually the plots appear to
be similar.
close all; clc;
set(0,’defaultaxesfontsize’,default_fontsize);
% (a) Generate 1024 samples for H = 0.5 and compare with the cumsum method
N = 1024; n = [0:N-1]/N;
H = 0.5; x1 = fbm_replace(H,N); x2 = obm_cumsum(N);
Hf_1 = figure(’Units’,SCRUN,’position’,SCRPOS,’color’,[0,0,0],...
’Paperunits’,PAPUN,’PaperPosition’,[0,0,4.9,4.5]);
set(Hf_1,’NumberTitle’,’off’,’Name’,’P1215a’);
−0.5
−1
x(t)
−1.5
−2
20
10
x(t)
−10
−20
−30
set(gca,’xtick’,[0,0.375,0.5,0.625,1]); vr = 0.1;
% Zoom-1
subplot(2,1,2); plot(n,x2,’g’); axis([0,1,min(x2),max(x2)]);
xlabel(’Time \itt’,’fontsize’,label_fontsize);
ylabel(’\it{x}(\it{t})’,’fontsize’,label_fontsize);
title(’Sample function of an ordinary Brownian motion: CumSum’,...
’fontsize’,title_fontsize);
set(gca,’xtick’,[0,0.375,0.5,0.625,1]); vr = 0.1;
(b) Generate 1024 samples of the FBM B H (t) over 0 ≤ t ≤ 1 for H = 0.99. Investigate the artifact discussed
in the chapter for H → 1.
The Matlab script is given below and the plots are shown in Figure 12.15b. Visually, the trace has self
repeating (but increasing) structures. Thus the statistical properties will be different at different times
and at different scales.
% (b) Generate 1024 samples for H = 0.99
N = 1024; n = [0:N-1]/N;
H = 0.99; x = fbm_replace(H,N);
0.015
0.01
0.005
x(t) 0
−0.005
−0.01
plot(n,x,’g’); axis([0,1,min(x),max(x)]);
xlabel(’Time \itt’,’fontsize’,label_fontsize);
ylabel(’\it{x}(\it{t})’,’fontsize’,label_fontsize);
title(’Sample function of an ordinary Brownian motion: H = 0.99’,...
’fontsize’,title_fontsize);
set(gca,’xtick’,[0,0.375,0.5,0.625,1]);
12.16 Based on Equation (12.6.54), develop a Matlab function [H,sigmaH] = est_H_mad(x) that computes an
estimate of the self-similarity index H and the variance σ 2H of an FBM process.
The Matlab function [H,sigmaH] = est_H_mad(x) is given below.
N = length(x);
maxscale = min(round(0.1*N),100);
% Find the expected values of the absolute value of f(x + delta) - f(x)
% for delta = 1 to maximum scale.
% Create the self-similarity plot, with the initial estimate of the fit
c_init = polyfit(log(scale),log(expdif),1);
fit_init = polyval(c_init,log(scale));
Statistical and Adaptive Signal Processing - Solution Manual 461
loglog(scale,expdif,’.’,scale,exp(fit_init));
d_est = 2 - c_init(1);
sigma = - c_init(2);
H = 2-d_est;
title([’Estimated H = ’,num2str(H)]);
xlabel(’Scale \Delta’);
ylabel(’E\{|x(n+\Delta) - x(n)|\}’);
grid;
(a) Use function x = fbm_replace(N) to generate N = 1024 samples of an FBM process with H = 0.3,
and use the function [H,sigmaH] = est_H_mad(x) to estimate H and σ H .
The Matlab script is given below and the plots are shown in Figure 12.16a.
close all; clc;
set(0,’defaultaxesfontsize’,10);
% (a) Generate 1024 samples for H = 0.3 using the replacement method
% and estimate H and the process initial variance
Hf_1 = figure(’Units’,SCRUN,’position’,SCRPOS,’color’,[0,0,0],...
’Paperunits’,PAPUN,’PaperPosition’,[0,0,4.9,4.5]);
set(Hf_1,’NumberTitle’,’off’,’Name’,’P1216a’);
N = 1024; n = [0:N-1]/N;
H = 0.3; x = fbm_replace(H,N);
[H,sigma] = est_H_mad(x)
H =
0.26705987484094
sigma =
2.35161153837552
N = 1024; n = [0:N-1]/N;
H = 0.7; x = fbm_replace(H,N);
[H,sigma] = est_H_mad(x)
H =
0.64831632433527
sigma =
5.63245919105432
(c) Perform a Monte Carlo simulation using 100 trials and compute the mean and standard deviation of the
estimates for H and σ H in (a) and (b). To be completed.
462 Statistical and Adaptive Signal Processing - Solution Manual
Estimated H = 0.26706
0
10
E{|x(n+∆) − x(n)|}
−1
10
−2
10
0 1 2
10 10 10
Scale ∆
Figure 12.16a: The log-log plot for the estimation of H given a trace using H = 0.3
Estimated H = 0.64832
−1
10
E{|x(n+∆) − x(n)|}
−2
10
−3
10
0 1 2
10 10 10
Scale ∆
Figure 12.16b: The log-log plot for the estimation of H given a trace using H = 0.7
Statistical and Adaptive Signal Processing - Solution Manual 463
12.17 Repeat Problem 12.16 by developing a function that estimates the self-similarity index H by determining the
slope of the first 10 percent values of the periodogram in a log-log plot.
The Matlab function [H,sigmaH] = est_H_psd(x) is given below.
M = nextpow2(length(x)*4);
NFFT = 2^M;
[R,F] = psd(x,NFFT,1.0,’none’);
l2f = log2(F(2:end));
l2R = log2(R(2:end));
s = [2:NFFT*0.05];
cr1 = polyfit(l2f(s),l2R(s),1);
crf1 = polyval(cr1,l2f(s));
beta1 = cr1(1);
H = (-beta1-1)/2;
% (a) Generate 1024 samples for H = 0.3 using the replacement method
% and estimate H
N = 1024; n = [0:N-1]/N;
H = 0.3; x = fbm_replace(H,N);
[H] = est_H_psd(x)
H =
0.30246903766353
% (b) Generate 1024 samples for H = 0.7 using the replacement method
% and estimate H
N = 1024; n = [0:N-1]/N;
H = 0.7; x = fbm_replace(H,N);
[H] = est_H_psd(x)
H =
0.61908068053019