A list,







Ii. Source code

% This program realizes the time domain LMS algorithm, and obtains the convergence curve under the asynchronism length by the statistical method100; % statistical simulation times are g N=1024; % Sampling points of input signal N k=128; % Time domain tap LMS algorithm filter order pp= Zeros (g, n-k); % stores the error result of each independent cycle in the matrix PP so that its average u=0.001;                
for q=1:g                 
t=1:N;
a=1;
s=a*sin(0.05*pi*t); Input single frequency signals 
figure(1);
subplot(311) plot(t,real(s)); % Signal S time domain waveform title('Signal S time domain waveform');
xlabel('n');
ylabel('s');
axis([0,N,-a- 1,a+1]);
xn=awgn(s,3); % add gaussian white noise with mean value of zero, signal-to-noise ratio is3DB % set y=zeros(1,N); % output signaly
y(1:k)=xn(1:k); % take the first k values of input signal xn as the first k values of output y w=zeros(1,k); % set tap weighting initial value e=zeros(1,N); % error signal % iteratively filtered by LMS algorithmfor i=(k+1):N
    XN=xn((i-k+1):i);  
    y(i)=w*XN';
    e(i)=s(i)-y(i);
    w=w+u*e(i)*XN;    
end
pp(q,:)=(e(k+1:N)).^2;   
end
subplot(312)
plot(t,real(xn)); % signal S time domain waveform plot(t,real(y)); % Signal S time domain waveform title('Adaptive Filtered output Time domain Waveform');
for b=1:N-k bi(b)=sum(pp(:,b))/g; % Find the statistical average of the error endCopy the code

3. Operation results

Fourth, note

Version: 2014a complete code or write plus 1564658423