| Purpose |
| Simulation of an Adaptive Line Enhancer (ALE) application using a cascade of M second order type-2 recursive adaptive filter. |
| Syntax |
ale_csoiir2
|
| Description |
This application demonstrates the capability of the line enhancer to
separate a wide-band signal from multiple narrow-band signals at different
frequencies even when the narrow-band signals are time-varying. The block
diagram of the cascaded adaptive line enhancer is shown in Fig. 10.1.
The input signal init_csoiir2(), and the input
signal is read from file, then a processing loop is started. In each iteration of the
loop asptcsoiir2() is called with a new input sample to calculate the line enhancer output
|
| Code |
clear all;
infile = '.\wavin\hnramp.wav'; % input, speech + sinusoidal
wbfile = '.\wavout\csoiir2wb.wav'; % wide-band signal (speech)
nbfile = '.\wavout\csoiir2nb.wav'; % narrow-band signal (harmonic)
[xn,inFs,inBits] = wavread(infile); % read input
[L,ch] = size(xn); % get data size
M = 3; % No. of harmonics.
s0 = 0.25*ones(1,M); % initial s
t0 = 0.5*ones(1,M); % initial t
mu_s = 0.001*ones(1,M); % s-parameter adaptation constant
mu_t = 0.05*ones(1,M); % t-parameter adaptation constant
s_lim = [.1 .9]; % bounds for s
t_lim = [0.05 3.1]; % bounds for t
sv = zeros(L,M); % tracking vector for s
tv = zeros(L,M); % tracking vector for t
yv = zeros(L,M); % filter output
ev = zeros(L,M); % filter output
% Initialize the csoiir2 filters
[s,t,u,y,a,b,p]=init_csoiir2(M,s0,t0);
for k=2:L
% Call CSOIIR2
[y,a,b,u,t,s,p] = asptcsoiir2(xn(k),u,y,a,b,t,s,p,...
mu_t,mu_s,t_lim,s_lim);
sv(k,:) = s; % save s-state
tv(k,:) = t; % save t-state
ev(k,:) = u(1,2:end); % error signals
yv(k,:) = y(1,:); % narrow-band components
end
% Show tracking behavior
figure
subplot(2,2,1)
plot([tv]);grid
xlabel('Time [samples]')
ylabel('Center freq. [rad.]')
subplot(2,2,2)
plot(sv);grid
xlabel('Time [samples]')
ylabel('s parameter')
% save the narrow-band and wide-band signals
wavwrite(ev(1,M+1),inFs,inBits,wbfile);
wavwrite(sum(yv,2),inFs,inBits,nbfile);
|
| Results |
Running the above script will produce the graph shown in Fig. 10.2.
The left panel in Fig. 10.2 shows the values taken by the
|
| Audio Files |
The following files demonstrate the performance of the CSOIIR2 algorithm in the adaptive line enhancer application mentioned above.
|
| See Also |
| INIT_ CSOIIR2, ASPTCSOIIR2, ASPTSOIIR1, ASPTSOIIR2. |
| Reference |
| [2] and [10] for introduction to recursive adaptive filters. |