• No results found

2.5 Adaptive Algorithms for the Estimation of the Parameters

2.5.1 Recursive Prediction Error Algorithm

The recursive prediction error (RPE) algorithm updates the parameters of the vector H according to the process of minimum square error MSE, n¼ E e 2oð Þk

, where eo is the output error. Since in general n is an unknown variable, the algorithm is designed to minimize in each iteration the estimated actual value of n, expressed as f¼ e2oð Þ, and the consequence of such approximation is a relativelyk noisy estimation of the filter parameters.

Table 2.3 Flow diagram of EE-WRLS algorithm 1. Initialization

• ^Hð0Þ ¼ 0; R1ð0Þ ¼ r2I; r2 1

• Generate the sample of the input signal x(0) and the reference signal y(0)

• Initial error of Eq. eeð0Þ ¼ yð0Þ

• Read in the forgetting factor 0:9  q  0:99; a ¼ 1  q

2. In each discrete moment of time k¼ 1; 2; . . .; assuming that ^Hðk  1Þ; eeðk  1Þ, R1ðk  1Þ and XeðkÞ are known, calculate:

• Gain matrix

R1ð Þ ¼k 1q R1ðk 1Þ R1ðk 1ÞXeðk 1ÞXTeðk 1ÞR1ðk 1Þ q

aþ XTeðk 1ÞR1ðk 1ÞXeðk 1Þ

!

• Filter coefficients

H k^ð Þ ¼ ^H kð  1Þ þ aR1ð ÞXk eðk 1Þeeðk 1Þ

• Update data vector

XeðkÞ ¼ xðkÞ xðk  1Þ . . . xðk  MÞ yðk  1Þ yðk  2Þ . . . yðk  NÞ½ T where xðiÞ ¼ yðiÞ ¼ 0 for i\0(causal system)

• Calculate error of the Eq. eeðkÞ ¼ yðkÞ  XTeðkÞ ^HðkÞ

3. Increment iteration counter k by 1 and repeat the procedure from the step 2

The proposed RPE algorithm updates the parameters of H kð Þ in the negative direction of the gradient of the criterion function f kð Þ. Taking into account (2.102), the gradient of the criterion function

fðkÞ¼1 The last term in (2.127) stems from the definition of the error of the output of OE and the fact that the reference signal y kð Þ is independent on the values of the parameters of H kð Þ.

Since according to (2.105),

ryoð Þ ¼ r Hk  Tð ÞXk oð Þk 

;

and Xoð Þ in (2.106) also contains previous values of the output, yk 0ðk  iÞ, which are a function of the previous estimations of the parameter parameter: vector H kð Þ, an obvious dependence between Xoð Þ and H kk ð Þ follows from it. According to the expression (2.103), one may write

If sufficiently small value is taken for the coefficient a in (2.119), which influences the convergence speed, so that the adaptation is sufficiently slow, one can then introduce the following approximation

H kð Þ H k  1ð Þ    H k  N þ 1ð Þ; ð2:130Þ i.e. one may neglect the mentioned dependence. This is acceptable in the majority of cases, especially if N is low, so that one may write

oyoð Þk

oyoð Þk

objð Þk ¼ x k  jð Þ þXN

i¼1

aið Þk oyoðk iÞ

objð Þk ¼ 1 1 A k; zð 1Þ

 

x kð  jÞ; ð2:132Þ where the polynomial A k; zð 1Þ is defined by (2.97). While deriving relations (2.131) and (2.132) the operator of unit delay z1 was introduced, so that oyoðk 1Þ

oajð Þk ¼ z1oyoð Þk

oajð Þk andoyoboðk1Þ

jð Þk ¼ z1 oyoboð Þk

jð Þk. It follows that in the general form of the algorithm (2.119)–(2.122)

F k; zð Þ ¼ 1

1 Aðk; z1Þ; G k; z 1

¼ 1: ð2:133Þ

Now it is possible to write the complete RPE algorithm H k^ð þ 1Þ ¼ ^H kð Þ þ aR1ðkþ 1Þ 1

1 A k; zð 1Þ

 

Xoð Þek oð Þ;k ð2:134Þ where Xoð Þ is defined by the expression (2.106), ek oð Þ by (2.102) and (2.105), andk R kð Þ by the expression (2.124), while the polynomial A(k) is given by the expression (2.97).

Relation (2.134) can be written in an alternative form

H k^ð þ 1Þ ¼ ^H kð Þ þ aR1ðkþ 1ÞXofð Þek oð Þ;k ð2:135Þ where

Xofð Þ ¼k 1

1 A k; zð 1ÞXoð Þ ¼ F k; zk  1

Xoð Þk ð2:136Þ is the filter vector Xoð Þ of input–output data.k

Starting from the definition (2.97) for the polynomial A k; zð 1Þ, the coefficient of the polynomial

Fðk; z1Þ ¼ 1 þXN

i¼1

fiðkÞzi ð2:137Þ

in (2.121) nð ¼ NÞ can be determined according to the relation [8]

fiðkÞ ¼Xi

j¼1

ajðkÞfijðkÞ; i ¼ 1; 2; . . .; N; f0¼ 1: ð2:138Þ

In this way, the vector of filtered input–output data is defined by the expression XTofð Þ ¼ xk fðkÞ; xfðk  1Þ; . . .; xfðk  MÞ; yfðk  1Þ; yfðk  2Þ; . . .; yfðk  NÞ

; ð2:139Þ

where

xfðjÞ ¼ F k; z 1

xðjÞ ¼ xðjÞ þXN

