% This example simulates a MIMO control system with a single
% primary (reference) signal, two actuators and two sensors.
iter = 5000; % Number of samples to process
ph = [0 .9 .5 .3 .1 ; 0 .8 .5 .2 .5]';
ph = reshape(ph,5,1,2); % Primary path impulse response
sh = zeros(3,2,2); % Secondary path impulse response
sh(:,1,1) = [0.5;0.4;0.1];
sh(:,2,2) = [0.5;0.4;0.1];
se = 0.95*sh; % estimation of sh
xn = 2*(rand(iter,1)-0.5); % Input signal, zero mean random.
dn = mcmixr(ph,xn,0); % Primary response at the sensor
sens = zeros(iter,2); % matrix for sensors signal
% Initialize MCADJLMS algorithm with a controller of 10 coef.
[w,x,y,d,e,p] = init_mcadjlms(10,1,2,2,sh,se);
%% Processing Loop
for (m=1:iter)
% update the input delay line
x = [xn(m,:); x(1:end-1,:)];
% call asptmcadjlms 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] = asptmcadjlms(w,x,e,y,sh,se,dn(m,:),p,0.02,0.98);
% save the last calculated sensor vector for
%performance examination
sens(m,:) = e(1,:);
end;
% display the sensor signal signal before and after
% applying the controller
subplot(2,2,1); plot([dn(:,1) sens(:,1)]); grid
subplot(2,2,2); plot([dn(:,2) sens(:,2)]); grid
Running the above script will produce the graph shown in Fig. 7.10. In this figure,
the signals recorded by the sensors before and after applying the MIMO control effort,
and , respectively, are shown. The adaptive controller adjusts its coefficients to
produce control signals that result in reducing the primary noise at the
sensors.
|