| Purpose |
| Sample per sample filtering and coefficient update using the Normalized LMS (NLMS) algorithm. |
| Syntax |
[w,y,e,p]= asptnlms(x,w,d,mu)
[w,y,e,p]= asptnlms(x,w,d,mu,p,b)
|
| Description |
asptnlms() implements the NLMS adaptive algorithm used to update transversal adaptive filters.
Referring to the general adaptive filter shown in Fig. 2.6, asptnlms() takes an input
samples delay line asptnlms() is given by
asptnlms() for an FIR adaptive filter of Input Parameters [Size]:: x : input samples delay line [L x 1] w : filter coefficients vector w(n-1) [L x 1] d : desired output d(n) [1 x 1] mu : adaptation constant p : last estimated power of x(n), p(n-1) b : AR pole for recursive calculation of p(n) Output parameters:: w : updated filter coefficients w(n) y : filter output y(n) e : error signal; e(n) = d(n)-y(n) p : new estimated power of x(n), p(n) |
| Example |
% NLMS used in a simple system identification application. % By the end of this script the adaptive filter w should % have the same coefficients as the unknown filter h. % iter = 5000; % Number of samples to process % Complex unknown impulse response h = [.9 + i*.4; 0.7+ i*.2; .5; .3+i*.1; .1]; xn = 2*(rand(iter,1)-0.5); % Input signal, zero mean random. % although xn is real, dn will be complex since h is complex dn = osfilter(h,xn); % Unknown filter output en = zeros(iter,1); % vector to collect the error % Initialize the NLMS algorithm with a filter of 10 coef. [w,x,d,y,e,p]=init_nlms(10); %% Processing Loop for (m=1:iter) x = [xn(m); x(1:end-1)]; % update the input delay line d = dn(m) + 1e-3*rand; % additive noise of var = 1e-6 % call NLMS to calculate the filter output, estimation error % and update the coefficients. [w,y,e,p]= asptnlms(x,w,d,0.05,p,0.98); % save the last error sample to plot later en(m) = e; end; % display the results subplot(2,2,1);stem([real(w) imag(conj(w))]); grid; subplot(2,2,2); eb = filter(.1,[1 -.9], en .* conj(en)); plot(10*log10(eb ));gridRunning the above script will produce the graph shown in Fig. 4.12. The left side graph of the figure shows the adaptive filter coefficients after convergence which are almost identical to the unknown filter h. The right side graph shows the mean square error in dB versus time during the adaptation process, which is usually called the learning curve. The lower limit of the error power is governed here by the additive noise at the output (-60 dB).
|
| Algorithm |
The NLMS algorithm is a slightly improved version of the LMS algorithm. The current implementation of asptnlms() performs the following operations
|
| Remarks |
Like the LMS, the NLMS is also a stochastic implementation of the steepest-descent algorithm where the mean value of the filter coefficients converge towards their optimal solution. Therefore, the filter coefficients will fluctuate about their optimum values given by the Wiener solution. The amplitude of the fluctuations is controlled by the step size. The smaller the step size, the smaller the fluctuations (less final misadjustment) but also the slower the adaptive coefficients converge to their optimal values. Note also the following.
|
| Resources |
The resources required to implement the NLMS algorithm for a transversal adaptive FIR filter of
|
| See Also |
| INIT_ NLMS, ECHO_ NLMS, EQUALIZER_ NLMS, ASPTLMS, ASPTVSSLMS, ASPTLCLMS. |
| Reference |
| [11] and [4] for extensive analysis of the NLMS and the steepest-descent search method. |