i¼1

fiðkÞxðj  iÞ; j ¼ k; k  1; . . .; k  M;

ð2:140Þ

yfðjÞ ¼ F k; z 1

yoðjÞ ¼ yoðjÞ þXN

i¼1

fiðkÞyoðj  iÞ; j ¼ k  1; . . .; k  N:

ð2:141Þ Introducing the parameter vector

fTðkÞ ¼ ff1ðkÞ; f2ðkÞ; . . .; fNðkÞg ð2:142Þ and the vectors of input–output data

XTð Þ ¼ xðj  1Þ; xðj  2Þ; . . .; xðj  NÞj f g; j ¼ k; k  1; . . .; k  M;

ð2:143Þ YToð Þ ¼ yj f oðj  1Þ; yoðj  2Þ; . . .; yoðj  NÞg; j ¼ k  1; k  2; . . .; k  N;

ð2:144Þ the relations (2.140) and (2.141) can be written in the vectorial form

xfðjÞ ¼ xðjÞ þ XTðjÞf ðkÞ; j ¼ k; k  1; . . .; k  M; ð2:145Þ yfðjÞ ¼ yoðjÞ þ YToðjÞf ðkÞ; j ¼ k  1; k  2; . . .; k  N: ð2:146Þ If the estimations of parameters are close to their optimum values, the proce-dure can be simplified by filtering only the last input and output data instead of the whole sequence in (2.145) and (2.146), respectively.

The main disadvantage of the RPE algorithm is that the filter poles, also used to calculate the derivatives (2.131) and (2.132), may be located outside the unit circle in the complex z-plane, which implies the appearance of instability. If the poles remain longer in this region during the adaptation process, a possibility occurs that the algorithm will diverge. There is a possibility that the poles appear outside the unit circle, especially because of the noisy estimation of the gradient, since the approximation f kð Þ is used instead of the gradient n kð Þ. In order to avoid this, it is necessary to permanently monitor the system stability. One of the simplest tests to check stability is to inspect if P

i

ai

j j\1 in each iteration. However, there are cases, especially for large value of N, that this criterion is not satisfactory. On the other hand, there are tests to establish system instability with certainty, but computationally they are very complex [3].

In a majority of cases when the test shows that new parameters lead to instability, most often they are simply neglected, i.e. one takes that ^Hðk þ 1Þ ¼ ^HðkÞ. Naturally, this degrades the properties of the algorithm and makes the algorithm a non-robust one, since it may remain in that state for an indeterminate period of time. If the poles are located within the unit circle, the filter will be stable only if it represents a linear and time-invariant system. For the systems variable in time, such as the adaptive IIR filters, it is not sufficient only to follow the position of poles in discrete time intervals in order to have the realized system efficient in practical situations.

A block diagram of the RPE algorithm is given in Table2.4.

Table 2.4 Flow diagram of RPE algorithm 1. Initialization

• ^Hð0Þ ¼ 0; R1ð0Þ ¼ r2I; r2 1

Generation of the sample of the input signal x(0) and the reference signal y(0)

Initial output error eoð0Þ ¼ yð0Þ  yoð0Þ; yoð0Þ ¼ 0

Read in the forgetting factor 0:9 q  0:99

Calculation of the convergence factor a¼ 1  q

Forming of the initial vector of filtered data Xofð0Þ ¼ 0

2. Assuming that ^Hðk  1Þ; eoðk  1Þ, R1ðk  1Þ and Xofðk  1Þ are known, in each discrete moment of time k¼ 1; 2; . . .; calculate:

Gain matrix

R1ð Þ ¼k 1q R1ðk 1Þ R

1ðk1ÞXofðk1ÞXTofðk1ÞR1ðk1Þ q=aþXTofðk1ÞR1ðk1ÞXofðk1Þ

 

Filter coefficients

H k^ð Þ ¼ ^H kð  1Þ þ aR1ð ÞXk ofðk 1Þeoðk 1Þ

Update data vector

XToðkÞ ¼ xðkÞ xðk  1Þ . . . xðk  MÞ y½ oðk  1Þ yoðk  2Þ . . . yoðk  NÞTwhere xðiÞ ¼ yðiÞ ¼ 0 for i\0(causal system)

Calculate output error

eoðkÞ ¼ yðkÞ  XToðkÞ ^HðkÞ ¼ yðkÞ  yoðkÞ

Calculate coefficients of the filter that filters XoðkÞ fiðkÞ ¼PN

j¼1

H^Mþ1þjðkÞfijðkÞ; f0ðkÞ ¼ 1; i ¼ 1; . . .; N

Form the vector of coefficients fTðkÞ ¼ f½1ðkÞ f2ðkÞ . . . fNðkÞ Filter input and output data xfðkÞ ¼ xðkÞ þ XTðkÞf ðkÞ, where

XTðkÞ ¼ xðk  1Þ . . . xðk  NÞ½ ; xðiÞ ¼ 0 for i\0 yfðk  1Þ ¼ yoðk  1Þ þ YToðkÞf ðkÞ, where

YT0ðkÞ ¼ y½ 0ðk  2Þ . . . y0ðk  1  NÞ; y0ðiÞ ¼ 0 for i\0 Forming of the vector of filtered data

XTofðkÞ ¼ x fðkÞ xfðk  1Þ . . . xfðk  MÞ yfðk  1Þ yfðk  2Þ . . . yfðk  NÞT

where xfðiÞ ¼ yfðiÞ ¼ 0 for i  0

3. Increment iteration counter k by 1 and repeat the procedure from the step 2