next up previous contents
Next: 19 asptvffrls Up: 4 Transversal and Linear Previous: 17 aspttdftaf   Contents


18 aspttdlms

Purpose
Sample per sample filtering and coefficient update using the Transform Domain LMS algorithm. Filtering and coefficient update are performed in T-domain.

Syntax
[W,w,y,e,p] = aspttdlms(x,W,d,mu,p,b,T)



Description
aspttdlms() implements the Transform Domain LMS adaptive algorithm used to update transversal adaptive filters. TDLMS performs filtering and coefficient update in the transform domain, T. Normalization of the step size by the input signal power is also performed in T-domain in each band, which is usually improves the convergence behavior compared to the conventional LMS when T is an orthogonal transformation. The block diagram of the TDLMS is shown in Fig. 4.20. aspttdlms() takes an input samples delay line $\vx (n)$ and applies the transformation T on this vector. This T-domain data vector is filtered through the vector of T-domain adaptive filter coefficients from previous iteration $\vW (n-1)$ to produce the time-domain filter output $y(n)$. The error $e(n) = d(n) - y(n)$ is then calculated and the power of the input vector is estimated in the T-domain at each band and used to normalize the step size. The update equation used by aspttdlms() to update each T-domain coefficient is given by
\begin{displaymath}
W_i(n) = W_i(n-1) + \frac{\mu} {P_i(n)} e(n) X_i(n); \;\; i=0,1,\cdots,L-1.
\end{displaymath} (40)

Where $W_i(n)$, $X_i(n)$, and $P_i(n)$ are the filter coefficient, input signal, and input signal power in band $i$ at time index $n$, respectively. The input and output parameters of aspttdlms() for an FIR adaptive filter of $L$ coefficients are summarized below.
Input Parameters [Size]:: 
   x   : input samples delay line [L x 1]
   W   : previous T-domain coef. vector W(n-1) [L x 1]
   d   : desired output d(n) [1 x 1]
   mu  : adaptation constant
   p   : last estimated power of x, p(n-1) [L x 1]
   b   : AR pole for recursive calculation of p
   T   : The transform to be used {fft|dct|dst|...}
         user defined transforms are also supported.
         use transform T and its inverse iT. 
Output parameters::
   W   : updated T-domain coef. vector
   y   : filter output y(n)
   e   : error signal; e(n) = d(n)-y(n)
   p   : new estimated power of x, p(n)
   w   : updated time-domain coef. vector w(n), only 
         calculated if this output argument is given.



Figure 4.20: Block diagram of the Transform Domain LMS algorithm.


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

Example
% TDLMS used in a simple system identification application.
% By the end of this script the adaptive filter w should
% have the same coefficients as the unknown filter h.
%
iter = 5000;                  % Number of samples to process
% Complex unknown impulse response
h    = [.9 + i*.4; 0.7+ i*.2; .5; .3+i*.1; .1];     
xn   = 2*(rand(iter,1)-0.5);  % Input signal, zero mean random.
% although xn is real, dn will be complex since h is complex
dn   = osfilter(h,xn);        % Unknown filter output 
en   = zeros(iter,1);         % vector to collect the error
% Initialize the TDLMS algorithm with a filter of 10 coef.
[W,w,x,d,y,e,p]=init_tdlms(10); 

%% Processing Loop
for (m=1:iter)   
   x = [xn(m); x(1:end-1)];  % update the input delay line
   d = dn(m,:) + 1e-3*rand;  % additive noise of var = 1e-6   
   % call TDLMS to calculate the output, estimation error
   % and update the coefficients. 
   [W,y,e,p,w] = aspttdlms(x,W,d,0.05,p,0.98,'fft');
   % save the last error sample to plot later
   en(m) = e;  
end;

% display the results
% note that w converges to conj(h) for complex data
subplot(2,2,1);stem([real(w) imag(conj(w))]); grid;
subplot(2,2,2);eb = filter(.1, [1 -.9], en .* conj(en));
plot(10*log10(eb  ));grid



Figure 4.21: The adaptive filter coefficients after convergence and the learning curve for the complex FIR system identification problem using the TDLMS algorithm.
Running the above script will produce the graph shown in Fig. 4.21. The left side graph of the figure shows the adaptive filter coefficients after convergence which are almost identical to the unknown filter h. The right side graph shows the square error in dB versus time during the adaptation process, which is usually called the learning curve. The lower limit of the error signal power in the learning curve is defined here by the additive white noise added at the filter output (-60 dB).


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


Remarks
The TDLMS algorithm solves the eigenvalue spread problem by first decorrelating the input signal samples using the transformation T and then normalizing the transformed data by its power in each band. This is equivalent to using a time varying step size in each band, the value of which is inversely proportional to the power of the input in this band. This will speed the convergence of the slow modes (those excited with relatively small input power) and improves the total convergence behavior of the adaptive filter. Note also that
  • aspttdlms() supports both real and complex data and filters. The adaptive filter for the complex TDLMS algorithm converges to the complex conjugate of the optimum solution.
  • aspttdlms() does not update the input delay line for $x(n)$, this has been chosen to provide more flexibility, so that the same function can be used with transversal as well as linear combiner structures. Delay line update, by inserting the newest sample at the beginning of the buffer and shifting the rest of the samples to the right, has to be done before calling aspttdlms() as in the example above.
  • aspttdlms() not only supports standard transformations such as FFT, DCT, and DST, but also user-defined transformations. To use this feature, provide your transformation in two separate functions, one for the forward and the other for the backward transformation. For example if you implement a forward transformation in the file xyz.m you should implement its inverse transformation in the file ixyz.m and call aspttdlms with parameter T='xyz'. Care should be taken in scaling the transformation coefficients to ensure that the time-domain filter coefficients have the correct values.
  • The TDLMS is equivalent to an efficient implementation for the LMS-Newton algorithm when T is given by the Karhunen Loéve Transformation (KLT).

Algorithm
aspttdlms() performs the following operations
  • Calculates the transformation of the $\vx (n)$ and filters this through the filter coefficient vector $\vW (n-1)$ to produce the filter output $y(n)$.
  • Calculates the error sample $e(n) = d(n) - y(n)$ and the input power vector $\vP (n)$
  • Calculates the updated T-domain adaptive coefficients $\vW (n)$ and their inverse transformation $\vw (n)$ if required.



Resources
The resources required to implement the TDLMS algorithm for a transversal adaptive FIR filter of $L$ coefficients in real time is given in the table below. The computations given are those required to process one sample. The complexity of the transformation T is indicated as $C(T)$ in the table below.


MEMORY $4L + 4$
MULTIPLY $6L + C(T)$
ADD $4L+C(T)$
DIVIDE $L + C(T)$


See Also
INIT_ TDLMS, MODEL_ TDLMS, ASPTLMS, ASPTNLMS, ASPTVSSLMS.

Reference
[11], [4], and [2] for extensive analysis of the LMS and the steepest-descent search method.


next up previous contents
Next: 19 asptvffrls Up: 4 Transversal and Linear Previous: 17 aspttdftaf   Contents