FIR FILTER DESIGN BASED ON TOTAL LEAST SQUARES ERROR CRITERION
Soo-Chang
Pei'
Chien-Cheng Tseng2'Department of Electrical Engineering, National Taiwan University, Taipei, Taiwan, R. 0. C.
2Department of Computer and Communication Engineering, National Kaohsiung First University of Technology and Science, Kaohsiung, Taiwan, R.O.C.
ABSTRACT
In this paper, an FIR filter design based on total least squares error criterion is investigated. The filter coefficients are obtained from the elements of the eigenvector corre- sponding to minimum eigenvalue of a real, symmetric and positive definite matrix. This design is not only optimal in total least squares error sense, it is also easy to incorporate linear constraints in time and frequency domain. Several design examples are used t o illustrate the effectiveness of this new design approach.
1. INTRODUCTION
Conventionally, we often use the well-known McClellan- Parks-Rabiner (MPR) computer program and standard lin- ear programming technique t o design linear phase FIR fil- ters according to the Chebyshev criterion which minimizes the maximum error in frequency response 111. The minimax designs usually give the designers a smallest length filter for a given specification. However, MPR algorithm is difficult to incorporate both time and frequency domain constraint. And, linear programming technique needs
a
large memory space and considerable computation time. Thus, a number of researchers have considered linear phase FIR filter design using least-squares optimality criterion.From literature survey, two well-documented least squares approaches for FIR filter designs are matrix inverse (IM) method and eigen-approach. The IM methods are based on solving a set of linear simultaneous equations by matrix inversion [2][3], and the eigen-approaches are based on the computation of an eigenvector of an appropriate real, symmetric, and positive-definite matrix [4][5]. Compared with minimax design, the advantage of least squares design is easy to add constraint and requires simple computation. The purpose of this paper is t o design linear phase
FIR
filters using total least squares(TLS)
error criterion which has been successfully used to solve many engineering prob- lems such as acoustic radiation problem, beamformer and harmonic retrieval etc [6]-[8]. The filter coefficients based on TLS criterion are obtained from the elements of the eigen- vector corresponding t o minimum eigenvalue of a real, sym- metric and positive definite matrix. Due t o this sake, the to- tal least squares filter design is referred t oas
the new eigen- filter approach. The main difference between conventional and new eigenfilters is that conventional method needs to specify the reference point, but new approach does not re- quire this choice. Moreover, the solution of new eigenfilter is closer to the solution of theI M
method than the one of the conventional eigenfilter.2. FIR FILTER DESIGN BASED O N TOTAL LEAST SQUARES ERROR CRITERION 2.1 P r o b l e m Statement:
A causal N t h order FIR filter can be represented as N
H ( t ) = h(n)z-" (1)
n=O
The magnitude responses
of
FIR
filtersis
given byM
A ( w ) = a n t r i g ( w , T I ) (2) 11=1
where trig(w, n) is an approprite trigonometrical function [l]. The coefficient an is related t o the impulse response of the filter, whereas M is a function of the filter order N . Defining the column vector
a = [a1 a2 . . . a M I t (3) and
C(W) = [trig(w, 1) t ~ i g ( w , 2) . . . t r i g ( w , M ) ] ~ (4)
then we rewrite eq(2) as
A ( w ) = a'c(w) = c ' ( w ) a ( 5 )
The notation
t
denote the vector or matrix transpose. Now, the problem is that how we can find a such that the mag- nitude response A ( w ) in eq(5) fit the desired magnitude response D ( w ) as well as possible. Total least squares error m e s u r e s will be studied in this paper.2.2 TLS Design Method:
The well-known linear phase filter design problem is to find a filter weight a such that the desired magnitude re- sponse
D ( w )
is equal t o the actual magnitude response atc(w) of the filter, i.e.D ( w ) = a'c(w) (6)
for each w E [ O , T ) . In the space
R
generated by C(W) and D ( w ) , it is clear that the expression D ( w ) = a'c(w) denotes a hyperplane. For a given frequency4,
the ( c ( $ ) , D ( 4 ) ) denotes a point in8.
Now, the filter design problem can be restated as "we want the point (c($),D($)) to fall on the hyperplane D ( w ) = a'c(w) for all6
E [ O , T ) " . When the point (c(4),D ( $ ) )
does not fall on the plane D ( w ) = a'c(w). the error between them can be measured in several ways.0-7803-5471 -0/99/$10.0001999 IEEE
Two typical ones with geometric interpretation are shown in Fig.1. One error (type 1) is given by
4 4 )
=P ( 4 )
-
a'c(4)l (7)the other (type 2) is given by
The least squares filter design problem means that the op- timal filter weight a is obtained by minimizing the squared errors
J(a) =
JJ,,
le(w)12dw (9) whereR
is the region 05
w5
R, but excuding the transientband. Now, two types of least squares errors will be inves- tigated in detail. Substitute eq(7) into eq(9), we obtain
J(a) = J J E R ( D ( W )
-
atc(w)Ydwwhich is same
as
the least sauares error measure of the conventional one [2].have
J(a) =
Next, substitute eq(8) into eq(9), we
where a and Q,, are given by
a = [at - lIt
S(w) = [ C ( w y D ( W ) ] t
Qn =
S,,,
S(~)e(~)~dw
(11) Based on Rayleigh's principle, the minimum of J(a) oc- curs a t the eigenvector of the matrix Q,, corresponding t o the minimum eigenvalue. Note that theQ,,
is also a real, symmetric and positive definite matrix. Since the solution vector a is simply the minimum eigenvector of matrix Q,,, we call this least squares design as new eigenfilter design. In the [6), the least squares error of type 2 is named as total least squares error, so we claim that the new eigenfilter is optimal in total least squares error sense. Now, we summa- rize the design procedure of new eigenfilter as follows:Step 1 : Compute the matrix Q,,.
Step
2:
Calculate the minimum eigenvectorio
of the ma- trix&,,.
Step
3: Normalize the solution vector&,
t o the form [adIt is clear that this new eigenfilter does not need to spec- ify the reference point which is a basic requirement of the conventional eigenfilter.
- 11'. The final desired solution an is equal t o h .
2.3 Design Example:
In the example, we will compare the performance of three least squares methods. This example is performed with the
MATLAB Language in an IBM PC compatible computer by using the above design procedures.
Example 1: Lowpass filter design:
Consider the problem of designing a lowpass filter with the following desired amplitude response
0 I W < W p
D ( w )
={
0, W s L w < R (12)don't
l' care, wp
<
w<
wsThere are four cases of FIR filters with exactly linear phase, but only two of these could be applied to design lowpass filters, that is, case 1 and case 2 [l]. Here, we only consider case 1 filter whose elements of matrix Qt and p are given by
q t ( i , j ) =
s,
cos((2 - l)w)cos((j - 1)w)dw p ( i ) =l c o s ( ( i
- l)w)D(w)dw 15
i, j5
M
where the regionR
= [O,wp] U [ w . , ~ ] . F i g 2 shows the magnitude responses of three least squares approaches with order N = 32, w p = 0.27r, and ws = 0 . 3 ~ . The reference point W O chosen in the conventional eigenfilter isy.
Fromthis result, it is clear that the specification are well satisfied for three least squares methods. However: the stopband at- tenuation of conventional eigenfilter is slightly worse. than the proposed method, because the amplitude response a t the reference frequency W O must be satisfied exactly for the
conventional eigenfilter design. Moreover, the distances be- tween optimal solutions are listed below:
la,f
-
at1 = 0.005109 la,,-
at1 = 0.000267where at is the solution of IM method and a,f is the one of conventional eigenfilter. Thus, the solution of the new eigenfdter is closer t o the solution of the conventional least squares solution than the one of the conventional eigenfilter.
3. FIR FILTER DESIGN WITH LINEAR CONSTRAINT
The main advantage of the least squares approach is that various time and frequency constraints can be incorpo- rated. In the linear case, the general form of the constraints can be stated as
where E is a
L
x M matrix andk
is a L x 1 vector. Note that L is the number of the linear constraints which is usu- ally smaller than the number of coefficients M . Moreover. we assume E is a full rank matrix in order t o avoid redun- dant constraints. For the conventional least squares filter design, the closed-form solution can be obtained by using the well-known Lagrange multiplier method [2]. Moreover! the procedure t o find the solution of the conventional con- strained eigenfilter design is slightly complicated, the detail can be found in[4].
As
to the new eigenfilter design whichis our main focus, the design problem becomes
E a =
k
(13)kfQ,k Minimize
kt
k
Subject to E a = k
where kt = [at
-
11. The basic idea of solving this problemis to rewrite the constraint Ea = k as the following form:
E
k
.
0
(14)
where E = [E
k].
Then, the problem is reduced to&:“&,a
Minimize
i t a
Subject to E i . 0 (15)
The key step of our method is that “all the vector I sat- isfying constraint Ea = 0 can be expressed as a
=
Bw, where the columns ofB
form an orthonormal basis of the null space of matrx E”. Based on full rank assumption of E, we have that B is a( M
+
1) x ( M + 1 - L ) matrix and w is a ( M+
1 - L ) x 1 vector. Due to orthonormal condition, we obtainBtB
= I, where I is a ( M+
1-
L ) x( M
+
1-
L )
identity matrix. Thus, the problem described in eq(15) can be simplified as:
w t ~ tBW ~ n Minimize
Wt W
which is an unconstrained optimization problem. Hence, the optimal solution w, of this simplified problem is only the minimum eigenvector of matrix BtQ,B. Finally, the desired optimal solution a, is equal to Bw,. Now, the remaining problem is how to find the orthonormal basis of null space of matrix E. The well-known singular value decomposition (SVD) and
QR
decomposition can help us to solve this problem.Finally, we summarize the entire procedure of the pro- posed method as follows:
Step 1: Use SVD or QR decomposition to find the orthonor- mal basis of null space of matrix E and construct the matrix B.
Step 2: Find the minimum eigenvector w, of matrix B ~ Q , B .
Step 3: Calculate the optimal solution a, = Bw,.
Step
4:
Normalize the solution vector a, to the form[a: -
lit.
The final desired solution is given by a,. Note that the unconstrained eigenfilter design needs t o find the minimum eigenvector of matrix Qn with size(A4
+
1) x ( M+
1). However, new constrained eigenfil- ter design only requires t o find the minimum eigenvector of matrix BtQnB with size ( M+
1 -L )
x ( M+
1 - L ) .Thus, constrained eigenfilter has less computation load in searching minimum eigenvector.
Example 2: Notch filter design:
In this example, we will use notch filter design to demon- strate the effectiveness of proposed design algorithm de- scribed in the above. The frequency response of an ideal notch- filter has unit gain for all frequency except notch fre- quency in which gain is zero (21. Here, the case 1 FIR filter of even order N is used to design notch filter. Thus, the re- lation of the parameter in eq(2) is
M
=$
+
1, trzg(w, n) = cos((n - l ) w ) , a l = h ( $ ) , andN
N
(16)
2 2
Now, the optimal filter coefficient a, can be chosen such that the amplitude response A ( w ) is as close as desired response D ( w ) defined by
a , = 2h( - - n
+
1) for n = 2,3, . . .,
-+
1D ( w ) = 1 for all w E [O,.rr) (17) Moreover, to obtain zero gain
at
notch frequency W n andcontrol the null width, the following constraints are intro-
duced:
A ( w n ) = 0
: L - I
After some maniputation, it can be shown that the lin- ear constraints can be written as standard form Ea = 0. Now, let us see some numerical examples. Fig.J(a) shows the magnitude response of a notch filter using proposed method for
w,
=
0.5.rr,N = 32, and various L . It is clear that the frequency response is well satisfactory. When constraint number L increases, the notch width increases accordingly. For comparison, Fig.3(b) and (c) show the magnitude responses of a notch filter using the well-known Lagrange multiplier and linear programming methods forN
= 32,wn = 0.57r, andL
= 1. Basically, the linear pro- gramming method is a minimax design and Lagrange mul- tiplier approach is a conventional least squares error de- sign. From this result, it is obvious that proposed method almost has the same frequency response as Lagrange multi- plier method. This is due to both are belong to least squares error approaches. Compared with equal-ripple design using linear programming method, the new eigenfilter method has better frequency response fitting for all frequency band es-cept at the range around the notch frequency w,,.
4. CONCLUSION
In this paper, linear-phase
FIR
filter designs using to- tal least squares error criterion have been investigated. This design method is easy to incorporate linear constraints in time and frequency domain. Several design examples have been used to illustrate the effectiveness of this new design approach. However, only linear phase FIR filters are consid- ered here. Thus, it is interesting to study IIR filter designs based on total least squares error criterion. This topic will be investigated in the future.REFERENCES
[l]
A.
V. Oppenheim andR. W.
Shafer, Discrete-time Signal Processing, Prentice-Hall Englewood Cliffs, XJ, 1989.[2]
M. H.Er,
”Designing notch filter with controlled null width,” Signal Processing, ~01.24, pp.319-329, Sep. 1991.[3] M. Okuda, M. Ikehara and S . Takahashi, ”Fast and sta- ble least-squares approach for the design of linear phase FIR filters,” IEEE Trans. Signal Processing, Vo1.46. pp.1485-1493, June, 1998.
(41 T. Q. Nguyen, ”The design of arbitrary FIR digital fil- ters using the eigenfilter method,” IEEE Tkans. Signal Processing, vo1.41, pp.1128-1139, Mar. 1993.
[5]
S. C.
Pei,C. C.
Tseng and W.S.
Yang, “FIR filter de- signs with linear constraints using eigenfilter approach,”
IEEE Trans. Circuits Syst. 11, vo1.45, pp.232-237. Feb. 1998.[6]
S.
V. Huffel and J. Vandewalle, The Total Least Squares Problem: Computational Aspects and Analysis. SIAM, Philadelphia 1991[7]
S.
V.
Huffel, Recent Advances in Total Least Squares Techniques and Errors-in-variables Modeling. SIAM, Philadelphia 1997.[8]
D.
Z. Feng, Z Bao and L.C.
Jiao, ”Total least mean squares algorithm,” IEEE Trans. Signal Processing, vo1.46, pp.2122-2130, Aug. 1998.Fig.1 Geometric interpretation of two error measures at fre- quency w = 4 (a) type 1 error (b) type 2 error.
1 U
2od
-.-_. I. 0.3 0.4 0.5 0.1 0.2 -1201 normalized lrequencyFig.2 The magnitude response of a lowpass filter. The dashed line and dotted line almost overlap, conventional least squares design (dashed line), conventional eigenfilter design(so1id line), total least squares design (dotted line).
Fig.3(a) The magnitude response of a notch filter using
TL-
S method. L=l(solid line), L=3(dashed line), L=S(dotted line).
l 5 y -
.
ooL
0.1 normi 0.20.3 0.4 0.5
I lrequency
Fig.3(b) The magnitude response of a notch filter using La- grange multiplier method for L=l.