Znn3bq.jpeg
ÉÇÍ·´óѧº£Ñó¿ÆÑ§½ÓÊܵ÷¼Á
²é¿´: 1437  |  »Ø¸´: 5
µ±Ç°Ö÷ÌâÒѾ­´æµµ¡£
µ±Ç°Ö»ÏÔʾÂú×ãÖ¸¶¨Ìõ¼þµÄ»ØÌû£¬µã»÷ÕâÀï²é¿´±¾»°ÌâµÄËùÓлØÌû

zzbei

ľ³æ (ÕýʽдÊÖ)

[½»Á÷] ×ÔÊÊÓ¦matlab³ÌÐò£¨LMSºÍRLS£©

%lmsËã·¨Ô´³ÌÐò

clear all
close all
%channel system order
sysorder = 5 ;
% Number of system points
N=2000;
inp = randn(N,1);
n = randn(N,1);
[b,a] = butter(2,0.25);
Gz = tf(b,a,-1);
%This function is submitted to make inverse Z-transform (Matlab central file exchange)
%The first sysorder weight value
%h=ldiv(b,a,sysorder)';
% if you use ldiv this will give h :filter weights to be
h= [0.0976;
0.2873;
0.3360;
0.2210;
0.0964;];
y = lsim(Gz,inp);
%add some noise
n = n * std(y)/(10*std(n));
d = y + n;
totallength=size(d,1);
%Take 60 points for training
N=60 ;  
%begin of algorithm
w = zeros ( sysorder , 1 ) ;
for n = sysorder : N
  u = inp(n:-1:n-sysorder+1) ;
y(n)= w' * u;
e(n) = d(n) - y(n) ;
% Start with big mu for speeding the convergence then slow down to reach the correct weights
if n < 20
mu=0.32;
else
mu=0.15;
end
  w = w + mu * u * e(n) ;
end
%check of results
for n = N+1 : totallength
  u = inp(n:-1:n-sysorder+1) ;
y(n) = w' * u ;
e(n) = d(n) - y(n) ;
end
hold on
plot(d)
plot(y,'r');
title('System output') ;
xlabel('Samples')
ylabel('True and estimated output')
figure
semilogy((abs(e))) ;
title('Error curve') ;
xlabel('Samples')
ylabel('Error value')
figure
plot(h, 'k+')
hold on
plot(w, 'r*')
legend('Actual weights','Estimated weights')
title('Comparison of the actual weights and the estimated weights') ;
axis([0 6 0.05 0.35])

% RLS Ëã·¨
randn('seed', 0) ;
rand('seed', 0) ;

NoOfData = 8000 ;  % Set no of data points used for training
Order = 32 ;    % Set the adaptive filter order

Lambda = 0.98 ;    % Set the forgetting factor
Delta = 0.001 ;    % R initialized to Delta*I

x = randn(NoOfData, 1) ;% Input assumed to be white
h = rand(Order, 1) ;  % System picked randomly
d = filter(h, 1, x) ;  % Generate output (desired signal)

% Initialize RLS

P = Delta * eye ( Order, Order ) ;
w = zeros ( Order, 1 ) ;

% RLS Adaptation

for n = Order : NoOfData ;
   
  u = x(n:-1:n-Order+1) ;
  pi_ = u' * P ;
  k = Lambda + pi_ * u ;
  K = pi_'/k;
  e(n) = d(n) - w' * u ;
  w = w + K * e(n) ;
  PPrime = K * pi_ ;
  P = ( P - PPrime ) / Lambda ;
  w_err(n) = norm(h - w) ;

end ;

% Plot results

figure ;
plot(20*log10(abs(e))) ;
title('Learning Curve') ;
xlabel('Iteration Number') ;
ylabel('Output Estimation Error in dB') ;

figure ;
semilogy(w_err) ;
title('Weight Estimation Error') ;
xlabel('Iteration Number') ;
ylabel('Weight Error in dB') ;

[ Last edited by »ÃÓ°ÎÞºÛ on 2006-10-26 at 07:47 ]
»Ø¸´´ËÂ¥

» ÊÕ¼±¾ÌûµÄÌÔÌûר¼­ÍƼö

source

» ²ÂÄãϲ»¶

¾­Àú¾ÍÊÇÒ»ÖÖÏíÊÜ
ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû

wanglong

Ìú¸Ëľ³æ (ÕýʽдÊÖ)

0.5

·Ç³£¸Ðл,¸Õ²ÅûÆÀ¼Û,ÖØÀ´
5Â¥2006-05-11 12:52:37
ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû
²é¿´È«²¿ 6 ¸ö»Ø´ð

wanglong

Ìú¸Ëľ³æ (ÕýʽдÊÖ)

