| Purpose |
| Simulation of an Adaptive Line Enhancer (ALE) application using a second order type-2 recursive adaptive filter. |
| Syntax |
ale_soiir2
|
| Description |
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 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
|
| 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 |
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).
|
| Audio Files |
The following files demonstrate the performance of the SOIIR2 algorithm in the adaptive line enhancer application mentioned above.
|
| See Also |
| INIT_ SOIIR2, ASPTSOIIR2, ASPTSOIIR1, ASPTCSOIIR2. |
| Reference |
| [2] and [10] for introduction to recursive adaptive filters. |