next up previous contents
Next: 4 anvc_ adjlms Up: 10 Applications and Examples Previous: 2 ale_ soiir1   Contents


3 ale_ soiir2

Purpose
Simulation of an Adaptive Line Enhancer (ALE) application using a second order type-2 recursive adaptive filter.

Syntax
ale_soiir2



Description
Figure 10.5: Block diagram of an adaptive line enhancer implemented using the second order type-2 IIR adaptive filter.
This application demonstrates the capability of the line enhancer to separate a wide-band signal from a narrow-band signal even when the narrow-band signal is time-varying. The block diagram of the adaptive line enhancer problem is shown in Fig. 10.5. The input signal $u(n)$ (a speech fragment contaminated with a sinusoidal noise with time-varying frequency) is stored in the file infile. The application attempts to separate the speech from the sinusoidal noise and stores the former in the file wbfile and the latter in nbfile. First the variables for the adaptive line enhancer filter $h(n)$ are created and initialized using init_soiir2(), and the input signal is read from file, then a processing loop is started. In each iteration of the loop asptsoiir2() is called with a new input sample to calculate the filter output $y(n)$ (estimated narrow-band signal), the error sample $e(n)$ (the wide-band signal) and update the filter parameters $s$ and $t$. The evolution of the adaptive parameters is also tracked 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 graphs, break out of the processing loop, and quit the simulation. After processing all the samples, or on pressing the break or stop buttons, the residual signal $e(n)$ is written to a wave audio file and a graph presenting the performance of the line enhancer is generated.


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


Code
clear all;	
infile = '.\wavin\hramp.wav';     % input, speech + sinusoidal
wbfile = '.\wavout\soiir2wb.wav'; % wide-band signal (speech) 
nbfile = '.\wavout\soiir2nb.wav'; % narrow-band signal 

[xn,inFs,inBits] = wavread(infile); % read input	
[L,ch]           = size(xn);        % get data size

t0    = 0.5;                % initial value for t
s0    = 0.3;                % initial value for s
t_lim = [0.05 3.1];         % bounds for t
s_lim = [.1 .9];            % bounds for s
mu_t  = 0.5;                % step size for t
mu_s  = 0.01;               % step size for s

% Create and initialize soiir2 filter
[s,t,u,y,a,b,e]	= init_soiir2(s0,t0); 

sv = zeros(L,1);            % tracking vector for s
tv = sv;                    % tracking vector for t
yv = sv;                    % filter output
ev = sv;                    % filter output
E  = init_ipwin(L,ch);      % Initialize IPWIN
ip = [1;zeros(511,1)];      % Impulse vector
for k=2:L
   u = [xn(k); u(1:2)];
   [y,a,b,e,t,s] = asptsoiir2(u,y,a,b,e,t,s,mu_t,...
                   mu_s,t_lim,s_lim);
   sv(k) = s;
   tv(k) = t;
   ev(k) = e(1);
   yv(k) = y(1);
      
   % update the iteration progress window
   h = filter([cos(t)*(1-s) -(1-s)],[1 -cos(t)*(1+s) s], ip);
   [E,stop,brk]=update_ipwin(E,e(1),u(1),'l',h, xn,yv,ev);
   
   % handle the Stop button
   while (stop ~= 0), stop = getStop; end;
   
   % handle the Break button		
   if (brk), plot_ale(h,xn,yv,ev); break; end;	

end

h = filter([cos(t)*(1-s) -(1-s)],[1 -cos(t)*(1+s) s],ip);
plot_ale(h,xn,yv,ev);
figure; plot([sv tv]);grid
ylabel('s [blue], t [green]');
xlabel('Time [samples]')
wavwrite(ev,inFs,inBits,wbfile);
wavwrite(yv,inFs,inBits,nbfile);



Results
Figure 10.6: Performance of the second order type-2 IIR adaptive line enhancer.
Running the above script will produce the graph shown in Fig. 10.6. The top two panels in Fig. 10.6 show the time and frequency response of the adaptive IIR filter by the end of the simulation (end of input file). The second panel shows the input signal, the third shows the filter output (estimated narrow band signal), and the bottom panel shows the error signal (the separated wide-band signal).


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


Audio Files
The following files demonstrate the performance of the SOIIR2 algorithm in the adaptive line enhancer application mentioned above.
wavin.wav input signal, speech + sinusoidal noise.
wavout2wb.wav error signal, separated speech.
wavout2nb.wav filter output, narrow-band signal.

See Also
INIT_ SOIIR2, ASPTSOIIR2, ASPTSOIIR1, ASPTCSOIIR2.

Reference
[2] and [10] for introduction to recursive adaptive filters.


next up previous contents
Next: 4 anvc_ adjlms Up: 10 Applications and Examples Previous: 2 ale_ soiir1   Contents