·Ç³£¸Ðл£¡£¡£¡£¡ÀÏ´ó£¬ÓÐɶºÃ¶«¶«£¬¶àÉÏ´©Ò»µã
4Â¥2006-05-11 12:51:08
ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû
×î¾ßÈËÆøÈÈÌûÍÆ¼ö [²é¿´È«²¿] ×÷Õß »Ø/¿´ ×îºó·¢±í
[¿¼ÑÐ] 297¹¤¿Æµ÷¼Á? +10 ºÓÄÏũҵ´óѧ-ÄÜ 2026-04-13 10/500 2026-04-14 08:56 by dick_runner
[¿¼ÑÐ] 291 Çóµ÷¼Á +35 »¯¹¤2026½ì±ÏÒµÉ 2026-04-09 35/1750 2026-04-14 08:34 by ¿ÆÓîÀÏʦ
[¿¼ÑÐ] Çóµ÷¼Á +12 Á§ÜÔÒ»¶¨Éϰ¶ 2026-04-10 13/650 2026-04-14 00:08 by Equinoxhua
[¿¼ÑÐ] Ò»Ö¾Ô¸2110£¬»¯Ñ§Ñ§Ë¶310·Ö£¬±¾¿ÆÖصãË«·ÇÇóµ÷¼Á +20 ŬÁ¦·Ü¶·112 2026-04-08 20/1000 2026-04-13 14:24 by ÕÅzhihao
[¿¼ÑÐ] ÉúÎïѧ308·ÖÇóµ÷¼Á£¨Ò»Ö¾Ô¸»ª¶«Ê¦´ó£©×ö¹ý·Ö×ÓʵÑé +9 ÏàÐűػá¹ââÍòÕ 2026-04-07 10/500 2026-04-13 10:20 by ¿Éµ­²»¿ÉÍü
[¿¼ÑÐ] Ò»Ö¾Ô¸»ªÖÐũ΢ÉúÎ288·Ö£¬ÈýÄêʵÑé¾­Àú +11 ´úfish 2026-04-09 11/550 2026-04-12 10:21 by Hayaay
[¿¼ÑÐ] Ò»Ö¾Ô¸Î÷±±¹¤Òµ´óѧ289 085602 +33 yangæÃ 2026-04-10 34/1700 2026-04-12 08:11 by Art1977
[¿¼ÑÐ] 303Çóµ÷¼Á +14 SereinQ 2026-04-10 15/750 2026-04-11 20:43 by À¶ÔÆË¼Óê
[¿¼ÑÐ] 070300»¯Ñ§279Çóµ÷¼Á +19 ¹þ¹þ¹þ^_^ 2026-04-08 20/1000 2026-04-11 20:43 by stoner78
[¿¼ÑÐ] 085410-273Çóµ÷¼Á +6 X1999 2026-04-10 6/300 2026-04-11 10:32 by Delta2012
[¿¼ÑÐ] Ò»Ö¾Ô¸211£¬»¯Ñ§310·Ö£¬±¾¿ÆÖصãË«·Ç£¬Çóµ÷¼Á +23 ŬÁ¦·Ü¶·112 2026-04-08 23/1150 2026-04-10 23:29 by 314126402
[¿¼ÑÐ] 265Çóµ÷¼Á +12 ·ç˵ËýÔçÍüÁË 2026-04-10 13/650 2026-04-10 18:56 by chemisry
[¿¼ÑÐ] 293µ÷¼Á +25 yj1221 2026-04-08 26/1300 2026-04-10 15:02 by ²ñС°×
[¿¼ÑÐ] µ÷¼Á +19 2261744733 2026-04-08 19/950 2026-04-09 19:11 by vgtyfty
[¿¼ÑÐ] ²ÄÁÏר˶³õÊÔ·Ö332Ò»Ö¾Ô¸Î÷±±¹¤Òµ´óѧ£¬ +12 ¹ÊÈË?? 2026-04-09 12/600 2026-04-09 18:34 by Ccclqqq
[¿¼ÑÐ] µ÷¼Á +12 ÔÂ@163.com 2026-04-08 12/600 2026-04-09 14:27 by rl1980
[¿¼ÑÐ] 086000ÉúÎïÓëÒ½Ò©µ÷¼Á +7 awwwwwooooo 2026-04-09 7/350 2026-04-09 13:31 by ±±¼«159263
[¿¼ÑÐ] ²ÄÁÏ307·ÖÇó´óÀÐ×éÊÕÁô +17 Hllºú 2026-04-07 17/850 2026-04-09 10:53 by liuhuiying09
[¿¼ÑÐ] 296Çóµ÷¼Á +3 Íô£¡£¿£¡ 2026-04-08 3/150 2026-04-08 22:00 by zhouyuwinner
[¿¼ÑÐ] 259Çóµ÷¼Á +5 ¾Í°®³ÔÍÁ¶¹Ñ½Ñ½ 2026-04-07 5/250 2026-04-07 22:40 by JourneyLucky
ÐÅÏ¢Ìáʾ
ÇëÌî´¦ÀíÒâ¼û