next up previous contents
Next: Bibliography Up: 10 Applications and Examples Previous: 32 predict_ rlslbpef   Contents


33 predict_ rlslfpef

Purpose
Simulation of a prediction application using the RLS Lattice Forward Prediction Error Filter.

Syntax
predict_rlslfpef



Description
Figure 10.65: Block diagram of a prediction application using the RLS lattice forward prediction error filter.
The input signal in this application is a speech fragment contaminated with white noise. The predictor will be able to estimate the speech only, which makes the predictor output containing less noise than its input. The error signal will contain the noise rejected by the predictor and any speech components that could not be estimated. The block diagram of the lattice predictor used in this application is shown in Fig. 10.65. The input signal $x(n)$ (a speech fragment contaminated with white noise) is stored in the file infile. The application attempts to separate the speech from the noise and stores the former in the file outfile and the latter in errfile. First the variables for the adaptive lattice forward prediction error filter are created and initialized using init_rlslfpef(), and the input signal is read from file, then a processing loop is started. In each iteration of the loop asptrlslfpef() is called with a new input sample to calculate the predictor output $y(n)$ (estimated speech), the error sample $e(n)$ (the noise and residual unestimated speech) and update the PARCOR coefficients of the lattice predictor. This simulation script uses the standard ASPT iteration progress window (IPWIN). An 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 breaking out of the processing loop, the residual 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/predict.eps,width=\textwidth}


Code
clear all;
infile  = '.\wavin\wnaecfes.wav';       % input signal, speech
outfile = '.\wavout\rlslfpef_out.wav';  % predictor output
errfile = '.\wavout\rlslfpef_err.wav';  % predictor error
M       = 3;                            % filter length
a       = 0.99;                         % forgetting factor

%% Initialize storage 
[ff,bb,fb,cf,b,y,e,kf,kb] = init_rlslfpef(M);				
inSize           = wavread(infile, 'size');  % input data size
[xn,inFs,inBits] = wavread(infile);          % Read input signal
E                = init_ipwin(max(inSize));  % initialize IPWIN
out              = zeros(size(xn));          % estimated signal
err              = zeros(size(xn));          % prediction error

%% Processing Loop
for (m=1:inSize)
 
   % update the PARCOR coefficients
   [ff,bb,fb,cf,b,y,e,kf,kb]=asptrlslfpef(ff,bb,fb,cf,b,a,xn(m));
   out(m) = y;    % save predictor output
   err(m) = e;    % save prediction error

   % update the iteration progress window
   [E, stop,brk]	= update_ipwin(E,e,xn(m),'p',xn,out,err);	

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

   % handle the Break button	
	if (brk), plot_predict(xn,out,err,E); break; end;	
end;

plot_predict(xn,out,err,E);

% save the predicted speech to file
wavwrite(out(1:m,:),inFs,inBits,outfile);

% save the prediction error to file
wavwrite(err(1:m,:),inFs,inBits,errfile);



Results
Figure 10.66: Performance of the RLS Lattice Forward Prediction Error Filter in a prediction application.
Running the above script will produce the graph shown in Fig. 10.66. In this graph, the top left panel shows the PEF input signal, the top right panel shows the prediction error, the bottom left panel shows the predictor output and the bottom right shows the ratio in dB between the power of the prediction error $e(n)$ and the power of the input signal $x(n)$.


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


Audio Files
The following files demonstrate the performance of the RLSLFPEF in the application mentioned above.
wavin.wav input signal, speech + white noise.
wavout_out.wav predictor output, estimated speech.
wavout_err.wav prediction error, noise.

See Also
INIT_ RLSLFPEF, ASPTRLSLFPEF.

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


next up previous contents
Next: Bibliography Up: 10 Applications and Examples Previous: 32 predict_ rlslbpef   Contents