Verify the Wiener Algorithms matlab code and Ws are zeros ?

Hello, I am new in filtering, I wrote a code for Wiener Algorithm Please verify it and pls guide me weight all Ws are zeros. Please anyone guide me Thanks in advance
% Wiener Algo
N = length(myData);
ord = 20;
x = myData;
w=zeros(1,ord);
mu =0.05;
for i=1:N
e(i) = d(i) - w(i)' * x(i);
w(i+1) = w(i);
end
for i=1:N
yd(i) = sum(w(i)' * x(i));
end

 Respuesta aceptada

Honglei Chen
Honglei Chen el 30 de Oct. de 2013
Are you trying to run LMS algorithm? If that's the case, the code as is does not really modify the weights, w, i.e. the error signal was never put into use. But even then, you need to update the entire weights. In algorithm, w(i) refers to the entire weight vector at iteration i.

3 comentarios

Thanks for the answer!
I wrote this code for Wiener filter. Is it correct? could you please let me know how may I update the weight for wiener filter.
I also tried the following code to update the weight. But weight is not updated. it contain just zeros :(
for i=1:N
e(i) = d(i) - w(i)' * x(i);
w(i+1) = w(i) + w(i)' * x(i);
end
Wiener filter has an inversion of covariance matrix. What you did here looks like its LMS implementation. You are not updating the weights right. The error signal needs to come into the picture and the entire weights need to be updated. Right now you are updating each element in the array, that's not what it means by w(i). HTH.
Thanks a lot !!
Actually, I am using same code for LMS just I am updating the mu and previous error like in following LMS code. because LMS update the filtering coefficient with each iteration. Which I understood different between Wiener and LMS just updating the weight. Wiener is not update the weight at each iteration and calculate the weight at time, so see the code for Wiener which I am trying.. Please check both algorithms and give me your feedback, if something is wrong make it correct and put comments. Actually, I am new in this arena and trying to under. Really your help will be highly appreciated !!
% LMS Algo
for i=1:N
e(i) = d(i) - w(i)' * x(i);
w(i+1) = w(i) + mu * e(i) * x(i);
end
% Wiener Algo
for i=1:N
e(i) = d(i) - w(i)' * x(i);
w(i+1) = w(i) + w(i)' * x(i);
% you mean I update error like w(i+1) = w(i)' + e(i) * x(i);
%but I am not getting results
end

Iniciar sesión para comentar.

Más respuestas (0)

Etiquetas

Preguntada:

el 29 de Oct. de 2013

Comentada:

el 30 de Oct. de 2013

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by