next up previous contents
Next: 6 asptsoiir2 Up: 6 Recursive Adaptive Algorithms Previous: 4 asptsharf   Contents


5 asptsoiir1

Purpose
Performs filtering and parameter update for the band-pass Second Order IIR type-1 adaptive filter. The filter transfer function is given by
\begin{displaymath}
H(z) = \frac{(1-s)(w - z^{-1})}{1 - (1+s) w z^{-1} + s z^{-2}}.
\end{displaymath} (61)

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

Syntax
[y,a,b,e,w,s] = asptsoiir1(u,y,a,b,e,w,s,mu_w,mu_s,w_lim,s_lim)

Description
asptsoiir1() is a special second order IIR adaptive filter algorithm optimized for extracting and tracking narrow-band signals buried in a wide-band signal. Therefore, it is widely used in applications such as Adaptive Line Enhancers (ALE) where a weak carrier signal is required to be recovered from a strong wide-band noise. Another common application of asptsoiir1() is removing the 50/60 Hz power line noise usually introduced into weak sensor signals. Fig. 6.9 shows the block diagram of the applications mentioned above which is basically an IIR forward prediction configuration. asptsoiir1() takes an input delay line $u(n)$, an output delay line $y(n)$, the two adaptive filter coefficients from previous iteration $w(n-1)$ and $s(n-1)$, and the previous gradient vectors $a(n-1)$ and $b(n-1)$, and returns the updated filter output delay line $y(n)$, the error sample $e(n)$ and the updated filter parameters $w(n)$ and $s(n)$. The input and output parameters of asptsoiir1() are summarized below.
Input arguments [Size]:
  u     : the last 3 input samples [3 x 1]
  y     : the last 3 output samples [3 x 1]
  a     : the last 3 w gradients [3 x 1]
  b     : the last 3 s gradients [3 x 1]
  e     : the last 3 error samples [3 x 1]
  w     : filter center freq. parameter {-1 1} [1 x 1]
  s     : filter bandwidth parameter {0 1} [1 x 1]
  mu_w  : adaptation constant for w [1x1]
  mu_s  : adaptation constant for s [1x1]
  w_lim : [w_min w_max]; min. & max. bounds for w 
  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 
  e     : updated error buffer 
  s     : updated filter BW parameters 
  w     : updated filter CF parameters



Figure 6.9: Block diagram of the second order IIR algorithm in an adaptive line enhancer configuration.


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

Example
iter = 5000;
t    = (1:iter)/1000;           % time index @ 1kHz
xn   = 2*(rand(iter,1)-0.5)  ;  % Input signal, zero mean random.
xn   = xn + .5 * cos(2*pi*50*t');
yn   = zeros(iter,1);           % error signal
en   = yn;

% Initialize SOIIR1 
w_lim  = [-.99 0.99];           % bounds for w
s_lim  = [0.1 .9];              % bounds for s
mu_w   = 0.1;                   % step size for w
mu_s   = 0.01;                  % step size for s
[s,w,u,y,a,b,e]	= init_soiir1(0.3,0.1);	% initialize soiir1

%% Processing Loop
for (m=1:iter)
	u = [xn(m); 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);
   yn(m,:) = y(1);  
   en(m) = e(1);
end;
% display the results
h = filter([w*(1-s) -(1-s)],[1 -w*(1+s) s],[1;zeros(255,1)]);
f = (0:128)*500/128;
H = 20*log10(abs(fft(h)));
subplot(2,2,1);plot(f,H(1:129)); grid;
subplot(2,2,2);
plot([yn(4800:5000)]);grid
Running the above script will produce the graph shown in Fig. 6.10. The left side graph of the figure shows the adaptive filter frequency response after convergence. The right side graph shows the last 200 samples of the filter output which shows that the filter output coincide with the narrow-band 50 Hz superimposed on the white noise input signal.



Figure 6.10: The adaptive filter frequency response after convergence and the filter output for the adaptive line enhancer problem using the second order IIR type-1 algorithm.


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

Algorithm
asptsoiir1() performs the following operations
  • Calculates the filter output $y(n)$ from the previous and current input samples $\vu (n)$ and previous output samples $\vy (n-1)$.
  • Calculates the error sample $e(n) = d(n) - y(n)$ and updates the error vector.
  • Calculates the gradient samples $a(n)$ and $b(n)$ and updates the gradient vectors.
  • Updates the adaptive coefficients $s(n)$ and $w(n)$ and limits their values if necessary.
Remarks
  • Being an IIR filter, the adaptive filter might become unstable during adaptation.
  • The second order filter $h(n)$ always has a zero dB gain at its center frequency.
  • The filter center frequency is given by $\omega_c = cos^{-1} w$.
  • asptsoiir1() suffers from slow convergence when the center frequency of the narrow-band signal is close to zero or close to $\pi$. This problem is solved in asptsoiir2().
  • The configuration in Fig. 6.9 will function as a notch filter at $\omega_c$ when the error signal is taken as output. This will remove the narrow-band signal from the input signal.
  • asptsoiir1() does not update the input vector internally. This has to be done before calling asptsoiir1() as shown in the example above.



Resources
The resources required to implement the SOIIR1 recursive adaptive filter in real time is given in the table below. The computations given are those required to process one sample.


MEMORY $20$
MULTIPLY $24$
ADD $16$
DIVIDE 1

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

next up previous contents
Next: 6 asptsoiir2 Up: 6 Recursive Adaptive Algorithms Previous: 4 asptsharf   Contents