| Purpose |
Performs filtering and parameter update for the Cascaded
band-pass Second Order IIR type-2 adaptive filter.
Each filter has a transfer function given by
|
| Syntax |
[y,a,b,u,t,s,p] = asptcsoiir2(xn,u,y,a,b,
t,s,p,mu_t,mu_s,t_lim,s_lim)
|
| Description |
asptcsoiir2() is a cascade of M SOIIR2 sections with each section tracking one narrow-band signal. Fig. 6.1 shows the block diagram of the CSOIIR2 adaptive line enhancer, where the input of each stage is the error signal of its previous stage. In this arrangement, the first section adapts and tracks the strongest narrow-band component in the system input signal. The error of the first section is therefore free from this component which allows the next stage to converge to the second strongest narrow-band component and so on. The output of the last stage is the wide-band signal and the sum of the sections' outputs is the system output and contains all the estimated narrow-band signals. asptcsoiir2() takes a set of input delay lines asptcsoiir2() are summarized below.
Input arguments [Size]:
xn : new input sample [1 x 1]
u : last 3 input samples for each stage [3 x M+1]
y : last 3 output samples for each stage [3 x M]
a : last 3 t gradients for each stage [3 x M]
b : last 3 s gradients for each stage [3 x M]
t : section center freq. parameter {0 pi} [1 x M]
s : section bandwidth parameter {0 1} [1 x M]
p : estimate of the input signal power [1 x M]
mu_t : adaptation constant for t [1 x M]
mu_s : adaptation constant for s [1 x M]
t_lim : [t_min t_max]; min. & max. bounds for t
s_lim : [s_min s_max]; min. & max. bounds for s
Output Parameters:
y : updated output buffer
a : updated t-gradient buffer
b : updated s-gradient buffer
u : updated input/error buffer
t : updated filter CF parameters
s : updated filter BW parameters
p : updated input power estimate
|
| Example |
iter = 5000;
t = (1:iter)/1000; % time index @ 1kHz
xn = 2*(rand(iter,1)-0.5) ; % Input signal.
xn = xn + 1 * cos(2*pi*50*t') + .5 * cos(2*pi*150*t');
yn = zeros(iter,1); % narrow-band signal
en = yn; % error signal
% Initialize CSOIIR2
M = 2; % No. of harmonics.
s0 = 0.25*ones(1,M); % initial s
t0 = 0.1*ones(1,M); % initial t
mu_s = 0.01*ones(1,M); % s-parameter step size
mu_t = 0.05*ones(1,M); % t-parameter step size
s_lim = [.1 .9]; % bounds for s
t_lim = [0.05 3.1]; % bounds for t
[s,t,u,y,a,b,p]=init_csoiir2(M,s0,t0);
%% Processing Loop
for (m=2:iter)
[y,a,b,u,t,s,p] = asptcsoiir2(xn(m),u,y,a,b,t,s...
,p,mu_t,mu_s,t_lim,s_lim);
yn(m,:) = sum(y(1,:),2); % sections' outputs
en(m) = u(1,M+1); % error of last section
end;
h = [ zeros(1024,M)];
for m = 1:M,
h(:,m) = impz([cos(t(m))*(1-s(m)) -(1-s(m))],...
[1 -cos(t(m))*(1+s(m)) s(m)],1024);
end
% display the results
H = 20*log10(abs(fft(h)));
subplot(2,2,1);plot(H(1:513,:)); grid;
subplot(2,2,2);
plot([yn(4800:5000)]);grid
Running the above script will produce the graph shown in Fig. 6.2. The left
side graph of the figure shows the frequency responses of the two adaptive second order sections after convergence. It is clear that the two sections converge to band pass filters centered at 50 and 150 Hz, the narrow-band components in the input signals. The right side graph shows the last 200 samples of the cascaded filter output which coincides with the two narrow-band components at 50 and 150 Hz superimposed on the white noise input signal.
|
|
| Algorithm |
asptcsoiir2() performs the following operations
|
| Remarks |
|
| Resources |
The resources required to implement the CSOIIR2 recursive adaptive line enhancer composed of cascade of M sections in real time is given in the table below. The computations given are those required to process one sample.
|
| See Also |
| INIT_ CSOIIR2, ALE_ CSOIIR2, ASPTSOIIR2, ASPTSOIIR1. |
| Reference |
| [2] and [10] for introduction to recursive adaptive filters. |