Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

LMS method to findfilter coefficients of order 2. here is code

Status
Not open for further replies.

ayina

Newbie level 6
Newbie level 6
Joined
Oct 19, 2013
Messages
14
Helped
1
Reputation
2
Reaction score
1
Trophy points
3
Location
pakistan
Visit site
Activity points
124
plot is showing opposite result because of some mistake which i couldn't found so it is diverging instead of convergence.here is code
M=2; %tap weighth length
a(1:M)=[1 2.0260]% 2.1480 -1.1590];
l=M;mu=0.3;tol(1:M,1)=1e-4';

U=rand(1,l)';%input vector of length 10
R=U'*U; % R matrix
Wo=a';
d=Wo'*U;
P=U*d';
W_hat(1:M,1:10000)=0;
% %
i=2;
d_hat(1)=W_hat:),1)'*U;
deltaJw:),1)=-2*U*d'+2*U*U'*W_hat:),1);
while(i<10000)
d_hat(i)=W_hat(1:M,i)'*U;
W_hat:),i)=W_hat:),i-1)-mu*U*(d-d_hat(i));
deltaJw:),i)=-2*U*d'+2*U*U'*W_hat:),i);

if (abs(W_hat:),i)-Wo))<tol:),1)
break
end
i=i+1;
end
figure(2)
plot(W_hat(1,:),W_hat(2,:),'or')
hold on
plot(Wo(1,1),Wo(2,1),'.')
axis ([-3 3 -3 3])
xlabel('w1(n)','FontSize',10)
ylabel('w2(n)','FontSize',10)
grid on
title('w2(n) vs w1(n) with step size 0.3','FontSize',14)
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top