| 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 |
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
asptfxlms() which are summarized below.
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 |
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,
|
| Algorithm |
ASPTFXLMS performs the following operations.
|
| Remarks |
|
| Resources |
The resources required to implement the FILTERED-X LMS algorithm in real time is given in the table
below where
|
| See Also |
| INIT_ FXLMS, ANVC_ AFXLMS, ASPTFDFXLMS, ASPTMCFDFXLMS. |
| Reference |
| [3], Chapter 3. |