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:499xn = x(n-(N-1));en = y(n) - (h.')*xn;h = h + u*en*xn;end
Best Answer