Home > other >  Want to consult everybody a great god I can also how to optimize and improve the NLMS algorithm, and
Want to consult everybody a great god I can also how to optimize and improve the NLMS algorithm, and

Time:05-24

Clear all
Close all
N=5; % filter order
Sample_N=1000; Sampling points %

A=1; % signal amplitude
SNR=10; % SNR
T=1: sample_N;
Length_t=100;
% desired signal sequence lengthD=A * sin (2 * PI * t/length_t); % desired signal
M=length (d);
% M for receiving data lengthX=awgn (d, SNR); % after channel (noise)

The delta=1/(10 * N * (A ^ 2)); % calculation can make LMS algorithm convergence delta

Y=zeros (1, M);
H=zeros (1, N);
% LMS filter coefficientH_normalized=zeros (1, N); % normalized LMS filter coefficient
Y1=zeros (1, N);
For n=n: M % coefficient adjustment LMS algorithm
X1=x (n: 1: n - n + 1);

% LMS algorithmY (n)=h * x1 ';
E (n)=d (n) - y (n);
H=h + delta (n) * * e the x1;

% NLMS algorithmY_normalized (n)=x1 h_normalized * ';
E_normalized (n)=d (n) - y_normalized (n);
H_normalized=h_normalized + e_normalized x1/(n) * (x1 * x1 ');
End
Error=e. ^ 2; % each step LMS algorithm iterative mean square error (mse)
Error_normalized=e_normalized. ^ 2; % each step NLMS algorithm iterative mean square error (mse)
Obtained by solving the for n=n: M % h, x do convolution with the input signal, after filtering the results
X2=x (n: 1: n - n + 1);
Y1 (n)=h * x2 ';
Y2 (n)=h_normalized * x2 ';
End
Subplot (411)
The plot (t, d);
The axis ([1, sample_N, - 2, 2]).
Subplot (412)
The plot (t, x);
Subplot (413)
The plot (t, y);
Subplot (414)
The plot (t, y_normalized);
Figure (2)
The plot (t, the error, the 'r', t, error_normalized, 'b');
  • Related