next up previous contents
Next: 9 anvc_ mcfdadjlms Up: 10 Applications and Examples Previous: 7 anvc_ fxlms   Contents


8 anvc_ mcadjlms

Purpose
Simulation of a multichannel Active Noise and Vibration Control (ANVC) application using a matrix of adaptive controllers updated using the Multi-Channel ADJoint Least Mean Squares (MCADJLMS) algorithm.

Syntax
anvc_mcadjlms



Description
Figure 10.15: Block diagram of a multichannel noise cancellation application using the Multichannel Adjoint-LMS algorithm.
The block diagram of a multichannel ANVC problem using MCADJLMS is shown in Fig. 10.15. 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_mcadjlms, and the input signals are read from files, then a processing loop is started. In each iteration of the loop asptmcadjlms 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 controller performance is generated.


\epsfig{file=/home/john/winD/docs/aspt/aspt/figs/mcadjlms2.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\mcin222wn.wav';  % x(n), white noise, 2-ch
dfile   = '.\wavin\mcd222wn.wav';   % d(n), 2-ch channels
outfile = '.\wavout\mcadjlms.wav';  % noise level at microphone

% initialize MCADJLMS 
[w,x,y,d,e,p]    = init_mcadjlms(L,Nref,Nact,Nsens,sh,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 MCADJLMS to calculate the output and update the filters
   [w,y,e,p] = asptmcadjlms(w,x,e,y,sh,se,dn(m,:),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,ph,sh);
   % 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.16: Performance of the MCADJLMS algorithm.
Running the above script will produce the graph shown in Fig. 10.16. 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.16 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/anvcmcadjlms32.eps,width=\textwidth}


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

See Also
INIT_ MCADJLMS, ASPTMCADJLMS, ASPTADJLMS, ASPTFDADJLMS, ASPTMCFDADJLMS.

Reference
[3], Chapter 3.


next up previous contents
Next: 9 anvc_ mcfdadjlms Up: 10 Applications and Examples Previous: 7 anvc_ fxlms   Contents