Docsity

Optimal and Adaptive Filtering: Assignment 1 for EEC263 at University of California, Davis, Exams of Electrical and Electronics Engineering

Toggle sidebar
bg1
EEC263
UNIVERSITY OF CALIFORNIA, DAVIS
Department of Electrical and Computer Engineering
Optimal and Adaptive Filtering
MATLAB Assigment #1 -due Wednesday, April 23,2008
Spring 2008
Carry out the following MATLAB problems. Hand in the various hard copies you have
generated. Please arrange them in order and annotate them to make it easy for the reader
to understand your work.
1. Estimation of Sinusoids in Noise
One approach for estimating the frequency of a sinusoid in noise is to use a constrained
lattice filter. Specifically, consider the sinusoidal signal
X(t) =Acos(21Tfot +<1» (1)
where Ais constant, and <1>is a random phase uniformly distributed over [0,21T). We observe
Y(t) =X(t) +V(t) , (2)
where V(t) is a zero-mean WGN independent of <1>,with variance r. Our goal is to estimate
the frequency fo of the sinusoid X(t) from the observations {Y(t) ;0:S t:S T} where T
denotes the length of the observation interval. Consider the constrained second-order lattice
filter shown in the figure below, where the second reflection coefficient has been set equal
to one.
a) Find the location of the zeros of the lattice filter A2(z) as a function of T
b) Assume that the sinusoid amplitude Aand noise variance rare known, and let E(t; 2)
be the estimation residual obtained at the output of the lattice filter. Select the
reflection coefficient 'Y to minimize the mean-square error E[E2(t; 2)], and evaluate
the corresponding mean-square error MSE. Indicate how 'Y can be used to estimate
fo, and explain the effect of the signal to noise ratio A2/2r on the estimate fo and on
the MSE.
pf3
pf4

Partial preview of the text

Download Optimal and Adaptive Filtering: Assignment 1 for EEC263 at University of California, Davis and more Exams Electrical and Electronics Engineering in PDF only on Docsity!

EEC

UNIVERSITY OF CALIFORNIA, DAVIS

Department of Electrical and Computer Engineering

Optimal and Adaptive Filtering

MATLAB Assigment #1 -due Wednesday, April 23,

Spring 2008

Carry out the following MATLAB problems. Hand in the various hard copies you have generated. Please arrange them in order and annotate them to make it easy for the reader to understand your work.

1. Estimation of Sinusoids in Noise

One approach for estimating the frequency of a sinusoid in noise is to use a constrained lattice filter. Specifically, consider the sinusoidal signal

X(t) = Acos(21Tfot + <1» (1)

where A is constant, and <1>is a random phase uniformly distributed over [0, 21T). We observe

Y(t) = X(t) + V(t) , (2)

where V(t) is a zero-mean WGN independent of <1>,with variance r. Our goal is to estimate

the frequency fo of the sinusoid X(t) from the observations {Y(t) ; 0 :S t :S T} where T

denotes the length of the observation interval. Consider the constrained second-order lattice filter shown in the figure below, where the second reflection coefficient has been set equal to one.

a) Find the location of the zeros of the lattice filter A2(z) as a function of T

b) Assume that the sinusoid amplitude A and noise variance r are known, and let E(t; 2) be the estimation residual obtained at the output of the lattice filter. Select the reflection coefficient 'Y to minimize the mean-square error E[E2(t; 2)], and evaluate the corresponding mean-square error MSE. Indicate how 'Y can be used to estimate fo, and explain the effect of the signal to noise ratio A2/2r on the estimate fo and on the MSE.

c) Unfortunately in most situations, A and r are not known a priori, so that the statistics of Y (t) cannot be evaluated. In such cases, instead of selecting 'Y so as to minimize the mean-square error E[ E2 (t; 2)], we can employ a deterministic least-squares approach, where 'Y minimizes the time-averaged squared residuals

1 T

J = T-1 LE2(t;2).t=

