next up previous contents
Next: 6 anvc_ fdfxlms Up: 10 Applications and Examples Previous: 4 anvc_ adjlms   Contents


5 anvc_ fdadjlms

Purpose
Simulation of a single channel Active Noise and Vibration Control (ANVC) application using an adaptive controller updated according to the Frequency Domain ADJOINT Least Mean Squares (FDADJLMS) algorithm.

Syntax
anvc_fdadjlms



Description
Figure 10.9: Block diagram of a single channel noise cancellation application using the Frequency Domain ADJoint-LMS algorithm.
The block diagram of the single channel ANVC problem using FDADJLMS is shown in Fig. 10.9. The primary impulse response $p$ is the impulse response measured between the noise source and the error microphone in a small room. The secondary impulse response $s$ is that between the secondary source and the error microphone. 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 impulse responses sampled at 8 kHz and truncated to 256 coefficients. The primary noise at the microphone is stored in the file dfile and the reference signal $x(n)$ (white noise) is stored in the file infile. First the variables for the controller $w(n)$ are creates and initializes using init_fdadjlms(), and the input signals are read from files, then a processing loop is started. In each iteration of the loop asptfdadjlms() 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 $e(n)$ is 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/adjlms2.eps,width=\textwidth}


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\fdadjlms.wav'; % microphone output

% Initialize FDADJLMS algorithm and data files
[NB,W,w,x,y,d,e,p,S,SE,yF,feF] = init_fdadjlms(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 ASPTFDADJLMS to calculate the output and update coef.
   [W,w,x,y,e,p,yF,feF] = asptfdadjlms(NC,W,x,xn,dn,...
                          yF,feF,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
Figure 10.10: Performance of the FDADJLMS algorithm.
Running the above script will produce the graph shown in Fig. 10.10. 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.


\epsfig{file=/home/john/winD/docs/aspt/aspt/figs/anvcfdadj.eps,width=\textwidth}


Audio Files
The following files demonstrate the performance of the ADJLMS algorithm.
wavin.wav Reference (input) signal
wavin256.wav microphone signal with controller OFF.
wavout.wav microphone signal with controller ON.

See Also
INIT_ FDADJLMS, ASPTFDADJLMS, ASPTMCFDADJLMS, ASPTADJLMS, ASPTMCADJLMS.

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


next up previous contents
Next: 6 anvc_ fdfxlms Up: 10 Applications and Examples Previous: 4 anvc_ adjlms   Contents