DSPRelated.com
Forums

iteration

Started by mohan prasad March 7, 2003
Hi,
I have the following situation.
In LMS algorithm I enter my input x as M by 1 matrix
where M is number of taps and my weight vector is also
M by 1.I initialize my w with all zeros.
Now at time n
e(n)= d(n)- w(n)'*x(n);
w(n+1)=w(n)+mu*w(n)*e(n);
I have to iterate this number of times.But since w and
u are matrices.I am not able to use the 'for' loop to
do the iteration.this is what is happening when I
iterate these matreices
error: to use A(I)=B I and B must have same lenths
Need help on this.
Thanks in advance,
Mohan



Hi,
Do you want to store all the value of w i.e. in each
iteration. If not instead of w(n) just use w in your
equations. Otherwise you need to have a 2-D w matrix
where one dimension is iteration index and other
dimension is the weight values.

e(n)= d(n)- w'*x;
w=w + mu*w*e(n);

Navan

--- mohan prasad <> wrote:
> Hi,
> I have the following situation.
> In LMS algorithm I enter my input x as M by 1 matrix
> where M is number of taps and my weight vector is
> also
> M by 1.I initialize my w with all zeros.
> Now at time n
> e(n)= d(n)- w(n)'*x(n);
> w(n+1)=w(n)+mu*w(n)*e(n);
> I have to iterate this number of times.But since w
> and
> u are matrices.I am not able to use the 'for' loop
> to
> do the iteration.this is what is happening when I
> iterate these matreices
> error: to use A(I)=B I and B must have same lenths
> Need help on this.
> Thanks in advance,
> Mohan > _____________________________________
> Note: If you do a simple "reply" with your email
> client, only the author of this message will receive
> your answer. You need to do a "reply all" if you
> want your answer to be distributed to the entire
> group.
>
> _____________________________________
> About this discussion group:
>
> To Join:
>
> To Post:
>
> To Leave:
>
> Archives: http://www.yahoogroups.com/group/matlab
>
> More DSP-Related Groups:
> http://www.dsprelated.com/groups.php3
>
> ">http://docs.yahoo.com/info/terms/


__________________________________________________