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


25 model_ outerr

Purpose
Simulation of an adaptive forward modeling application using a recursive adaptive filter updated according to the Output Error algorithm.

Syntax
model_outerr



Description
Figure 10.49: Block diagram of the forward modeling application using the Output Error recursive adaptive filter.
The block diagram of the system identification (forward modeling) problem using the Output Error adaptive algorithm is shown in Fig. 10.49 (see Section 6.3 for more details on the Output Error algorithm). The simulation considered here uses a recursive filter for the adjustable filter and the coefficients of the filter are updated using the Output Error 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 adaptive IIR model $w(n)$ are created and initialized using init_outerr(), and the input signals are read from files, then a processing loop is started. In each iteration of the loop asptouterr() is called with a new input sample and a new desired sample to calculate the filter output (estimated desired signal) and update the filter 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/outerrsysid.eps,width=\textwidth}


Code

clear all;	
infile = '.\wavin\scinwn.wav';    % input signal
dfile  = '.\wavin\scdar22.wav';   % desired signal 

N  = 2;                           % number of zeros
M  = 2;                           % number of poles
H  = 50;                          % response length
p1 = .2 + j* .85;                 % unknown filter poles
p2 = .2 - j* .85;                 % for verification
ip = [1; zeros(H-1,1)];           % impulse vector
h  = filter([0.6 -.01],[1 -(p1+p2) (p1*p2)],ip);
	
% Initial parameters
u0  = zeros(N+M,1);               % composite input vector
w0  = u0;                         % initial filter vector
c0  = u0;                         % initial delay line
d0  = randn(1,1);	                % initial desired sample
mu  = [.01;0.01;.001;0.001] ;     % Step size vector
  
% Create and initialize OUTERR IIR filter
[u,w,c,y,d,e,mu,Px,Py] = init_outerr(N,M,u0,w0,c0,d0,mu);				
[xn,inFs,inBits] = wavread(infile);   % read input
[dn,inFs,dBits]  = wavread(dfile);    % read desired
inSize = max(length(dn),length(xn));  % samples to process
E      = init_ipwin(inSize);          % Initialize IPWIN

%% Processing Loop
for (m=1:inSize)
   x = 2^(inBits-1) * xn(m);      % input sample
   d = 2^(inBits-1) * dn(m);      % desired sample
   
   % update the filter
   [u,w,c,y,e,Px,Py] = asptouterr(N,M,u,w,c,x,d,mu,Px,Py);
   
   % impulse response for verification
   wp = filter(w(1:N),[1 ; -w(N+1:N+M)],ip);

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

   % handle the Stop button
   while (stop ~= 0), stop 	= getStop; end;	
   % handle the Break button
	if (brk), plot_model(wp,h,E); break; end;	   
end;

plot_model(wp,h,E);



Results
Figure 10.50: Performance of the output error algorithm in a system identification application.
Running the above script will produce the graph shown in Fig. 10.50. The two top-left panels in Fig. 10.50 show the time and frequency responses of the unknown system for which this application is intended to provide an IIR 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 estimation error in the impulse response.


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


See Also
INIT_ OUTERR, ASPTOUTERR.

Reference
[2] and [10] for introduction to recursive adaptive filters.


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