next up previous contents
Next: 24 model_ mvsslms Up: 10 Applications and Examples Previous: 22 model_ eqerr   Contents


23 model_ lmslattice

Purpose
Simulation of an adaptive forward modeling application using an adaptive joint process estimator updated according to the LMS Lattice algorithm.

Syntax
model_lmslattice



Description
Figure 10.45: Block diagram of the Lattice joint process estimator in a forward modeling application.
The block diagram of the system identification (forward modeling) problem using the LMS Lattice adaptive algorithm is shown in Fig. 10.45. The LMS Lattice algorithm adjusts the PARCOR coefficients of the lattice predictor and the linear combiner coefficients simultaneously to minimize the mean square of the forward and backward prediction errors as well as the modeling error $e(n)$ (see Section 5.4 for more information on the LMSLATTICE algorithm). The input signal $x(n)$ (measured signal at the input of the system to be modeled) is stored in the file infile. The desired signal $d(n)$ (the signal measured at the system output in response to applying $x(n)$ at its input) is stored in the file dfile. First the variables for the LMS-Lattice filter are creates and initializes using init_lmslattice(), and the input signals are read from files, then a processing loop is started. In each iteration of the loop asptlmslattice() is called with a new input sample and a new desired sample to calculate the filter output (estimated desired signal) and update the adaptive model coefficients. This simulation script uses the standard ASPT iteration progress window (IPWIN). The IPWIN has four buttons which allow you to stop and continue the simulation, show or hide the simulation graph window, break out of the processing loop, and quit the simulation. After processing all the samples, or on pressing the break or stop buttons, the sensor signal $e(n)$ is written to a wave audio file and a graph presenting the echo canceler performance is generated.


\epsfig{file=/home/john/winD/docs/aspt/aspt/figs/llsysid.eps,width=\textwidth}


Code
clear all;
load .\data\h32;                 % for verification

% Data files
infile = '.\wavin\scinwn.wav';   % input signal, white noise
dfile  = '.\wavin\scdwn32.wav';  % system output 

% Simulation parameters
L      = 32;                     % adaptive model length
mu_c   = .1/L;                   % linear combiner step size
mu_p   = 1e-6;                   % linear predictor step size

%% Initialize storage 
[k,w,b,P,d,y,e]  = init_lmslattice(L); % Init LMS Lattice				
[xn,inFs,inBits] = wavread(infile);    % read input signal
[dn,inFs,dBits]  = wavread(dfile);     % read desired signal
inSize = min(length(dn),length(xn));   % samples to process
E      = init_ipwin(inSize);           % Initialize IPWIN
uk     = 1;                            % PARCOR update flag

%% Processing Loop
for (m=1:inSize)
   % stop updating k after 2000 samples
   if (m == 2000), uk=0;end  
   x  = xn(m);       % new input sample
   d  = dn(m);       % new desired sample

   % update the adaptive model
   [k,w,b,P,y,e] = asptlmslattice(k,w,b,P,x,d,mu_p,mu_c,uk);

   % update the iteration progress window
   [E, stop,brk] = update_ipwin(E,e,d,'m',w,h32);

   % handle the Stop button
   while (stop ~= 0), stop = getStop; end;

   % handle the Break button		
   if (brk), plot_model(w,h32,E); break; end;	
end;

plot_model(w,h32,E);



Results
Figure 10.46: Performance of the LMS Lattice adaptive filter in a system identification application.
Running the above script will produce the graph shown in Fig. 10.46. The two top-left panels in Fig. 10.46 show the time and frequency responses of the unknown system for which this application is intended to provide a FIR model. The time and frequency responses for the model obtained by the adaptive filter are shown in the two top-right panels. The bottom-left panel shows the learning curve and the bottom-right panel shows the error in the filter coefficients by the end of the simulation.


\epsfig{file=/home/john/winD/docs/aspt/aspt/figs/modellmslattice.eps,width=\textwidth}


See Also
INIT_ LMSLATTICE, ASPTLMSLATTICE.

Reference
[2] and [4] for analysis of the adaptive Lattice filters.


next up previous contents
Next: 24 model_ mvsslms Up: 10 Applications and Examples Previous: 22 model_ eqerr   Contents