Assignment 5: Aait School of Electrical and Computer Eng. Communications Engineering (CNT), PG
Assignment 5: Aait School of Electrical and Computer Eng. Communications Engineering (CNT), PG
AAiT
School of Electrical and Computer Eng.
Communications Engineering (CNT), PG
ID-GSR/3116/12, Regular
[email protected]
Assignment 5
ECEG 6306 : SDSP : Mr. Bisrat Derebssa
Due MONDAY, may 15, 2020
Contents
Problem 1 2
(a) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
(b) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
(c) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
(d) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
(glossary) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1
Yonas Desta ECEG 6306: Assignment 5
Problem 1
Consider an observed random signal x(n) is generated by passing a desired signal through a certain
system
x(n) = 0.7y(n) − 0.5y(n − 1) + w(n) Where w(n) ≈ W GN (0, sigma2 ), (Substitute your ID number
divided by 10, 000 for σ 2 .Example if your ID is GSE/1234/11, then σ 2 = (0.1234).
You are required to implement an adaptive filter to identify the system from observation of x(n) and
y(n). By using MATLAB obtain the following.
(a)
Record a 10 second duration of your speech signal as y(n) and generate the random signal x(n) for 0n500.
Use a sampling frequency of 8kHz. Then x(n) is observed and you are required to design an adaptive filter.
Answer
By using the audiorecord comand on mathlab we can record directly the voice, but due to the
inability of my laptop’s sound card, i rather have recorded my speech on my phone and get the
audiodata directly from the recorded speech by using audioread command.
The Recorded sound is found on archived folder.
The matlab code for the above adaptive filter design will be shown bellow.
(b)
Implement the LMS adaptive algorithm to estimate x(n) from y(n) assuming the filter order is 3 and
discuss how the adaptive LMS filter coefficient changes with time.
Answer
In order to implement the LMS , we use the mathlab code bellow and the coefficients will be
computed by the following equation.
For n = 0, 1, 2, . . .
ŷ(n) = cH (n − 1)x(n).....F iltering
c(n)=y(n)- (n).....error formation
c(n)=c(n-1)+2µx(n)e∗ (n)...coeffcient updating
The mathlab code for LMS and normalized LMS filter is written bellow.
M = 3;
tic [e1, y1, w1] = myLMS(d, v, mu, M); toc
figure()
subplot(3,1,1)
plot(e1)
title(’Least Mean Square Adaptive Filter Output ’)
ylim([-0.11,0.11])
subplot(3,1,2)
plot(e2)
title(’Normalized Least Mean Square Adaptive Filter Output’)
ylim([-0.11,0.11])
The two functions called in the above script are found on the glossary.
The LMS filters adapt their coefficients until the difference between the desired signal and the
actual signal is minimized (least mean squares of the error signal). This is the state when
the filter weights converge to optimal values, that is, they converge close enough to the actual
coefficients of the unknown system. This class of algorithms adapt based on the error at the
current time.
(c)
Implement the recursive LS adaptive algorithm to estimate x(n) from y(n) assuming the filter order is 3
and discuss how the adaptive recursive LS filter coefficient changes with time.
Answer
In order to implement the recursive LS , we use the mathlab code bellow and the coefficients will
be computed by the following equation.
For n = 0, 1, 2, . . .
ŷ(n) = cH (n − 1)x(n)
c(n)=y(n)- (n)
c(n)=c(n-1)+g(n)e∗ (n)
where
The RLS adaptive filter algorithm recursively finds the filter coefficients that minimize a weighted
linear least squares cost function relating to the input signals. These filters adapt based on the
total error computed from the beginning.
It minimize the cost function, C(n) by appropriately selecting the filter coefficients w(n) and
updating the filter as the new data arrives.
(d)
Compare LMS with RLS adaptive algorithm.
Answer
Comparison:
Least mean squares (LMS) algorithms represent the simplest and most easily applied adaptive
algorithms. The recursive least squares (RLS) algorithms, on the other hand, are known for
their excellent performance and greater fidelity, but they come with increased complexity and
computational cost.
Compared to the LMS algorithm, the RLS approach offers faster convergence and smaller error
with respect to the unknown system at the expense of requiring more computations. The General
comparision scheme for the above two filter types can be summerized as follows.
(glossary)
Answer
1. myRLS function.
2. myNLMS function.
3. myLMS function.
Page 8 of 8