next up previous contents
Next: 4 asptlmslattice Up: 5 Lattice Adaptive Algorithms Previous: 2 asptlbpef   Contents


3 asptlfpef

Purpose
Implements an adaptive LMS Lattice Forward Prediction Error Filter.

Syntax
[k,b,P,e,y,c] = asptlfpef(k,b,P,x,mu_p)



Description
Figure 5.4: Block diagram of the forward prediction error filter.
asptlfpef() is a lattice implementation of the forward prediction error filter shown in Fig. 5.4. Instead of updating the coefficients of a transversal filter, asptlfpef() updates the PARCOR coefficients of a lattice predictor of the same order. The forward prediction error of the last lattice stage is returned as the error signal $e(n)$ of the prediction error filter. If the number of output arguments are more than 5, the coefficients of the equivalent transversal prediction error filter are also calculated and returned in the variable $c$ such that
\begin{displaymath}
e(n) = [1; -\vc ]^T \; \vx (n-1)
\end{displaymath} (45)

where $[1; -\vc ]^T$ represents the impulse response between the PEF output e(n) and its input x(n) and $\vx (n-1)$ is the input signal delay line delayed by one sample. The input and output parameters of asptlfpef() of $L$ stages are summarized below.
Input Parameters:: 
   k   : vector of lattice predictor coefficients
   b   : vector of backward prediction error
   P   : vector of last estimated power of b
   x   : new input sample
   mu_p: adaptation constant for the predictor coefficient

Output parameters::
   k   : updated lattice predictor coefficients
   b   : updated backward prediction error vector
   P   : updated power estimate of b
   e   : forward prediction error
   y   : predictor output
   c   : Equivalent transversal predictor coefficients.


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


Example
% LFPEF used in a adaptive line enhancer application.
% By the end of this script, the forward prediction error 
% is the wide-band signal and the output of the equivalent 
% transversal predictor is the narrow-band signal.
iter = 5000;
t    = (1:iter)/1000;           % time index @ 1kHz
xn   = 2*(rand(iter,1)-0.5)  ;  % Input signal, zero mean random
xn   = xn + 1 * cos(2*pi*50*t');% add 50 Hz narrow-band to input
yn   = zeros(iter,1);           % narrow-band signal
en   = yn;                      % error signal
% Initialize LFPEF
M    = 10;                      % filter length
mu_p = 0.01;                    % Step size
[k,b,P,e,y,c]=init_lfpef(M);    % Init LFPEF

%% Processing Loop
for (m=1:iter)
   [k,b,P,e,y,c] = asptlfpef(k,b,P,xn(m),mu_p);
   yn(m,:) = y;              % save narrow-band
   en(m,:) = e;              % save wide-band
end;

h = filter([1 ; -c],1,[1;zeros(1023,1)]);
f = (0:512)*500/512;
H = 20*log10(abs(fft(h)));
% display the results
subplot(2,2,1);plot(f,H(1:513,:)); grid;
subplot(2,2,2);
plot([yn(4800:5000)]);grid
Running the above script will produce the graph shown in Fig. 5.5. The left side graph of the figure shows the frequency response of the equivalent transversal prediction error filter after convergence. This frequency response shows that the predictor adjusts itself to pass the narrow-band signal at 50 Hz and attenuate all other input components so that the error signal contains the wide-band signal only. The right side graph shows the last 200 samples of the filter output which shows that the filter output coincide with the narrow-band 50 Hz superimposed on the white noise input signal.



Figure 5.5: The frequency response of the PEF after convergence and the filter output for the adaptive line enhancer using LFPEF.


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

Algorithm
asptlfpef() performs the following operations
  • Calculates the forward and backward prediction errors for the lattice structure stages using the order update equations (see section 2.2.4),
  • Calculates the power estimate of the backward prediction errors,
  • Updates the PARCOR coefficients of the lattice predictor,
  • Calculates the equivalent transversal predictor coefficients from the updated PARCOR coefficients,
  • Calculates the equivalent transversal predictor output.

Remarks
The adaptive Lattice Prediction Error Filter is a useful tool in linear prediction and autoregressive modeling applications. A few of the features that make the LFPEF so popular are:
  • The PARCOR coefficients always satisfy the relation $\vert k_{m}\vert \leq 1$.
  • The power of the forward prediction error $E[e_{fm}^2(n)]$ and the backward prediction error $E[e_{bm}^2(n)]$ of the same stage are equal.
  • The backward prediction errors $e_{b0}(n), e_{b1}(n), \cdots, e_{bM}(n)$ are uncorrelated with one another for any input sequence $x(n)$. This property is very important since it shows that the lattice predictor can be seen as an orthogonal transformation with the input signal samples $x(n), x(n-1), \cdots, x(n-M+1)$ as input and the backward errors $e_{b0}(n), e_{b1}(n), \cdots, e_{bM}(n)$ as the uncorrelated (orthogonal) output.
  • The power of the prediction error decreases with increasing predictor order. The error power decrease is controlled by the magnitude of the PARCOR coefficients. The closer the value of a PARCOR coefficient to unity, the higher the contribution of its stage in reducing the prediction error. The first few stages usually have PARCOR coefficients of high magnitudes. The magnitude of the coefficients decreases with increasing stage number.



Resources
The resources required to implement the LFPEF of $L$ stages in real time is given in the table below. The computations given are those required to process one sample.


MEMORY $5L + 6$
MULTIPLY $10L + 5 + sum(1:L-1)$
ADD $7L + 2 + sum(1:L-1)$
DIVIDE L


See Also
INIT_ LFPEF, PREDICT_ LFPEF, ASPTLBPEF, ASPTLMSLATTICE.

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


next up previous contents
Next: 4 asptlmslattice Up: 5 Lattice Adaptive Algorithms Previous: 2 asptlbpef   Contents