| Purpose |
| Simulation of an adaptive inverse modeling application using an adaptive filter updated according to the Normalized Least Mean Squares (NLMS) algorithm. |
| Syntax |
equalizer_nlms
|
| Description |
The block diagram of the equalization (inverse modeling) problem is shown in Fig. 10.37. The simulation considered here uses a transversal FIR filter for the adjustable filter and the coefficients of the filter are updated using the NLMS algorithm. The input signal init_nlms(), and the input signals are read from files, then a processing loop is started. In each iteration of the loop asptnlms() is called with a new input sample and a new desired sample to calculate the filter output
|
| Code |
clear all; load .\data\h32; % for verification ufile = '.\wavin\scinwn.wav'; % input signal xfile = '.\wavin\scdwn32.wav'; % system output h = h32; D = 32; % delay in desired path M = 64; % adaptive model length mu = .2/M; % Step size b = 0.98; % smoothing pole %% Initialize storage [w,x,d,y,e,p] = init_nlms(M); % Init NLMS algorithm [un,x1Fs,x1Bits] = wavread(ufile); % Get system input [xn,x2Fs,x2Bits] = wavread(xfile); % Get system output inSize = min(length(un),length(xn)); % Samples to process E = init_ipwin(inSize); % Initialize IPWIN %% Processing Loop % The desired signal is the delayed un(n) and the adaptive filter % input is xn(n) which is the output of the system to be equalized. for (m=D+1:inSize) x = [xn(m,:);x(1:M-1,:) ]; % update the delay line d = un(m-D,:); % desired sample % Update the adaptive filter and calculate the output and error [w,y,e,p]= asptnlms(x,w,d,mu,p,b); % update the iteration progress window [E, stop,brk] = update_ipwin(E,e,d, 'i', w, h, D); % handle the Stop button while (stop ~= 0), stop = getStop; end; % handle the Break button if (brk), plot_invmodel(w,h,E,D); break; end; end; plot_invmodel(w,h,E,D); |
| Results |
Running the above script will produce the graph shown in Fig. 10.38. The two top-left
panels in Fig. 10.38 show the time and frequency responses of the optimum solution
for the inverse modeling problem at hand. The time and frequency responses for the model
obtained by the adaptive filter are shown in the two top-right panels. The bottom panel
shows the learning curve for the adaptive filter. Note that the input signal is colored
by the physical system which might increase the eigenvalue spread in the adaptive filter
input signal
|
| See Also |
| INIT_ NLMS, ASPTNLMS, MODEL_ NLMS. |
| Reference |
| [11] and [4] for extensive analysis of the NLMS and the steepest-descent search method. |