| 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 |
The block diagram of a multichannel ANVC problem using MCADJLMS is shown in
Fig. 10.15. The matrix of primary impulse responses 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
|
| 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 |
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 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.
|
| Audio Files |
The following files demonstrate the performance of the MCADJLMS algorithm in
the application mentioned above.
|
| See Also |
| INIT_ MCADJLMS, ASPTMCADJLMS, ASPTADJLMS, ASPTFDADJLMS, ASPTMCFDADJLMS. |
| Reference |
| [3], Chapter 3. |