| Purpose |
| Simulation of an Adaptive Line Enhancer (ALE) application using a second order type-1 recursive adaptive filter. |
| Syntax |
ale_soiir1
|
| 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.3. The input signal init_soiir1(), and the input signal is
read from file, then a processing loop is started. In each iteration of the
loop asptsoiir1() is called with a new input sample to calculate the
filter output
|
| Code |
clear all;
infile = '.\wavin\hramp.wav'; % input, speech + sinusoidal
wbfile = '.\wavout\soiir1wb.wav'; % wide-band signal (speech)
nbfile = '.\wavout\soiir1nb.wav'; % narrow-band signal
[xn,inFs,inBits] = wavread(infile); % read input
[L,ch] = size(xn); % get data size
w0 = 0.5; % initial value for w
s0 = 0.3; % initial value for s
w_lim = [-.999 .999]; % bounds for w
s_lim = [.1 .9]; % bounds for s
mu_w = 0.5; % step size for w
mu_s = 0.01; % step size for s
% Create and initialize soiir1 filter
[s,w,u,y,a,b,e] = init_soiir1(s0,w0);
sv = zeros(L,1); % tracking vector for s
wv = sv; % tracking vector for w
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,w,s] = asptsoiir1(u,y,a,b,e,w,s,mu_w,...
mu_s,w_lim,s_lim);
sv(k) = s;
wv(k) = w;
ev(k) = e(1);
yv(k) = y(1);
% update the iteration progress window
h = filter([w*(1-s) -(1-s)],[1 -w*(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([w*(1-s) -(1-s)],[1 -w*(1+s) s],ip);
plot_ale(h,xn,yv,ev);
figure; plot([sv cos(wv)]);grid
ylabel('s [blue], cos(w) [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.4.
The top two panels in Fig. 10.4 show the time and frequency responses
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 SOIIR1 algorithm in the adaptive line enhancer application mentioned above.
|
| See Also |
| INIT_ SOIIR1, ASPTSOIIR1, ASPTSOIIR2, ASPTCSOIIR2. |
| Reference |
| [2] and [10] for introduction to recursive adaptive filters. |