next up previous contents
Next: 2 aspteqerr Up: 6 Recursive Adaptive Algorithms Previous: 6 Recursive Adaptive Algorithms   Contents


1 asptcsoiir2

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
\begin{displaymath}
H(z) = \frac{(1-s)(cos(t) - z^{-1})}{1 - (1+s) cos(t) z^{-1} + s z^{-2}}.
\end{displaymath} (47)

where the adaptive parameter $s$ controls the filter bandwidth and parameter $t$ controls the filter center frequency.

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 $u(n)$, output delay lines $y(n)$, the two adaptive filter coefficients for each stage from previous iteration $t(n-1)$ and $s(n-1)$, and the previous gradient vectors $a(n-1)$ and $b(n-1)$, and returns the updated filters' output delay lines $y(n)$, the error sample $e(n)$ and the updated filters' parameters $t(n)$ and $s(n)$. The input and output parameters of 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



Figure 6.1: Block diagram of the cascaded second order IIR adaptive line enhancer.


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

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.



Figure 6.2: The adaptive filters frequency responses after convergence and the filter output for the cascaded adaptive line enhancer.


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

Algorithm
asptcsoiir2() performs the following operations
  • Calculates the output of each section $y(n)$ from the previous and current input samples $\vu (n)$ and previous output samples $\vy (n-1)$.
  • Calculates the error sample for each section and updates the input/error vector $u(n)$.
  • Calculates the gradient samples $a(n)$ and $b(n)$ and updates the gradient vectors.
  • Updates the adaptive coefficients $s(n)$ and $t(n)$ and limits their values if necessary.
Remarks
  • Being an IIR filter, the adaptive filter might become unstable during adaptation.
  • Each second order filter $h(n)$ always has a zero dB gain at its center frequency.
  • The filters center frequencies are given by $\omega_c = t$.
  • asptcsoiir2() updates the input vector $u(n)$ internally.



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.


MEMORY $20M$
MULTIPLY $25M$
ADD $16M$
DIVIDE M
COS M
SIN M

See Also
INIT_ CSOIIR2, ALE_ CSOIIR2, ASPTSOIIR2, ASPTSOIIR1.
Reference
[2] and [10] for introduction to recursive adaptive filters.

next up previous contents
Next: 2 aspteqerr Up: 6 Recursive Adaptive Algorithms Previous: 6 Recursive Adaptive Algorithms   Contents