next up previous contents
Next: 12 beambb_ lclms Up: 10 Applications and Examples Previous: 10 anvc_ mcfdfxlms   Contents


11 anvc_ mcfxlms

Purpose
Simulation of a multichannel Active Noise and Vibration Control (ANVC) application using a matrix of adaptive controllers updated using the MultChannel Filtered-X Least Mean Squares (MCFXLMS) algorithm, also known as the Multiple Error Filtered-X LMS (MEFXLMS).

Syntax
anvc_mcfxlms



Description
Figure 10.21: Block diagram of a multichannel noise cancellation application using the Multichannel Filtered-X LMS algorithm.
The block diagram of a multichannel ANVC problem using MCFXLMS is shown in Fig. 10.21. The matrix of primary impulse responses $p$ is the impulse responses measured between the noise sources and the error microphones in a small room. The matrix of secondary impulse responses $s$ is that between the secondary sources and the error microphones. Two sets of transfer functions are provided in the simulation, the simple data set (system 1) and the measured data set (system 2). The description below applies to system 1, with two primary sources, two secondary sources, and two error microphones. The primary and secondary impulse responses are sampled at 8 kHz and truncated to 32 coefficients. The noise from the noise sources measured at the error microphones is stored in the file dfile and the reference signals $x(n)$ (white noise) is stored in the file infile. First the variables for the controller $w(n)$ are creates and initializes using init_mcfxlms, and the input signals are read from files, then a processing loop is started. In each iteration of the loop asptmcfxlms is called with a new reference vector and a new primary vector to calculate the controllers' outputs (control effort) and update the controllers' coefficients. The sensor signals $e(n)$ are also saved in each iteration for later examination. This simulation script uses the standard ASPT iteration progress window (IPWIN). The IPWIN has four buttons which allow you to stop and continue the simulation, show or hide the simulation graph window, break out of the processing loop, and quit the simulation. After processing all the samples, or on pressing the break or stop buttons, the sensor signal $e(n)$ is written to a wave audio file and a graph presenting the array performance is generated.


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


Code
% System transfer functions, Nref=2, Nact=2, Nsens=2.
load .\data\ph22_32.mat;      % Primary impulse responses
load .\data\sh22_32.mat;      % Secondary impulse responses						
sh   = sh22_32;
ph   = ph22_32;
se   = 0.98 * sh;             %estimated sh22

%% Simulation parameters
[Lph,Nref,Nsens]= size(ph);   % Primary TF dimension
[Lsh,Nact,Ns2]  = size(sh);   % Secondary TF dimension
if (Nsens ~= Ns2), error('Dimension mismatch'); end
L    = Lph;                   % length of controller w
mu   = .1/L;                  % adaptation constant
b    = 0.98;                  % autoregressive pole

% Reference and primary signals
infile   = '.\wavin\mcin22wn.wav';  % x(n), white noise, 2-ch
dfile    = '.\wavin\mcd22wn.wav';   % d(n), 2-ch channels
outfile  = '.\wavout\mcfxlms.wav';  % noise level at microphone

% initialize MCFXLMS
[w,x,y,d,e,p,fx] = init_mcfxlms(L,Nref,Nact,Nsens,sh22,se); 	
inSize           = wavread(infile, 'size'); % get input data size
[xn,inFs,inBits] = wavread(infile);         % get sampling details
dSize            = wavread(dfile, 'size');  % data size	
[dn,inFs,dBits]  = wavread(dfile);          % get sampling details
inSize           = max(min(inSize,dSize));  % Max. samples index
E                = init_ipwin(inSize,Nsens);% Initialize IPWIN
out              = zeros(size(xn));         % sensor signal

%% Processing Loop
for (m=1:inSize)
   x = [xn(m,:);x(1:end-1,:) ];   % update the delay line

   % call MCFXLMS to calculate the output and update the filters
   [w,y,e,p,fx] = asptmcfxlms(w,x,y,sh22,se,dn(m,:),fx,p,mu,b);
   out(m,:) = e(1,:);              % save last error 
 
   % update the iteration progress window
   [E, stop,brk]	= update_ipwin(E,e(1,:),dn(m,:),'a',w,ph22,sh22);
   % handle the Stop button
   while (stop ~= 0), stop 	= getStop; end;
   % handle the Break button				
   if (brk), plot_anvc(w,ph,sh,E,1,1); break; end;	
end;

plot_anvc(w,ph,sh,E,1,1);                 % generate ANVC plot
wavwrite(out(1:m),inFs,inBits,outfile);   % write to audio file



Results
Figure 10.22: Performance of the MCFXLMS algorithm.
Running the above script will produce the graph shown in Fig. 10.22. This figure shows the optimum (Wiener) solution of the problem at hand and compares that with the solution approached by the adaptive controller. Only the controller between the first reference and first actuator is shown in the graph. You can control which of the $[2 \times 2]$ filters to view by using the last two input arguments of plot_anvc(). The top left and top right panels in Fig. 10.22 show the impulse responses of the optimal solution and the adaptive controller, respectively. The middle left and middle right panels show the frequency responses of the optimal solution and the adaptive controller, respectively. The bottom left panel shows the learning curve for the adaptive controller, and the bottom right shows the difference between the optimal solution coefficients and the adaptive controller coefficients.


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


Audio Files
The following files demonstrate the performance of the MCFXLMS algorithm in the application mentioned above.
wavin22wn.wav Reference (input) signals
wavin22wn.wav microphones' signals with controller OFF.
wavout.wav microphones' signals with controller ON.

See Also
INIT_ MCFXLMS, ASPTMCFXLMS, ASPTFXLMS, ASPTFDFXLMS, ASPTMCFDFXLMS.

Reference
[3], Chapter 3.


next up previous contents
Next: 12 beambb_ lclms Up: 10 Applications and Examples Previous: 10 anvc_ mcfdfxlms   Contents