| Purpose |
| Simulation of a multichannel Active Noise and Vibration Control (ANVC) application using an adaptive controller updated according to the Multi Channel Frequency Domain Filtered-X Least Mean Squares (MCFDFXLMS) algorithm. |
| Syntax |
anvc_mcfdfxlms
|
| Description |
The block diagram of the multichannel ANVC problem using MCFDFXLMS is shown in
Fig. 10.19. The matrix of primary impulse responses init_mcfdfxlms,
and the input signals are read from files, then a processing loop is started.
In each iteration of the loop asptmcfdfxlms 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
|
| 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 ASPTFDFXLMS 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,:) = 2^-(dBits-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,1,2); break; end;
end;
plot_anvc(w,ph,sh,E,2,2); % performance plots
wavwrite(out(1:m,:),inFs,inBits,outfile); % save mic signal
|
| Results |
Running the above script will produce the graph shown in Fig. 10.20.
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 plot_anvc(). The top left and top right panels in Fig. 10.20
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 MCFDFXLMS algorithm in the
application mentioned above.
|
| See Also |
| INIT_ MCFDFXLMS, ASPTMCFDFXLMS, ASPTFDFXLMS, ASPTFXLMS, ASPTMCFXLMS. |
| Reference |
| [3], Chapter 3 for detailed description of the MCFDFXLMS, [8] for the overlap-save method, and [9] for frequency domain adaptive filters. |