| Purpose |
| Simulation of a single channel Active Noise and Vibration Control (ANVC) application using an adaptive controller updated according to the Frequency Domain Filtered-X Least Mean Squares (FDFXLMS) algorithm. |
| Syntax |
anvc_fdfxlms
|
| Description |
The block diagram of the single channel ANVC problem using FDFXLMS is shown in
Fig. 10.11. The primary impulse response init_fdfxlms(), and the input signals are read from files, then a processing loop
is started. In each iteration of the loop asptfdfxlms() is called with a new
block of reference samples and a new block of primary samples to calculate the a block
of the controller output samples (control effort) and update the controller
coefficients. The calculated block of sensor signal samples
|
| Code |
load .\data\ph11_256; % Primary IR (p11)
load .\data\sh11_256; % Secondary IR (s11)
Lp = length(p11);
se = 0.9*s11; % estimated s11
NC = Lp; % controller length
NL = NC; % block length
c = 1; % constrained filter
mu = .02/NC; % adaptation constant
b = 0.98; % autoregressive pole
infile = '.\wavin\scinwn.wav'; % x(n), white noise
dfile = '.\wavin\scdwn256.wav'; % d(n) = conv(x,p11)
outfile = '.\wavout\fdfxlms.wav'; % microphone output
% Initialize FDFXLMS algorithm and data files
[NB,W,w,x,y,d,e,p,S,SE,yF,fxF] = init_fdfxlms(NC,NL,s11,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); % Initialize IPWIN
out = zeros(size(xn)); % microphone signal
%% Processing Loop
for (m=1:NL:inSize-NL)
% read NL samples from input and primary and scale the block
xn = 2^(inBits-1) * wavread(infile,[m,m+NL-1]);
dn = 2^(inBits-1) * wavread(dfile,[m,m+NL-1]);
% Call ASPTFDFXLMS to calculate the output and update coef.
[W,w,x,y,e,p,yF,fxF] = asptfdfxlms(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, p11, s11);
% handle Stop button
while (stop~=0), stop = getStop; end;
% handle Break button
if (brk), plot_anvc(w,p11,s11,E); break; end;
end;
plot_anvc(w,p11,s11,E); % 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.12.
This figure shows the optimum (Wiener) solution of the problem at hand and compares
that with the solution approached by the adaptive controller. The top left and top
right panels 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 ADJLMS algorithm.
|
| See Also |
| INIT_ FDFXLMS, ASPTFDFXLMS, ASPTMCFDFXLMS, ASPTFXLMS, ASPTMCFXLMS. |
| Reference |
| [3], Chapter 3 for detailed description of the FDFXLMS, [8] for the overlap-save method, and [9] for frequency domain adaptive filters. |