# Why is the error between the desired signal and estimated signal in the case of LMS filter remaining constant even after n number of iterations

I am giving white noise as input to an adaptive filter which is initialized to zero (value of filter coefficients of adaptive filter is 0). I am getting a desired response $$d(n)$$ by passing white noise through an unknown channel of impulse response $$h(n)$$.

Now using LMS algorithm, I am trying to update the adaptive filter coefficients by using the equation $$w(n+1)=w(n)+\mu u(n) e(n)$$ where $$\mu$$ is the step size or adaptation speed of the algorithm, $$u(n)$$ is the white noise which is passed to a speaker and $$e(n)$$ is the difference between desired response and estimated response.

Even after $$n$$ number of iterations, why is that the error signal, which is the difference between desired response and estimated response, not decreasing but remaining almost constant.

• Would be helpful if you can tell the values of mu, and make sure you are using the same u[n] sequence for input to adaptive filter as well as to the speaker. If not then the error will not converge. Even better, if you could post the block diagram of your setup. This way it would also help improve your understanding (a picture is worth 1000 words..) – jithin Mar 11 at 6:06
• The value of mu is changed from 0.01 to 0.1.Still, there is no change in the error signal – Deepa Mar 11 at 6:24
• There seems to be delay from speaker input till computation of d[n] which is not taken into account. Instead of white noise, can you try giving a known signal, say, all 1s (constant amplitude signal) as a sanity check? – jithin Mar 11 at 9:20
• Are you sure that the model of the adaptive filter matches the order of the unknown filter characterized by $h(n)$? – fibonatic Mar 11 at 9:35
• @jithinrj The response that I am getting is that there is always one sample delay between the desired signal and the signal estimated by the adaptive filter, i.e the adaptive filter is producing the estimate of the desired sample after 1 sample delay.Won't the adaptive filter able to adapt to the delay produced by the unknown channel h(n) – Deepa Mar 11 at 9:51

As mentioned in the comment, I modified the code given here and was able to adapt the LMS filter with error tapering to zero. The only assumption I made is that (since I am not an audio expert and do not know how the channel from speaker to the microphone would look like), I assumed a 10 tap channel with only first 3 non-zero values (multi-path reflection from walls). OP is free to use a channel of his/her choice. Using this I generated 'actual_fb_path' by convolving white-noise with assumed channel. If I get access to 'actual_fb_path' it would be great. I would request OP to modify this as per the system model to see if it adapts to the delay.

clc
clear all
close all
training_input = rand(1,100);
h_actual = [0.8 0.3 0.05 zeros(1,7)]; %channel assumption
actual_fb_path = conv(training_input, h_actual);
d = actual_fb_path;
mu = 0.1;
%ha = lms(40,mu);
%[y,e] = filter(ha, training_input, d);
lms = dsp.LMSFilter;
lms.StepSize = mu;
lms.Length = 10;
[y,e]=lms([training_input zeros(1,9)]', d');
%subplot(2,1,1)
N=length(training_input) + length(h_actual)-1;
figure()
plot(1:N,d,'r',1:N,y,'b',1:N,e,'g')
title('System')
legend('Desired','Output','Error')


• When I tried convolving the white noise with an impulse response similar to your's,I am getting error values going down to 0.However,the feedback samples obtained in the practical scenario(white noise passed through speaker), it fails to give the desired result.Since I can't attach excel sheet containing actual data samples here,its difficult to show the scenario.I will attach the matlab figure I have obtained. – Deepa Mar 13 at 6:12
• @Deepa it may happen that the noise itself is high. Can you just sample the noise alone from speaker (without giving any input to it)? How does that look? – jithin Mar 14 at 4:49
• Did you meant the white noise which is given to the speaker – Deepa Mar 16 at 5:48
• Not the white noise. Do not give any input to speaker. – jithin Mar 16 at 7:04
• The data samples obtained from the speaker is almost constant random values – Deepa Mar 17 at 6:25