next up previous contents
Next: 5 asptmcadjlms Up: 7 Active Noise and Previous: 3 asptfdfxlms   Contents


4 asptfxlms

Purpose
Sample per sample filtering and coefficient update using the Filtered-x LMS (FXLMS) algorithm for single channel active noise and vibration control applications.

Syntax
[w,y,e,p,fx] = asptfxlms(w,x,y,s,se,d,fx,p,mu,b)



Description
Figure 7.7: Block diagram of the Filtered-x LMS algorithm.
asptfxlms() implements the FILTERED-X LMS algorithm widely used in control applications where a transfer function (the secondary path, s) exists between the filter output and the error signal (see Fig. 7.7). The consequence of this transfer function is that (1) its phase response delays the filter output and makes it observable from the error signal after a delay, (2) the filter output is colored by the amplitude response of the secondary path s. To correct for those effects, the FILTERED-X LMS algorithm uses a filtered version of the input signal $fx(n)$ to update the adaptive filter instead of directly using the input signal $x(n)$ as shown in Fig. 7.7. This figure also shows the input and output parameters of asptfxlms() which are summarized below.


\epsfig{file=/home/john/winD/docs/aspt/aspt/figs/fxlms.eps,width=.8\textwidth}
Input Parameters :: 
    w  : vector of filter coefficients w(n-1) [L x 1]
    x  : vector of input samples 
    y  : vector of filter output y(n-1) [M x 1]
    s  : accurate FIR model of the secondary path [M x 1]
    se : estimated FIR model of the secondary path [N x 1]
    d  : desired response at sample index n [1 x 1]
    fx : vector of filtered input signal fx(n-1) [N x 1]
    p  : last estimated power of x(n) [1 x 1]
    mu : adaptation constant [1 x 1]
    b  : pole of Autoregressive filter used in estimating p 

Output parameters ::
    w  : updated filter coefficients w(n)
    y  : filter output vector [y(n) y(n-1) .. y(n-M-1)]
    e  : error sample e(n) = d(n) - ys(n)
    p  : updated estimate of input vector power
    fx : updated vector of filtered-x samples fx(n)



Example
Figure 7.8: Sensor signal before and after applying the adaptive controller in a single channel ANVC system using the filtered-x LMS algorithm.
iter = 5000;                  % Number of samples to process
ph   = [0;.9;.5;.3;.1];       % Primary path impulse response
sh   = [0.5;0.4;0.1];         % Secondary path impulse response
se   = 0.95*sh;               % estimation of s
xn   = 2*(rand(iter,1)-0.5);  % Input signal, zero mean random.
dn   = osfilter(ph,xn);       % Primary response at the sensor 
sens = zeros(iter,1);         % vector to collect the sensor signal

% Initialize Filtered-x algorithm with a controller of 10 coef.
[w,x,y,d,e,p,fx] 	= init_fxlms(10,sh,se); 

%% Processing Loop
for (m=1:iter)
   % update the input delay line
   x = [xn(m,:); x(1:end-1,:)];        
   
   % call asptfxlms to calculate the controller output 
   % and update the coefficients. Below a step size of 
   % 0.02 and an AR pole of 0.98 are used.
   [w,y,e,p,fx] 	= asptfxlms(w,x,y,sh,se,dn(m),fx,p, 0.02, 0.98);
   
   % save the last calculated sensor sample for 
   %performance examination
   sens(m) = e(1);  
end;

% display the sensor signal signal before and after 
% applying the controller
plot([dn sens]);
Running the above script will produce the graph shown in Fig. 7.8. In this figure, the sensor signal with and without control, $sens$ and $dn$, respectively, are shown. The sensor signal before applying the controller $dn$ results from filtering the random variable $xn$ of zero mean and variance 1 through the primary path $ph$. The adaptive controller adjusts its coefficients to produce a control signal $y(n)$ to drive the secondary actuator that results in reducing the primary noise at the sensor.


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

Algorithm
ASPTFXLMS performs the following operations.
  • filters the input vector $x(n)$ through the adaptive filter coefficients vector $w(n-1)$ to produce the filter output vector $y(n)$
  • filters $y(n)$ through the secondary path filter $s$ to produce the secondary actuator response at the sensor $ys(n)$
  • evaluates the current error sample $e(n) = d(n) + ys(n)$. Note the error here is formed by adding the signal rather than subtracting them to be compatible with real world sensors such as microphones and accelerometers
  • filters the input signal $x(n)$ through the estimate of the secondary path $se$ to produce the filtered-x signal $fx(n)$
  • uses $fx(n)$ and $e(n)$ to calculate the normalized gradient vector and uses this to update the adaptive filter coefficients $w(n)$

Remarks
  • Supports both real and complex signals
  • The Wiener solution to the above problem is given by $W(\omega) = S(\omega)^{-1} P(\omega)$, where $W(\omega)$ is the controller response at frequency $\omega$, $S(\omega)$ is the response of the secondary path and $P(\omega)$ is the response of the primary path at the same frequency. The adaptive controller will asymptotically approach this Wiener solution provided that $S(\omega)$ is a minimum phase function (does not have zeros outside the unit circle) and the controller length is large enough to accommodate the above convolution. If $S(\omega)$ is not a minimum phase function, the adaptive controller will approach the causal part of the solution. If the controller is too short, the solution will be truncated. In both cases, the noise reduction at the sensor is decreased.
  • The adaptive controller will approach the Wiener solution provided that the delay in the primary path is larger than that in the secondary path. This can be quickly checked by using $ph = [.9;.5;.3;.1]$ and $sh = [0;0.5;0.4;0.1]$ in the above example.
  • The performance, memory requirements, and processing load of the FILTERED-X LMS algorithm are similar to the ADJOINT LMS algorithms for single channel systems. The ADJOINT LMS is much more efficient, however, in multi-channel applications.



Resources
The resources required to implement the FILTERED-X LMS algorithm in real time is given in the table below where $L$ is the controller length and $N$ is the estimated secondary path length. The computations given are those required to process one sample.


MEMORY $2L + 2N + 5 $
MULTIPLY $2L + N + 4 $
ADD $2L + N$
DIVIDE $1$

See Also
INIT_ FXLMS, ANVC_ AFXLMS, ASPTFDFXLMS, ASPTMCFDFXLMS.

Reference
[3], Chapter 3.

next up previous contents
Next: 5 asptmcadjlms Up: 7 Active Noise and Previous: 3 asptfdfxlms   Contents