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


31 predict_ lfpef

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

Syntax
predict_lfpef



Description
Figure 10.61: Block diagram of a prediction application using the 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.61. 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 creates and initializes using init_lfpef(), and the input signal is read from file, then a processing loop is started. In each iteration of the loop asptlfpef() 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). 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/predict.eps,width=\textwidth}


Code
clear all;
infile  = '.\wavin\wnaecfes.wav';    % input signal, speech
outfile = '.\wavout\lfpef_out.wav';  % predictor output
errfile = '.\wavout\lfpef_err.wav';  % predictor error
M       = 3;                         % filter length
mu_p    = 0.01;                      % Step size

%% Initialize storage 
[k,b,P,e,y,c]    = init_lfpef(M);            % Init LFPEF 				
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
   [k,b,P,e,y] = asptlfpef(k,b,P,xn(m),mu_p);

   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.62: Performance of the Lattice Forward Prediction Error Filter in a prediction application.
Running the above script will produce the graph shown in Fig. 10.62. 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/predictlfpef.eps,width=\textwidth}


Audio Files
The following files demonstrate the performance of the LFPEF 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_ LFPEF, ASPTLFPEF.

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


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