Find the value 'Y which minimizes J. The expression you obtain should depend only

on the observations Y(-). Explain how 'Y can be used to estimate fo.

d) To test the frequency estimation procedure developed in c), write a MATLAB function

[X,Y] = noisin(A,fO,phi,r,T)

which generates the sinusoidal waveform X (t) and noisy observations Y (t) for a ::; t ::; T. The function outputs are two row vectors X and Y of length T + 1, where the t + 1-th elements of X and Yare X(t) and Y(t), respectively. Write also a function

[gamma,E,l] =conlat(Y,T)

which evaluates the reflection coefficient 'Y, as well as the residual vector E and J from

the observations Y. Note that because E( t; 2) is only defined for 2 ::; t ::; T, the vector

E has only length T - 1. Its t - lth entry is E(t; 2). Write a plotting function which generates: (i) a plot showing both X(t) and Y(t) for a ::; t ::; T; (ii) a plot of E(t)

for 2 ::; t ::; T, plotted together with the error norm J1/2. Put both of these plots on

the same page by using the subplot MATLAB command. Print the M-files of noisin, conlat, and of your plotting function.

e) in this part, we use the functions developed in part d) to test the effect of the data length record T, signal to noise ratio A2/2r, and frequency fo on the performance of the frequency estimation technique of part c). For all experiments, we select <P = a and r = 1.

(i) Set A = 10 and fo = 0.25. Generate observation records with T = 10,20,50 and

100, and evaluate the corresponding 'Y, J and 10.

(ii) Set fo = 0.05 and T = 100. Generate observation records wit? A = 1, A = 4, A = 10 and A = 20, and evaluate the corresponding 'Y, J and fo. (iii) Set A = 10 and T = 100. Generate observation records with fo = 0.01, 0.05, 0.1, 0.25 and 0.5, and evaluate the corresponding 'Y, J and 10.

What conclusions can you draw from (i)-(iii)?

2. FIR and Causal Wiener Filters

Let X(t) be an AR(l) WSS process with autocorrelation

Rx(k) = a1kl ,

c) Use the values of al, a2 and q given in part a) and the formulas derived in problem 4

of Problem Set 2 to evaluate the exact cross- and auto- correlations ofYdt) and Y2(t). Then employ the MATLAB program of part b) to design and implement optimum noise cancellation filters of order M = 2,4 and 6 for the data generated in a). Let

denote respectively the noise estimate and the error of the noise-cancellation filter. For M = 2,4 and 6, evaluate the mean-square error PM = E[Nf M(t)]. Plot together Nf,M(t) and its standard deviation p~2 against t. Plot together X(t) and its estimate

d) One unrealistic aspect of the simulations of part c) is that they assume that the

statistics of the noises Nd t) and N2 (t) are known exactly, i.e., that al and a2 and

q were given. A more realistic approach consists in using the sampled cross- and auto correlations

(3)

with 0 ::; k ::; M - 1, where T denotes the length of the length of the available data record (here T = 200). Write a MATLAB program which evaluates the sampled cross and auto correlations of Ydt) and Y2(t), and design noise cancellation filters of orders M = 2,4 and 6 based on these sampled statistics. Compare the filters you obtain with those of part c), and plot together X (t) and X M (t) against t. Plot separately the error -N1,M(t) = X(t) - XM(t) as a function of t.

e) In some situations, the desired signal may leak into the secondary sensor. In this case, the performance of the noise cancellation filter may be severely compromised. To evaluate the effect of such a leakage, assume that

For b = 0.1 and 0.2, (i) generate 200 samples of the observations Y2(t), (ii) evaluate the sampled satistics Ry1yZ and Ryz, and (iii) design noise cancellation filters of orders M = 2, 4 and 6. Compare the performance of these filters to the case b = 0 examined in part d). Draw some conclusions.

Note: The above problems are only small variations of Problems C6.1, C7.1 and C7.2 of

the textbook. For this last problem, you may also wish to consult pp. 583-584 of the book.