next up previous contents
Next: 10 anvc_ mcfdfxlms Up: 10 Applications and Examples Previous: 8 anvc_ mcadjlms   Contents


9 anvc_ mcfdadjlms

Purpose
Simulation of a Multichannel Active Noise and Vibration Control (ANVC) application using an adaptive controller updated according to the Multi Channel Frequency Domain ADJoint Least Mean Squares (MCFDADJLMS) algorithm.

Syntax
anvc_mcfdadjlms



Description
Figure 10.17: Block diagram of a multichannel noise cancellation application using the Multi Channel Frequency Domain Adjoint LMS algorithm.
The block diagram of the multichannel ANVC problem using MCFDADJLMS is shown in Fig. 10.17. 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 2, with two primary sources, three secondary sources, and two error microphones. The primary and secondary impulse responses are sampled at 8 kHz and truncated to 128 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_mcfdadjlms, and the input signals are read from files, then a processing loop is started. In each iteration of the loop asptmcfdadjlms is called with a new block of reference samples and a new block of primary noise samples 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=0.9\textwidth}


Code
% System transfer functions, Nref=2, Nact=3, Nsens=2.
load .\data\p232_128;                % Primary impulse responses
load .\data\s232_128;                % Secondary impulse responses
sh   = sh232;
ph   = ph232;
se   = 0.9*sh;                       % estimated sh

%% Simulation parameters
[Lph,Nref,Nsens] = size(ph);         % Primary TF dimension
[Lsh,Nact,Nsens] = size(sh);         % Secondary TF dimension
NC  = Lph;                           % length of controller w
NL  = NC;                            % block length
c   = 1;                             % constrain controller
mu  = .01/NC;                        % adaptation constant
b   = 0.99;                          % autoregressive pole

infile  = '.\wavin\mcin232wn.wav';   % x(n), white noise, 2 channels
dfile   = '.\wavin\mcd232wn.wav';    % d(n), Nsens channels
outfile = '.\wavout\mcfdfxlms.wav';  % noise level at microphone

% Initialize MCFDFXLMS algorithm and data files
[NB,W,w,x,y,d,e,p,S,SE,yF,fxF] = init_mcfdfxlms(NC,NL,Nref,...
                                 Nact,Nsens,sh,se);				
inSize           = wavread(infile, 'size'); % input data size
[xn,inFs,inBits] = wavread(infile,NL);      % input properties
dSize            = wavread(dfile, 'size');  % primary data size	
[dn,inFs,dBits]  = wavread(dfile,NL);       % primary properties
inSize           = max(min(inSize,dSize));  % samples to process
E                = init_ipwin(inSize,Nsens);% Initialize IPWIN
out              = zeros(size(dn));         % microphone signal

%% Processing Loop
for (m=1:NL:inSize-NL)
   % read NL samples from input and primary and scale the block
   xn = wavread(infile,[m,m+NL-1]);
   dn = wavread(dfile, [m,m+NL-1]);

   % Call ASPTMCFDFXLMS to calculate the output and update coef.
   [W,w,x,y,e,p,yF,fxF] = asptmcfdfxlms(NC,W,x,xn,dn,...
                          yF,fxF,S,SE,p,mu,b,c);
   out(m:m+NL-1,:) = e;   % save error block

   % update the iteration progress window
   [E, stop,brk]	= update_ipwin(E,e,dn, 'a', w, ph, sh);
   % handle Stop button
   while (stop~=0), stop = getStop; end;   
   % handle Break button
	if (brk), plot_anvc(w,ph,sh,E,2,1); break; end; 
end;

plot_anvc(w,ph,sh,E,2,1);           % performance plots
wavwrite(out(1:m,:),inFs,inBits,outfile); % save mic signal



Results
Figure 10.18: Performance of the MCFDADJLMS algorithm.
Running the above script will produce the graph shown in Fig. 10.18. 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 second reference and first actuator is shown in the graph. You can control which of the $[2 \times 3]$ filters to view by using the last two input arguments of plot_anvc(). The top left and top right panels in Fig. 10.18 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/anvcmcfdadjlms128.eps,width=\textwidth}


Audio Files
The following files demonstrate the performance of the MCFDADJLMS algorithm in the application mentioned above.
wavin232wn.wav Reference (input) signal
wavin232wn.wav microphone signal with controller OFF.
wavout.wav microphone signal with controller ON.

See Also
INIT_ MCFDADJLMS, ASPTMCFDFXLMS, ASPTFDADJLMS, ASPTMCFXLMS.

Reference
[3], Chapter 3 for detailed description of the MCFDFXLMS, [8] for the overlap-save method, and [9] for frequency domain adaptive filters.


next up previous contents
Next: 10 anvc_ mcfdfxlms Up: 10 Applications and Examples Previous: 8 anvc_ mcadjlms   Contents