Least Mean Square Algorithm
Afficher commentaires plus anciens
Hello. I am trying to implement this pseudo code to make a Least mean square algorithm. I'm not too good at matlab yet and I got stuck with this algorithm. I need to make an LSM algorithm to help me determine my filter "h". Here is the pseudo code:

Here is what I have so far. I load a signal that gives me two variables x and y, both length 500, then I need to apply the algorithm. I am not too sure how to apply xn from the pseudo code or how to finish this off really.
load sig.mat; % loads variables x and y
N = 5; % filter length
u = .01; % learning rate
h = zeros(1,N);
for n = 0:499
xn = x(n-(N-1));
en = y(n) - (h.')*xn;
h = h + u*en*xn;
end
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Standard File Formats dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!