| Purpose |
| Simulation of a prediction application using the Lattice Forward Prediction Error Filter. |
| Syntax |
predict_lfpef
|
| Description |
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 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
|
| 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 |
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
|
| Audio Files |
The following files demonstrate the performance of the LFPEF in the application mentioned above.
|
| See Also |
| INIT_ LFPEF, ASPTLFPEF. |
| Reference |
| [2] and [4] for analysis of the adaptive Lattice filters. |