New approach to the design of FIR digital filters
J.S. Mason, MIEEN.N. Chit
Indexing terms: Digital filters, Circuit theory and design, Filters and filtering
Abstract: This paper presents a new approach todesigning finite impulse-response (FIR) digitalfilters. The design algorithm is based on the leastmean square (LMS) criterion in the time domainto calculate the filter coefficients using theweighted gain peak errors to adjust the LMS costfunction. The filter responses are optimum in thesense that the maximum gain error is minimised.The design procedure accommodates the entirerange of linear phase FIR filter specifications. Theflexibility and optimality of the LMS approach isdemonstrated with a wide variety of examples,including the classic extraripple, scaled extrarippleand equiripple cases of linear phase and examplesof nonlinear phase. To date the only two algo-rithms that have been able to design the full rangeof linear phase filters are based on the Chebychevpolynomial approach, namely Remez exchangeand linear programming.
1 Introduction
In practice, the most widely used approaches to thedesign of finite impulse-response (FIR) filters are basedon the Chebychev polynomial approximation. Theseapproaches [1-8] are conveniently differentiated bylabelling them with the name of the numerical techniqueused to solve the polynomial equation, for example linearprogramming [5], and the very popular Remez exchangefeatured in McClellan's program [8]. To date only thesetwo algorithms are capable of designing the full range oflinear-phase optimum FIR filters. However, within therestriction that the desired filters must have linear phase,there are other Chebychev based algorithms [2, 3] ableto design a subset of conventional and optimum lowpass,highpass and multiband filters; Hilbert transformers, dif-ferentiators and general shaping filters are also accom-modated. The approaches differ in the importantpractical concern of computational efficiency, parametercontrol and specifications. These features are discussedby Rabiner [1]. There are a number of papers [13-21]that discuss the general properties of optimum linear-phase filters, and the relationships between the differentparameters, such as even and odd order, transition ratio,and tolerances.
The approach presented in this paper is commonlyassociated with systems identification theory, and is
Paper 5463G (E10), firs received 19th September 1986 and in revisedform 22nd April 1987The authors are with the Department of Electrical & Electronic Engin-eering, University College of Swansea, Singleton Partk, Swansea SA28PP, United Kingdom
based on the least mean square (LMS) error criterion. Itis widely used in applications in the field of control andcommunications where the unknown system is usuallydescribed in terms of the statistical characteristics of thestationary or nonstationary output and input signals[12]. For the design of digital filters, the ideal filter(unknown system) is described by a set of deterministicsignals derived from the user specifications. Theunknown system is fully defined by these input andoutput signals. The basic idea of comparing the outputsof an ideal mathematical model and the filter structureunder design is shown in Fig. 1. This type of approach
>
(F IR) /
designed filter
/
(ideal filter)unknown model
A
Vn
Fig. 1 Structure of the LMS approach
has been suggested previously by Widrow, Titchener andGooch [9] and more recently by Lim and Parker [11].
Widrow et al. [9] illustrate the general approach usinga specification of shaping gain and linear phase. Thedesign procedure involves the minimisation of the squareerror in the time domain, by solving a set of linearsystems equations. As Widrow points out, the filter coeffi-cients can be calculated by using either a direct or aniterative method, and the approach is theoretically suit-able for the design of both FIR and infinite impulse-response (IIR) filters. Gooch [10] investigates the case ofthe IIR design and Lim and Parker address the problemof designing FIR filters with meaningfully quantised coef-ficients; their solutions are constrained to be linear phaseand are suboptimal, but the design procedure is compu-tationally efficient in comparison with linear program-ming [11]. Here we show that an LMS approach, whichis essentially an application of systems identificationtheory is suitable for an entire family of filter specifi-cations and demonstrate this with some classic optimumdesigns.
An inherent characteristic of linear-phase filters,however designed, is their symmetry of some form in thetwo domains: in the frequency domain the gain responseis an even function about zero and the Nyquist fre-quencies, and in the time domain the coefficients have
IEE PROCEEDINGS, Vol. 134, Pt. G, No. 4, AUGUST 1987 167
related symmetries about their centre. It is convenient toview such symmetries as constraints, which, for example,in the case of all of the Chebychev based approaches (andthe LMS of Lim and Parker [11]), are inherent, unableto be relaxed, and identify bounds of the related algo-rithms. In contrast the LMS approach proposed here hasthe flexibility to incorporate such constraints, but only asan additional optional part of the specification. In thisrespect the proposed approach has an inherently widerscope than all the Chebychev based algorithms.
2 Definition of the LMS approach
Fig. 2 shows the structure of the proposed approach toFIR filter design; the input excitation un consists of a
adjusted-E(u>)
Fig. 2 Diagramatic representation of the LMS algorithm
weighted sum of sinusoids at a discrete set of frequencies;the cost function C, is initially specified as a function ofthe relative importance of the gain tolerance; subse-quently it is adjusted as a function of the weighted gainerrors. The output signal of the ideal filter yn is derivedfrom the input excitation and the user specification,including both gain G, and phase 0,. These desired gainand phase characteristics which vary according to specifi-cation, define the ideal filter whose impulse response isunknown and possibly noncausal. The filter beingdesigned has a coefficient vector A, and generates theoutput sequence yn corresponding to the input sequence.The difference between this output and that of the idealfilter gives the error sequence en. The filter coefficients arecalculated, to minimise the total sequence error, usingeither an LMS direct or iterative algorithm. However, theresponse of the first set of coefficients does not generallymeet the specifications. Further iterations of the LMSsolution are necessary; the idea is to adjust the cost func-tion in such a manner so as to minimise the maximumdeviation of the resultant gain response (this is referred toas the minimax criterion). Fig. 3 depicts this process, inwhich the frequency domain weighted peak errors andthe appropriate initial costs are used to update thecurrent cost function, in a manner which ensures con-vergences and leads to optimum solutions.
3 Formulation for general FIR filters
The goals of this section are to show how to obtain thefilter coefficients of a general FIR filter. Referring to Fig.2, we consider the following definitions.
The desired gain, phase and initial cost function aredefined at a discrete set of normalised frequencies f{,0.0 <fi< 0.5, and / = 1, 2 , . . . , Nf is a frequency counter.
168
The value of the Nf must be greater than or equal to theexpected number of peak errors Np in the designed gainresponse (i.e. Nf ^ Np). This number is governed by theorder of the filter [17] and for the linear phase case isgiven by
JV + 2(2JVB-2) eveniV2
N,+ {2NB - 2) odd N2
where Nz is the order of the filter and NB is the numberof bands in the filter. The expressions assume that thefirst band begins at fx = 0.0 4- and the last band ends atfNf = 0.5 — . The input signal to both the FIR filter andthe ideal filter is given by
Nf
sin (1)
In some of the subsequent derivations, it is convenient toconsider the input signal as a vector U. The length of thisvector is governed by the filter order and U is defined as:
U= [«n,Mn_l5 . . . ,M n _ N J r
The desired output signal is given byNf
v = X " 0 5 Y C:G; sin (cosn + 6;) (2)
The scalar constant K controls the mean power of theinput and the output signals; over one complete period oftime M the input power is normalised to unity if
The designed output signal is given by
yn = IFA
and the output error is given by
en = yn - IF A
where
n = 0, 1, . . . , M-l, is a time sequence count
(3)
(4)
(5)
A = [a0 , alt..., aK,..., aNJT is a vector of filter coeffi-cients.
The mean square of the output error el is given by
(6)
R, an autocorrelation matrix of the input signals, is givenas
"„"„ "„«„-!
Un -N:Un- Nz
(7)
P, a cross-correlation vector between the input and thedesired output signals, is given as
P = (8)
un-Nzyn_
IEE PROCEEDINGS, Vol. 134, Pt. G, No. 4, AUGUST 1987
As the input signal and the desired output signals aresums of sinusoids, we can derive the representation ofeqns. 7 and 8 as follows
(a) Case 1: symmetrical A, Nz even
= ^ ZCn2cos(wn(i-;))
t(9)
(10)P(i) = — 2̂ Cn Gn cos (con i + 9n)
i = 0, 1, . . . , Nz is a row count
; = 0, 1, . . . , Nz is a column count
The mean square error of the output is a quadratic func-tion of the filter coefficients. Taking the derivative of eqn.6 with respect to the coefficients vector A and setting theresult to zero produces a set of linear equations
A = R > P (11)
The problem of filter design can be considered asproblem of solving this linear set of system equations.The filter coefficients can be computed by a direct evalu-ation or by an iterative solution of eqn. 11.
4 Formulation for linear phase FIR filters
The solution of eqn. 11 does not generally achieve alinear phase response. However, the design approach canbe constrained in some suitable manner to achieve anexact linear phase response (and the associated time sym-metry of filter coefficients) yielding an approximated gainresponse with its associated symmetries about zero andthe Nyquist frequencies. The idea of such constraints is torestrict the filter coefficient vector A to some subspace bythe underdetermined set of linear equations SA = d, Thusthe minimisation problem implied in the derivative ofeqn. 6 becomes
min {ATRA - 2PTA) subject to SA = d (12)
The solution can be found using Lagrange multipliertechniques as follows:
^ = ~tf + ATRA - 2PTA + USA - XTd (13)
where X and d are N-dimensional vectors, and S is anN x N. dimensional matrix.
even iV,
odd AT, (14)
Taking the derivative of eqn. 13 with respect to the filtercoefficient vector and setting the result to zero producesthe following:
2A-2P + (KTS)T = 0
Multiplying by S7?"1 gives
(15)
(16)
STyld (17)
Linear phase filters have associated symmetries (orantisymmetries) within A, which are imposed by appro-priate assignments to S and d as defined below.
Substituting into eqn. 15 yields
A = ( / - / ? 1 5 T [ 5 / ? 1 5 T ] 1 5 ) / ? 1 / >
0 otherwise
and
aN if i = N
0 otherwise
(b) Case 2: symmetrical A, Nz odd
0 otherwise
and
40 = 0(c) Case 3: antisymmetrical A, Nz even
and
40 =
0 otherwise
if i = N
0 otherwise
(d) Case 4: antisymmetrical A, Nz odd
1 if j = i1 if j = Nz — i0 otherwise
and
40 = 0The solution to the constrained problem, eqn. 17, can befound efficiently by using the Gaussian elimination algo-rithm. The linear phase 9n of FIR filters is governed bythe order [1] and
9n = -xo)n (18)
where the group delay T is given by
N + 1
with symmetrical AT =
x = ± - with antisymmetrical A
5 Formulation of the cost function
The solution of the constrained equation 17 producesfilter coefficients with an exact linear phase response andthe associated symmetry about the central point of thefinite impulse response. However, on the first pass theapproximation of the gain response does not generallymeet the specifications. To achieve this the cost functionis automatically and iteratively adjusted in some suitablemanner similar in concept to the Remez exchange algo-rithm for the solution to the Chebychev approximation[8]. Fig. 3 shows the structure of the proposed opti-misation strategy which can be described mathematicallyas follows.
Let Co. be the initial costs defined to be proportionalto the specified gain tolerance. (Again this is similar tothe Remez exchange algorithm.)
IEE PROCEEDINGS, Vol. 134, Pt. G, No. 4, AUGUST 1987 169
The weighted peak gain error is given by
£,. = Co(|GI.-GI. | (19)
where G, and G, are the desired and the designed gainresponse, respectively, and i = 0, 1, 2, . . . , Np—\, is apeak count.
CO,
co2
coN (
E(ou) =
adjusted costs
eqns. 20-22
Fig. 3 Diagrammatic representation of the LMS cost adjustment
The mean weighted peak error is given by
i NP-I
ly p 1 = 0
The incremental costs are given by
(20)
0 i f £ , ^ ( 2 1 )
The new costs are obtained as follows:
C, = CJ + AC,- (22)
where C\ are the most recent costs.
6 Optimisation algorithm
This Section is mainly concerned with the adjustment ofthe cost function to design optimum FIR digital filters.The adjustment is based on weighted peak errors in thegain response as described in the preceding Section; thecurrent cost function C, is updated by adding to it thevector AC as defined by eqn. 22. This process continuesuntil some criterion is satisfied; here we have used theminimax criterion dit defined as follows:
Pmax (23)
where pmax is the maximum weighted gain peak error.The optimisation algorithm can be summarised asfollows:Begin
(a) From the filter specification derive:(i) frequencies/ ,i = 1, 2 , . . . , Nf
(ii) gain G(ft)
(iii) phase 0(f;)(iv) cost C0(ft) for 0.0 + <ft < 0.5 -
(b) Compute the correlation functions from eqns. 9and 10
(c) Calculate the filter coefficients according to eqn.17.
(d) Find the weighted gain peak errors according toeqn. 19 and calculate new costs according to eqn. 22
(e) If the minimax error criterion of eqn. 23 is above apredefined limit, go to step (b)
(/) Output filter characteristics as requiredEnd.
The number of frequencies Nf is related to the expectednumber of peaks in the overall disjoint bands. The aim ofstep {d) is to adjust the current costs (initialised in step (a)as a function of gain tolerances given in thespecifications). As the exact peak locations depend on thevector A (and hence are unknown a priori), a search algo-rithm must be used to locate and evaluate the actualpeak errors so that the cost of that or a neighbouringfrequency can be adjusted.
6.1 Examples to illustrate the algorithmTo illustrate this iterative algorithm, we consider thedesign of the following filters.
Figs. 4 and 5 show the results of a classic and shapingfilter design, respectively. The classic filter is a minimaxspecification taken from Reference 7 and demonstratesthe design of a linear phase lowpass filter, N, = 24, Fp =0.2076, Fs = 0.2513 and 5P = 5S = 0.05 with'a unity costfunction, the shaping filter demonstrates the design of alinear phase 2-band filter, specified as follows:
(HJd = e x p ( - 10(0.25 -f{) In (10)) 0.0 </ f ^ 0.25
= 0.0 0.28 ^f, ^ 0.5
1
cm °°= 2.0 0.28
0.25
0.5
The dots of Figs. 4a and 5a represent the desired gainresponse. The broken line and the solid line plots of theseFigures represent the resultant gain response after thefirst and the last iteration, respectively; their correspond-ing weighted gain error (WGE) curves are shown in Figs.Ab and 5b. Fig. 5h shows the log gain response at the lastiteration for the shaping filter. It should be noted that theerror criterion of the last iteration is chosen to be lessthan or equal to one percent i.e. d( ^ 1% where i is theiteration count. Figs. Ac and 5c represent the initial costfunction; Figs. Ad, 5d and Ae, 5e show the adjusted costfunction of the input data after the first and last iter-ations, respectively; and Figs. Af, 5/and Ag, 5g show theabsolute value of the weighted gain peak errors (WGPE)at the first and last iterations, respectively. The maximumweighted peak error Pmax at various iteration counts areas follows.Classic filter:
Pmax = 0.092 at the first iterationwith dt > 100%
= 0.051 at the 18th iterationwith dt < 10%
= 0.050 at the 77th iteration(last) with dt < 1%.
170 IEE PROCEEDINGS, Vol. 134, Pt. G, No. 4, AUGUST 1987
1.000
0.800
0.600
O.AOO
0.200
0.0000.10
005
0.00
-0.05
10
8
2
01 0
d
in1/1
ou
wo
e
T oX
- a" o
/
o
O UJ- Q.
O
2
010
8
6
U
2
0
1.000
0
0
0
01
0
0
0
750
500
250
000000
7 50
500
250
0.000
I 1T ,.
i i I i i i i
0. 1 0. 2 0. 3
f r e q u e ncy
0. 0.5
Fig. 4 Results of 24th-order linear phase lowpass filter
O initial- - first— last
IEE PROCEEDINGS, Vol. 134, Pt. G, No. 4, AUGUST 1987 171
I T T T TT T l l t T . 4 T X . T T T T T
I I I I I I I I I I
Fig. 5 Results of49th-order linear phase shaping filterO initial- - first— last
172 IEE PROCEEDINGS, Vol. 134, Pt. G, No. 4, AUGUST 1987
Shaping filter:
Pmax = 0.127 at the first iterationwith dt > 100%
= 0.065 at the 90th iterationwith dt < 10%
= 0.064 at the 412th (last)iteration with dt < 1%
The classic filter was designed by Rabiner et al. [7]; com-paring errors at the extreme frequencies (including theband edges), the LMS approach solution at dt ̂ 10%closely matches the minimax solution of the Chebychevbased approach. The shaping filter is optimum in thesense that dt is minimised. These results show how adjust-ing the cost weighting in an automatic and additivemanner the responses of the designed filter can be opti-mised. Figs. 6a and b and (la and b) show the learning
2.00
1.75co
I 1-50
5 1.25 It 1.00
| 0.75 h
£ 0.50
0.25 -
0.00
1.000
fe 0.750
0.500
Ca
a 0.250
0.000
10 20 30 40 50 60 70iteration number
a
10 20 30 50 60 70
iteration numberb
Fig. 6 Learning curves for the LMS optimisation process for the 24th-order linear phase low pass filter
Table 1: Coefficients of the 24th-order linear phaselowpass filter calculated by using the proposed LMS andthe Remez exchange algorithms
Remez [8] LMS
a (0) -0.34639520 x 10"1
a (1) -0.29846260 x10"2
a (2) 0.22290780 x 10-1
a (3) 0.10821770 x 10"1
a (4) -0.27900090x10"a (5) -0.24153360x10"a (6) 0.33248020x10"a (7) 0.47019320x10"a (8) -0.37332360x10"a (9) -0.95620170x10"a (10) 0.40192100x10"3(11) 0.31463470a (12) 0.45893660
-0.3448775x10"-0.2986969x10"
0.2243430x100.1082866x10
-0.2776704x10"-0.2417872x10-
0.3333966x100.4702882x10
-0.3723013x10"-0.9560569x10-
0.4032829x100.31464850.4590745
curves for the LMS process for the classic and shapingfilter, respectively. Figs. 6a and la depict the minimaxerror d{ against the number of iterations: the broken lineand the solid line plots of Figs. 6b and 1b represent themean weighted peak error <5 and the maximum weightedpeak error Pmax, respectively. The filter coerficients of thelinear phase filter are constrained to be exactly symmetri-cal so that the phase response of the resultant filter isexactly linear after the first iteration. Table 1 shows acomparison between the classic filter coefficients of theLMS approach and the result of the computer programof McClellan et al. [8]. The differences, as would beexpected, are very small. For all coefficients the most sig-nificant two digits at least are identical. Table 2 showsthe shaping filter coefficients.
7 Further examples
An illustrative set of examples are designed using the pro-posed approach. The set comprises nine examples oflinear phase lowpass filters, demonstrating the extra-ripple, scaled extraripple, and equiripple cases (even andodd order); a linear phase multiband (five bands); a
3.503.253.002.75
o 2 . 5 0$ 2 . 2 55 2 . 0 0fc 175£ 1-50
I 1.00£0.75E0.50
0.250.00
1.5001
1.250
1.000
|0.750
0.500
100 150 200 250iteration number
a
300 350 400
0.00050 100 150 200 250 300 350 400
iteration numberb
Fig. 7 Learning curves for the LMS optimisation process for the 49th-order linear phase shaping filter.
mean
a (24 - / ) =a(/) for 0 12
linear phase bandpass with a shaping cost function; aHilbert transformer and a differentiator. The results arecompared with those of the Chebychev basedapproaches. Throughout the following examples, theminimax error criterion dt of eqn. 23 is minimised to beless than 10%.
7.1 Nine examples of linear phase lowpass filtersRabiner and Gold [1] define the three types which makesup the full set of linear phase lowpass filters, namelyextraripple, scaled extraripple and equiripple. Thenumber of peak errors (including band edges) Np of suchfilters is as follows:
IEE PROCEEDINGS, Vol. 134, Pt. G, No. 4, AUGUST 1987 173
Table 2: Coefficients of the 49th-order linear phase shapingfilter calculated by using the proposed LMS algorithm
3(0)3(1)3(2)3(3)3(4)3(5)3(6)3(7)3(8)3(9)3(10)3(11)3(12)3(13)3(14)3(15)3(16)3(17)3(18)3(19)3(20)3(21)3(22)3(23)3(24)
-0.4194540*10"0.1232120x10
-0.6621300x10"-0.9720097x10-
0.6286039x100.1162985x10"
-0.8260517x10--0.1329933x10-
0.1157345x10"0.1452498 x 10
-0.1624223x10"-0.1539762x10"
0.2218515 x 100.1573460x10-
-0.2981011 x io --0.1585084x10"
0.3942118 x 10"0.1601345 x 10-
-0.5228977x10"-0.1835928x10"
0.6916235x100.2754918x10
-0.8879324x10--0.5534657x10"
0.8948813x10
a (49 - /) = a(i) for 0 < / < 24.
(a) extraripple:
NNp = —- + 2 Nz even
+ 2
(b) equiripple:
odd
AL even
+ 1 AL odd
(d) a, b, c, d and e are directly comparable with thoseof Rabiner et al. [16] (Fig. 7), and/, g, h and i with thoseof Parks et al [14] (Fig. 3). In all cases Pmax is 0.1
(e) the new LMS approach can design the full set ofoptimum linear phase lowpass filters.
7.2 Another linear phase lowpass filterLim and Parker [11] (Figs. 4 and 5) use this example todemonstrate their LMS approach when designing filterswith severely quantised coefficients. After their opti-misation process for the infinite precision coefficientvalues, they state that the passband and stopband gainpeak errors are less than or equal to 0.05; however, theyclaim that, using the LMS approach, it is extremely diffi-cult to meet the minimax solution. The new LMS algo-rithm proposed here sheds new light in this area.
Requirements:(i) N2 = 24
(ii) symmetrical impulse response(iii) gain response and initial cost function:
Gifd =1.0 0.0
0.0 0.2
0.1
0.5
CWd =1.0 0.0^/^0.11.0 0.2^/^0.5
(iv) minimise dt to best match the above specifications.
Comments: Figs. 9a and b show the log gain response andits error curve, respectively. The result is optimum and itis a scaled extraripple solution with
p _ = 0.0038
7.3 Linear phase multiband filterMcClellan et al. [8] design this example. The optimumgain peak error values in each band are stated in Table 4.
The scaled extraripple case has the same value of Np as Table 4: Remez exchange result [8]the extraripple but either at the first or the last extremefrequency the error value is smaller than the otherextremer.
band 1 band 2 band 3 band 4 band 5
0.0035 0.0345 0.0115 0.0345 0.0017
Requirements: Table 3 shows the specifications which areselected from References 14 and 16.
Comments: The following comments relate to the gainresponses plotted in Fig. 8:
(a) a, c, d and/show the optimum response for variousamounts of scaling
(b) e and h show the optimum responses with equi-ripple
(c) b, g and i show the optimum responses with extra-ripple
Table 3: Specifications of optimum linear phase lowpassfilters
Filter Nz Fp Fs
abcdef9hi
99999
101010
8
0.1250.13420.13660.13960.17000.21000.21580.26600.2661
0.2040.20920.213350.218570.264750.28050.28420.34970.3499
This example has a different cost function in each of thestopbands, thus the resultant peak errors are also differ-ent.
Requirements:(i) Nz = 54
(ii) symmetrical impulse response(iii) gain response and initial cost function:
Gifd =
'0.01.0
0.01.0
.0.0r10.01.0
3.0
1.0
.20.0
0.0 ^fii0.1 ^fti
0.18 < / , ^0.30 <*/• *0.41 ^f( i
0.0 </j
0.1 ^ /0.18 ̂ fi0.30 ̂ / -0.41 ̂ f,
$ 0.05•"* C\ 1 ^^ V/ . A J
$0.25$0.36$0.5
^0.05^ 0.15
<0.25
^0.36
^0.5
174
C(fd =
(iv) minimise dt to best match the above specifications.
IEE PROCEEDINGS, Vol. 134, Pt. G, No. 4, AUGUST 1987
Comments:(a) Using the proposed design approach, Figs. 10a and
b show the optimum log gain response and its errorcurve respectively with Pmax = 0.035.
(b) The peak errors at the band edges and the locationof the maximum gain peak error (GPE) in each band aregiven in Table 5 and are a very close match with Refer-ence 8.
7.4 Linear phase bandpass filterThis example is a high-order bandpass filter with shapingcost functions in the stopbands. McClellan et al. [8]
Table 5: LMS Result
band
12345
edge 1
0.00340.03440.01150.03420.0017
edge 2
0.00340.03460.01150.03440.0016
Maximum GPE
0.00340.03460.01150.03440.0017
design this example and show that the optimum peakerror in the passband is 0.05 where the errors in the stop-band edges are given in Table 6.
0.5
0.4 0.5
0.5 0.0 0.1 0.2 0.3 0.50.0 0.1 0.2 0.3 0.4 0.5 0.0 0.1 0.2 0.3 0.4
9 h frequency 'Fig. 8 Gain responses of optimum linear phase lowpass filters showing various amounts of scaling with even and odd order.
<5p - S, - 0.1 / Nt = 10, scaled extraripplca, c, d. N, « 9, scaled extraripple g Nt= 10, extrarippleb Nt - 9, extraripple h Nz= 10, cquiripplee N, = 9 equiripple i Nz = 8, extraripple
IEE PROCEEDINGS, Vol. 134, Pt. G, No. 4, AUGUST 1987 175
Requirements:(i) Nz = 127
Table 6: Remez exchange result [8]
IU
0-10
-20
m "30' . - 4 0c"6 -50en
-60
-70
-80
-90
-1000.050
- 0.025oX
oj= 0.000
U.ID
en-0.025
-0.050
\
\
\
\
- \iY\C\I I II
A
i i
(VYY1 i '
0.1 0.2 0.3 0.4 0.5frequency
A A l A A A A A A A A / 1
•AI/• V
I I I v V v V V V[ i f • i • •
0.1 0.2 0.3frequency
0.4 0.5
Fig. 9 Another 24th-order linear phase lowpass filter
a Optimum log-gain responseb Gain error curve
-0.5000.1 0.2 0.3
frequencyb
0.4 0.5
Fig. 10 54th-order linear phase multibandfilter
a Optimum log-gain responseb Weighted gain error curve
bandstop edge 1 edge 2
0.0050 0.00050.0005 0.0050
(ii) symmetrical impulse response(iii) gain response and initial cost function:
1Gifd = 11
C(ft) = <
0.01.0
0.0
0.0^^0.12 <
/i ^ 0.1Ifi^ 0.13
0.15 < / , ^ 0 . 5
r 10.01 -1.0
19F,
a o.o
9F,
0.0
- 1.25
0.0 ^fi ^
0.15 ^ft
0.25 ^ f;
5 0.1
^ 0.13
^0.25
^0 .5
(iv) minimise dt to best match the above specifications.
Comments:(a) Figs, l l a and b show the optimum log gain
response and its weighted error curve, respectively, with
Pmax = 0.05
(b) The maximum peak error at the passband is 0.05and the peak errors at the stopband edges obtained aregiven in Table 7.
Table 7:
bandstop
12
LMS result
edge 1
0.00430.0005
edge 2
0.00050.0050
(c) This solution is believed to be optimum, it dis-agrees slightly with that of McClellan [8]: ours has ascaled ripple in the first stopband edge, which is evidentfrom the error curve.
7.5 Hilbert transformerThis is an example of an antisymmetrical impulseresponse. Rabiner and Schafer [18] design this exampleand state that the optimum peak error is 0.008094.
Requirements:(i) Nz = 30
(ii) antisymmetrical impulse response(iii) desired gain response and initial cost function:
G{fi) =1.0 at 0.04 ^ ^ 0.46
= 0.0 at/j =0.0 and 0.5
C(/()=1.0 at 0.04 < / . < 0.46
= 1.0 at/- =0.0 and 0.5
(iv) minimise d, to best match the above specifications.
Comments:(a) Using the proposed LMS design approach,
Figs. 12a and b show the optimum gain response and itserror curve, respectively, with Pmax = 0.008093, i.e.matching Reference 18.
7.6 DifferentiatorThis is a different type of antisymmetrical impulseresponse. Rabiner and Schafer [19] design this example
176 IEE PROCEEDINGS, Vol. 134, Pt. G, No. 4, AUGUST 1987
and state that the optimum peak weighted (or relative)error is 0.0136.
Requirements:( i )N z =15 •(ii) antisymmetrical impulse response(iii) desired gain response and initial cost function:
i) = ^ 0.0 < 0.5
,) = 2£ 0.0 </, ^ 0.5
(iv) minimise d{ to best match the above specifications.
Comments: Using the proposed LMS design approach,Figs. 12a and b show the optimum gain response and itserror curve, respectively, with Pmax - 0.008093, i.e.matching Reference 19.
8 Nonlinear phase filter design
For certain applications for example in telecommunica-tions it is important to minimise group delay, thus rulingout linear phase circuits in favour of minimum phaseones. Other applications require simultaneous specifi-cation of phase and gain to compensate for other com-ponents in the system. To date a unified approachcapable of designing a complete set embracing such filtersdoes not exist. Most of the current literature is concernedwith the design of filters constrained to have linear phaseand these constraints are inherent to the designapproaches. By comparison, there exist only a few refer-ences to the design of nonlinear phase FIR filters and theassociated algorithms are relatively difficult to use, asmentioned by Cortelazzo [22]. To design a particulartype of the nonlinear phase, say a minimum phase filter, atransformation procedure of a linear phase prototype toan equivalent minimum phase one is currently the recom-mended approach.
g, 0.000
-0.250
-0.500
-0.7500.1 0.2 0.3
frequency
b
Fig. 11 127th-order linear phase bandpass filter with a shaping cost functiona Optimum log-gain responseh Weighted gain error curve
IEE PROCEEDINGS, Vol. 134, Pt. G, No. 4, AUGUST 1987
0.4 0.5
177
-0.0100.1 0.2 0.3
frequency
bFig. 12 31 st-order Hilbert transformera Optimum gain responseb Gain error curve
10
0
-10
-20
-30
0.4
4J
O
•S o
-2
0.2 0.3 0.4 0.5frequency
c
Fig. 14 24th-order minimum phase lowpass filtera Log-gain responseb Desired and resultant phase responses within the passband
desiredresultant
0.5-1.500
0.1 0.2 0.3
frequency
bFig. 13 15 th-order differentiator
a Optimum gain responseb Weighted gain error curve
0.4
0.420 0.840 1.260 1.680 2.100frequency, x 10"1
b
0.420 0.840 1.260 1.680 2.100frequency^ 10"1
d
c Gain error curved Resultant group delay within the passband
178 IEE PROCEEDINGS, Vol. 134, Pt. G, No. 4, AUGUST 1987
In contrast, using the proposed LMS approach todesign any type of nonlinear phase FIR filter, the uncon-strained eqn. 11 can be used instead of the constrainedeqn. 17 with the same optimisation process of Section 6.Figs. 14a, d and 15a, d show designed examples of aminimum phase, and a sinewave compensator nonlinearphase, respectively. These filters have the same order andgain specifications as the 24th-order lowpass filter inSection 6.1. Figs. 14a and 15a and 14c and 15c show theresultant log gain responses and their error curves,respectively; the broken line and the solid line plots ofFigs. 146 and 156 represent the desired and resultantphase responses, respectively; and Figs. 14d and 15a*show the resultant group delay and the phase deviation(sine function), respectively.
Comments:(a) The resultant gain responses are optimum in the
sense that d( is minimised to be less than 10% and Pmax is
Table 8: LMS result
as follows:
Pmax = 0.036 with the minimum phase
= 0.050 with the phase compensator
Table 9: Coefficients of the 24th-order minimum phase andphase compensator filters calculated by using the proposedLMS algorithm
18 0.06919 0.05720 0.05421 0.04922 0.04223 0.04024 0.036
3(0)3(1)3(2)3(3)3(4)3(5)3(6)3(7)3(8)3(9)3(10)3(11)3(12)3(13)3(14)3(15)3(16)3(17)3(18)3(19)3(20)3(21)3(22)3(23)3(24)
minimum
1.536488x103.447719x104.174231 *1C2.431601 x i c
-4.024336x10-1.666625x10-5.816835x10
8.875269x108.029092x10
-3.435238x10-7.202372x10
3.686717x106.081668x101.929877x10
-4.326399x10-3.308010x10
2.058543x102.967109x10
-6.750002x10-2.488348x10-1.596803x10
1.772376x104.046755x10
-1.803139x10-1.770762x10
compensator
-1 -2.499641 x 10-2
-1 1.228314 x i o - 2
-1 2.336778 x 1 0 " 2
- 1 4.842872 x 1 0 " 3
- 2 -1.933812 x i o - 2
-1 1.765100 x 1 0 - 3
- 2 5.329667 X 1 0 - 2
- 2 7.057930 x i o - 2
- 2 6.493063 x i o - 2
- 2 1.384016x10"- 2 3.079045x10-- 3 4.013638x10"-2 2.494347x10"- 2 -5.516310x10"- 2 -2 .262136x10-
2
- 2 -1.303380 x i o - 1
- 2 5.896616 x i o - 2
- 2 1.080444 x 10"1
- 3 1.127509 x 1 0 " 2
- 2 -6.119189 x 10-2
- 3 -2.607440 x 1 0 " 2
- 2 3.234728 x 1 0 " 2
- 3 2.488726 x i o - 2
- 2 -2.110865 x 1 0 - 2
- 2 -4.563276 x i o - 2
10
0.2 0.3 0.4 0.5frequency
-0.500
-0.750
- 4
2.0
0.420 0.840 1.260 1.680frequency x 10"1
2.100
0.1 .0.2 0.3 0.4 0.5
frequency
c
0.420 0.840 1.260 1.680 2.100
frequency x 10"'
d
Fig. 15 24th-order nonlinear phase lowpass filtera Log-gain response c Gain error curveb Desired and resultant phase responses within the passband d Resultant phase deviation within the passband
desiredresultant
1EE PROCEEDINGS, Vol. 134, Pt. G, No. 4, AUGUST 1987 179
Note that Pmax of the equivalent linear phase is a closematch to the phase compensator. For the minimumphase case Pmax varies with Nz as given in Table 8.
(b) Within the passband range the resultant phasefollows closely the desired one
(c) Table 9 shows a list of the filter coefficients of boththe minimum phase and phase compensator.
9 Conclusions
In this paper, a new approach to designing an entirefamily of FIR filters has been developed and demon-strated. In contrast to the approaches in the current liter-ature, the proposed LMS design does not differentiate inprinciple between linear phase and nonlinear phase. Sym-metry constraints for linear phase are incorporated asadditional optional parts to the filter specifications. Inthe case of linear phase, the designer gives the desiredgain response, its tolerance and the order; other casesrequire phase information. After this the algorithm isautomatic. When comparing the proposed LMS basedalgorithm with those of the popular Chebychev basedones, one can conclude that the results are optimum, andthe design algorithm is more flexible in that not only canit design the full range of optimum linear phase filters,but also any type of the nonlinear phase filter, using justthe one algorithm.
13 HOFSTETTER, E., OPPENHEIM, A.V., and SIEGEL, J.: 'Onoptimum nonrecursive digital filters'. Allerton Conference on Circuitand System Theory, Oct. 1971, pp. 789-798
14 PARKS, T.W., RABINER, L.R, and McCLELLAN, J.H.: 'On thetransition width of finite impulse response digital filters', IEEETrans., 1973, AU-21, (1), pp. 1 ^
15 RABINER, L.R., and HERRMANN, O.: 'The predictability ofcertain optimum finite impulse response digital filters', ibid., 1973,CT-20, (4), pp. 401-408
16 RABINER, L.R., and HERRMANN, O.: 'On the design ofoptimum FIR low pass filters with even impulse response duration'ibid., 1973, AU-21, (4), pp. 329-336
17 RABINER, L.R., KAISER, J.F., and SCHAFER, R.W.: 'Some con-siderations in the design of multiband finite impulse response digitalfilters', ibid., 1974, ASSP-22, (6), pp. 462-472
18 RABINER, L.R., and SCHAFER, R.W.: 'On the behavior ofminimas FIR digital Hilbert transformers', Bell Syst. Tech' J., 1974,53, (2), pp. 363-390
19 RABINER, L.R., and SCHAFER, R.W.: 'On the behaviour ofminimax relative error FIR digital differentiators' ibid., 1974, 53, (2),pp. 333-361
20 HERRMANN, O., RABINER, L.R., and CHAN, D.S.K.: 'Practicaldesign rules for optimum finite impulse response low-pass digitalfilters', ibid., 1973, 52, (6), pp. 769-799
21 RABINER, L.R.: 'Approximate design relationships for low passFIR digital filters', IEEE Trans., 1973, AU-21, (4), pp. 118-122
22 CORTELAZZO, G.: 'The use of multiple criterion optimization indigital filter design'. PhD Dissertation, University of Illinois,Urbana-Champaign, II., USA, 1983
9 References
1 RABINER, L.R., and GOLD, B.: 'Theory and application of digitalsignal processing' (Prentice-Hall, Englewood Cliffs, NJ, 1975)
2 HERRMANN, O.: 'Design of nonrecursive digital filters with linearphase', Electron. Lett., 1970, 6, (11), pp. 328-329
3 HOFSTETTER, E., OPPENHEIM, A.V., and SIEGEL, J.: 'A newtechnique for the design of non-recursive digital filters'. Proceedingsof Fifth Annual Princeton Conference on Information Sciences andSystems, March 1971, pp. 64-72
4 TUFTS, D.W., and FRANCIS, J.T.: 'Designing digital low-passfilters — comparison of some methods and criteria', IEEE Trans.,1970, AU-18, (4), pp. 487-494
5 RABINER, L.R.: 'Linear program design of finite impulse response(FIR) digital filters', ibid., 1972, AU-20, (4), pp. 280-288
6 PARKS, T.W., and McCLELLAN, J.H.: 'Chebychev approximationfor non-recursive digital filters with linear phase', ibid., 1972, CT-19,(2), pp. 189-194
7 RABINER, L.R., McCLELLAN, J.H., and PARKS, T.W.: 'FIRdigital filter design techniques using weighted Chebychev approx-imation', Proc. IEEE, 1975, 63, (4), pp. 595-610
8 McCLELLAN, J.H., PARKS, T.W., and RABINER, L.R.: 'A com-puter program for designing optimum FIR linear phase filters',IEEE Trans., 1973, AU-21, No. 6, pp. 506-526
9 WIDROW, B , TITCHENER, P.F., and GOOCH, R.P.: 'Adaptivedesign of digital filters'. IEEE International Conference on Acous-tics, Speech and Signal Processing, ICASSP, vol. 1, 1981, pp. 243-246
10 GOOCH, R.P.: 'Adaptive pole-zero filtering: the equation-errorapproach'. Ph.D. Dissertation, Stanford University, CA, USA, 1983
11 LIM, Y.C., and PARKER, S.R.: 'Discrete coefficient FIR digitalfilter design based upon an LMS criteria', IEEE Trans., 1983,CAS-30, (10), pp. 723-739
12 WIDROW, B., McLEOD, J.M, LAVIMORE, M.G., andJOHNSON, C.R.: 'Stationary and nonstationary learning character-istics of the LMS adaptive filters', ibid., 1976, ASSP-24, pp. 1151-1162
John S. Mason was appointed Lecturer inthe Department of Electrical Engineeringat the University College of Swansea in1973, after completing his postgraduatestudies at the University of Surrey, wherehe gained an MSc in systems engineeringand a PhD for studies in signal pro-cessing. His research interests revolveround digital signal processing andinclude computer speech processing,digital-filter design, and multimicro-
processor applications.
Nassim Nayef Chit was born in Kfarkala,Lebanon, in 1950. He graduated from theDepartment of Electrical and ElectronicEngineering, University of Technology ofBaghdad, Iraq, in 1979. He received theMSc degree from the University of Wales,UK in 1984 and is currently submittinghis work for the PhD degree from theUniversity of Wales, UK, both in electri-cal and electronic engineering. He was anelectrical technician for one year (1974-
1975) with the Hospital of American University of Beirut,Lebanon. From 1979 to 1981 he was an electricl engineer withElectro-Mechanical Engineering Company (EMEC) inBaghdad, Iraq. His research interests include digital signal pro-cessing, spectrum estimation and network and systems theory.
180 IEE PROCEEDINGS, Vol. 134, Pt. G, No. 4, AUGUST 1987