Example_2.m in nlms.rar


nlms algorithm and its examples to share with you, I hope everyone can help me m...Original Link
    Sponsored links

			
clear;
alpha=0.5;  % Stepsize of NLMS
mu_lms=0.3; % Stepsize of LMS
M=5;
k=0:99;
x=cos(pi*k/100).*sin(pi*k/5);
b=[1,0,-1];
a=[1,1,0.9];
d=filter(b,a,x);
delta=0.05;
[e,w,mu_k]=nlms(alpha,M,x,d,delta);
[e_lms,w_lms]=lms(mu_lms,M,x,d);
[c,i]=max(mu_k);

%------------------------------------------------
subplot(3,1,1);
stem(k,x,'.');
hold on;
plot(k,cos(pi*k/100),'--','color','m');
title('Normalized LMS Method','fontsize',18)
ylabel('x(k)','fontsize',14);
grid on;
subplot(3,1,2);
stem(k,mu_k,'.');
text(i,c,'\leftarrow Peak Value');
ylabel('\mu(k)','fontsize',14);
grid on;
subplot(3,1,3);
stem(k,abs(e),'.');
ylabel('e(k)','fontsize',14);
xlabel('k','fontsize',14);
grid on;

%-------------------------------------------
mu_lms_vec=mu_lms*ones(1,100);
figure(2);
subplot(2,1,1);
stem(k,mu_k,'.');
ylim([0,10]);
title('Difference between NLMS and LMS','fontsize',18);
text(i,c,'\leftarrow Peak Value');
ylabel('\mu(k)','fontsize',14);
xlabel('NLMS','fontsize',14);
grid on;
subplot(2,1,2);
stem(k,mu_lms_vec,'.');
ylim([			

			...
			...
			... to be continued.

  This is a preview. To get the complete source file, 
  please click here to download the whole source code package.

			
			


Project Files

    Sponsored links
NameSizeDate
 Example_2.m2.08 kB28-08-08 20:55
 nlms.m691.00 B28-08-08 20:54
 <nlms>0.00 B30-09-08 12:27
...

Related Items

    Sponsored links