You are here: Home » Content » Fir Filter Design: The Optimal Method

Fir Filter Design: The Optimal Method

Module by: Nguyen Huu Phuong

The Fourier transform associated with windowing FIR filter design method (which is usually just called the window design method) is rather general and simple but it does have some limitations, namely:
  • The passband and stopband ripples (deviations) are assumed equal whereas actually the ripple in the stopband is much smaer, thus is the method we over design the filter in the passband, this leads to an unnecessarily high filter order.
  • Even though in the method the error (section 5.3.4) is the smallest (LMS error) but the error (in the form of overshoot and undershoot) concentrates more near the discontinuity (regions on both sides of the transition band (s)).
In the 1970’s together with the method of frequency sampling, the FIR filter desgin method optimal also called Chebyshev appronimation, or Remez exchange, because all these terms are more or less related, was developed and used. In general the optimal method is more flexible and effective than the window method.

Equiripple filter

The window design method allows a tradeoff between the mainlobe width, transition width and sidelobe level. Usually the sidelobes near to the transition region(s) between the passband and stopband have large values (Fig.5.8, Fig.5.9 and Fig.5.13) hence causing large error between the designed and desired filter, whereas futher away form the transition(s) the error gets smaller. This raises an idea that if the error is distributed more evenly in the frequency interval 0ωπ0ωπ size 12{0 <= ω <= π} {}, we will have a better tradeoff between the ripple level, transition width, and the filter order. However such a tradeoff does not give the smallest LMS error. The optimal method accepts the same level of ripples (equiripple) in each of the passband and the stopband, but the two levels of ripples in the two bands can be determined separately (Fig.5.25).

Parks – McClellan algorithm

The specified filter parameters N,ωp,ωs,δp,δsN,ωp,ωs,δp,δs size 12{N,ω rSub { size 8{p} } ,ω rSub { size 8{s} } ,δ rSub { size 8{p} } ,δ rSub { size 8{s} } } {}(Fig.5.8 and Fig.5.9) interact one another, making the design difficult. The approach is to fix most of them (determined in advance) and let just a few variably. Two algorithms were developed in the 1970’s. In the algorithm by Herrmann and others N,δpN,δp size 12{N,δ rSub { size 8{p} } } {} and δsδs size 12{δ rSub { size 8{s} } } {}are fixed whereas ωp,ωsωp,ωs size 12{ω rSub { size 8{p} } ,ω rSub { size 8{s} } } {} are variable. In the algorithm by Parks and McClellan (and others) N,ωp,ωsN,ωp,ωs size 12{N,ω rSub { size 8{p} } ,ω rSub { size 8{s} } } {}, and the ratio δp/δsδp/δs size 12{δ rSub { size 8{p} } /δ rSub { size 8{s} } } {} are fixed, and only δpδp size 12{δ rSub { size 8{p} } } {}(or δsδs size 12{δ rSub { size 8{s} } } {}) is variable. The Parks-McClellan algorithm is more flexible and computational efficient, which is considered here.
In the following we only consider the case of linear phase FIR filter types 1 (FIR-1) (Fig.5.4a and Fig.5.5) although the method can be modificed to apply to the other three generalized linear phase FIR filters.
Remember for FIR-1 the design impulse response is symmetric
h(n)=h(n1)N=M/2nN=M/2(twosided) h(n)=h(n1)N=M/2nN=M/2(twosided) MathType@MTEF@5@5@+=feaagaart1ev2aaatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr4rNCHbGeaGqipDI8FfYJH8YrFfeuY=Hhbbf9v8qqaqFr0xc9pk0xbba9q8WqFfeaY=biLkVcLq=JHqpepeea0=as0Fb9pgeaYRXxe9vr0=vr0=vqpWqabeqabiGaciaacaqaaeaadaqaaqaaaOqaaiaadIgacaGGOaGaamOBaiaacMcacqGH9aqpcaWGObGaaiikaiaad6gacqGHsislcaaIXaGaaiykaiaaywW7caaMe8UaeyOeI0IaamOtaiabg2da9iabgkHiTiaad2eacaGGVaGaaGOmaiabgsMiJkaad6gacqGHKjYOcaWGobGaeyypa0Jaamytaiaac+cacaaIYaGaaGzbVlaacIcacaWG0bGaam4Daiaad+gacqGHsislcaWGZbGaamyAaiaadsgacaWGLbGaamizaiaacMcaaaa@5C08@ (1)
Since MM size 12{M} {} is even, M/2M/2 size 12{M/2} {} is an integer. The corresponding frequency response is
G(ω)= n=N N h G (n) e jωn = h G (0)+2 n=1 N h G (n)cosωn ( twosided ) G(ω)= n=N N h G (n) e jωn = h G (0)+2 n=1 N h G (n)cosωn ( twosided ) MathType@MTEF@5@5@+=feaagaart1ev2aaatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr4rNCHbGeaGqipDI8FfYJH8YrFfeuY=Hhbbf9v8qqaqFr0xc9pk0xbba9q8WqFfeaY=biLkVcLq=JHqpepeea0=as0Fb9pgeaYRXxe9vr0=vr0=vqpWqadeaabiGaaiaacaqaaeaadaqaaqaaaOabaeqabaGaam4raiaacIcacqaHjpWDcaGGPaGaeyypa0ZaaabCaeaacaWGObWaaSbaaSqaaiaadEeaaeqaaOGaaiikaiaad6gacaGGPaGaamyzamaaCaaaleqabaGaeyOeI0IaamOAaiabeM8a3jaad6gaaaaabaGaamOBaiabg2da9iabgkHiTiaad6eaaeaacaWGobaaniabggHiLdaakeaacaaMf8UaaGzbVlaaysW7cqGH9aqpcaWGObWaaSbaaSqaaiaadEeaaeqaaOGaaiikaiaaicdacaGGPaGaey4kaSIaaGOmamaaqahabaGaamiAamaaBaaaleaacaWGhbaabeaakiaacIcacaWGUbGaaiykaiGacogacaGGVbGaai4CaiabeM8a3jaad6gaaSqaaiaad6gacqGH9aqpcaaIXaaabaGaamOtaaqdcqGHris5aOGaaGzbVpaabmaabaGaaeiDaiaabEhacaqGVbGaeyOeI0Iaae4CaiaabMgacaqGKbGaaeyzaiaabsgaaiaawIcacaGLPaaaaaaa@722B@ (2)
Notice that G(ω)G(ω) size 12{G \( ω \) } {} is a periodic real funtion of ωω size 12{ω} {} but can be positive or negative. The filter can be made causal by shifting the two-sided (noncausal) hd(n)M/2hd(n)M/2 size 12{h rSub { size 8{d} } \( n \) matrix { } M/2} {} time indices to the future:
h(n)= h G (nM/2)=h(Mn), 0nM( causal ) h(n)= h G (nM/2)=h(Mn), 0nM( causal ) MathType@MTEF@5@5@+=feaagaart1ev2aaatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr4rNCHbGeaGqipDI8FfYJH8YrFfeuY=Hhbbf9v8qqaqFr0xc9pk0xbba9q8WqFfeaY=biLkVcLq=JHqpepeea0=as0Fb9pgeaYRXxe9vr0=vr0=vqpWqadeaabiGaaiaacaqaaeaadaqaaqaaaOqaaiaadIgacaGGOaGaamOBaiaacMcacqGH9aqpcaWGObWaaSbaaSqaaiaadEeaaeqaaOGaaiikaiaad6gacqGHsislcaWGnbGaai4laiaaikdacaGGPaGaeyypa0JaamiAaiaacIcacaWGnbGaeyOeI0IaamOBaiaacMcacaGGSaqbaeqabeqaaaqaaaaacaaIWaGaeyizImQaamOBaiabgsMiJkaad2eacaaMf8+aaeWaaeaacaqGJbGaaeyyaiaabwhacaqGZbGaaeyyaiaabYgaaiaawIcacaGLPaaaaaa@56EE@ (3)
The corresponding frequency response is Equation (5.23)
H(ω)= e jωM/2 G(ω)(causal) H(ω)= e jωM/2 G(ω)(causal) MathType@MTEF@5@5@+=feaagaart1ev2aaatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr4rNCHbGeaGqipDI8FfYJH8YrFfeuY=Hhbbf9v8qqaqFr0xc9pk0xbba9q8WqFfeaY=biLkVcLq=JHqpepeea0=as0Fb9pgeaYRXxe9vr0=vr0=vqpWqadeaabiGaaiaacaqaaeaadaqaaqaaaOqaaiaadIeacaGGOaGaeqyYdCNaaiykaiabg2da9iaadwgadaahaaWcbeqaaiabgkHiTiaadQgacqaHjpWDcaWGnbGaai4laiaaikdaaaGccaWGhbGaaiikaiabeM8a3jaacMcacaaMf8UaaiikaiaadogacaWGHbGaamyDaiaadohacaWGHbGaamiBaiaacMcacaaMf8oaaa@5004@ (4)
Notice that this is the same as Equation (5.22).
The function cosωncosωn size 12{"cos"ωn} {}can be expressed in term of a power sum of cosωcosω size 12{"cos"ω} {} and we write the designed frequency response G(ω)G(ω) size 12{G \( ω \) } {} as
G(ω)=k=0Nak(cosω)kG(ω)=k=0Nak(cosω)k size 12{G \( ω \) = Sum cSub { size 8{k=0} } cSup { size 8{N} } {a rSub { size 8{k} } \( "cos"ω \) rSup { size 8{k} } } } {}(5)
which is an Nth order polynomial of cosωcosω size 12{"cos"ω} {}, where the coefficients depends on the impulse response hG(n)hG(n) size 12{h rSub { size 8{G} } \( n \) } {}. Thus G(ω)G(ω) size 12{G \( ω \) } {} is of the form
G(ω)=n=0NanxnG(ω)=n=0Nanxn size 12{G \( ω \) = Sum cSub { size 8{n=0} } cSup { size 8{N} } {a rSub { size 8{n} } x rSup { size 8{n} } } } {}(6)
a polynomial of order N of variable xx size 12{x} {}. In general G(ω)G(ω) size 12{G \( ω \) } {}is a Chelyshev polynomial but for our case it is just a trigonometric polynomial.
In the problem of approximantion or optimality we must specify a criterion. To this end, we define a weighted error function E(ω)E(ω) size 12{E \( ω \) } {}, which is the difference between the desired and designed frequency function W(ω)W(ω) size 12{W \( ω \) } {}
E(ω)=W(ω)[Hd(ω)G(ω)],0ωπE(ω)=W(ω)[Hd(ω)G(ω)],0ωπ size 12{E \( ω \) =W \( ω \) \[ H rSub { size 8{d} } \( ω \) - G \( ω \) \] , matrix { {} # {} # {} } 0 <= ω <= π} {}(7)
Remember Hd(ω)Hd(ω) size 12{H rSub { size 8{d} } \( ω \) } {} equals 1 in the passband and equals 0 in the stopband. The positive weighting function W(ω)W(ω) size 12{W \( ω \) } {}allows us to weight the relative importance (degree of deviation) of each frequency band. For the lowpass filter with G(ω)G(ω) size 12{G \( ω \) } {}having passband ripple δpδp size 12{δ rSub { size 8{p} } } {} and the stopband ripple δsδs size 12{δ rSub { size 8{s} } } {}then the weighting function is chosen as
W(ω)=1,0ω ω p δ p δ s , ω p ωπ W(ω)=1,0ω ω p δ p δ s , ω p ωπ MathType@MTEF@5@5@+=feaagaart1ev2aaatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr4rNCHbGeaGqipDI8FfYJH8YrFfeuY=Hhbbf9v8qqaqFr0xc9pk0xbba9q8WqFfeaY=biLkVcLq=JHqpepeea0=as0Fb9pgeaYRXxe9vr0=vr0=vqpWqadeaabiGaaiaacaqaaeaadaqaaqaaaOabaeqabaGaam4vaiaacIcacqaHjpWDcaGGPaGaeyypa0JaaGymaiaaywW7caGGSaGaaGzbVlaaywW7caaMe8UaaGimaiabgsMiJkabeM8a3jabgsMiJkabeM8a3naaBaaaleaacaWGWbaabeaaaOqaaiaaywW7caaMf8UaaGzbVxaabeqabeaaaeaadaWcaaqaaiabes7aKnaaBaaaleaacaWGWbaabeaaaOqaaiabes7aKnaaBaaaleaacaWGZbaabeaaaaGccaaMf8UaaiilaiaaywW7caaMf8oaaiabeM8a3naaBaaaleaacaWGWbaabeaakiabgsMiJkabeM8a3jabgsMiJkabec8aWbaaaa@654A@ (8)
For example with δp=0.01,δs=0.001δp=0.01,δs=0.001 size 12{δ rSub { size 8{p} } =0 "." "01", matrix { } δ rSub { size 8{s} } =0 "." "001"} {}we will use weight 1 for the passband and weight δp/δs=10δp/δs=10 size 12{δ rSub { size 8{p} } /δ rSub { size 8{s} } ="10"} {}for the stopband. Another example is with a bandpass filter with δp/δs=2.5δp/δs=2.5 size 12{δ rSub { size 8{p} } /δ rSub { size 8{s} } =2 "." 5} {}we can use weights 2.5, 1, 2.5 for the three bands (with weight 1 for the passband), or weights (10, 4, 10) for the three bands.
In the Chebyshev approximation the crux is to determine the coefficients anan size 12{a rSub { size 8{n} } } {}, 0nN0nN size 12{0 <= n <= N} {}, to minimize E(ω)E(ω) size 12{ lline E \( ω \) rline } {}. However FIR filter design by the Chebyshev approximation has to rely on the Reme exchange algorithm to be practical. The specific algorithm is to minimize the maximum of the magnitude of the error E(ω)E(ω) size 12{ lline E \( ω \) rline } {} across the specificed passband and stopband, thus the term minimax algorithm:
min( max| E(ω) | ) ωF min( max| E(ω) | ) ωF MathType@MTEF@5@5@+=feaagaart1ev2aaatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr4rNCHbGeaGqipDI8FfYJH8YrFfeuY=Hhbbf9v8qqaqFr0xc9pk0xbba9q8WqFfeaY=biLkVcLq=JHqpepeea0=as0Fb9pgeaYRXxe9vr0=vr0=vqpWqadeaabiGaaiaacaqaaeaadaqaaqaaaOabaeqabaGaciyBaiaacMgacaGGUbWaaeWaaeaaciGGTbGaaiyyaiaacIhadaabdaqaaiaadweacaGGOaGaeqyYdCNaaiykaaGaay5bSlaawIa7aaGaayjkaiaawMcaaaqaaiaaywW7caaMf8UaaGzbVlabeM8a3jabgIGiolaadAeaaaaa@4D10@ (9)
Where F is the specified close subset in the frequency interval 0ωπ0ωπ size 12{0 <= ω <= π} {}. Notice that in this method the transition band is not specified. After the coefficients a(n)a(n) size 12{a \( n \) } {}have been determined, the impulse response hG(n)hG(n) size 12{h rSub { size 8{G} } \( n \) } {} of the designed frequency frequency response G(ω)G(ω) size 12{G \( ω \) } {} is deduced. The Remez exchange algorithm is based on the alternation theorem to solve the approximation problem. In our case the theorem may be interpreted as follows.

Alternation theoren

Let F denote the disjoint union of closed subsets over the frequency interval 0ωπ0ωπ size 12{0 <= ω <= π} {}, positive weighting function W(ω)W(ω) size 12{W \( ω \) } {} is defined in Equation (5.62), the designed frequency response G(ω)G(ω) size 12{G \( ω \) } {} is the polynomial Equation (5.61), the maximum of the magnitude of the weighted error funtion E(ω)E(ω) size 12{E \( ω \) } {} is denoted by εε size 12{ε} {} :
min( max| E(ω) | ) ωF min( max| E(ω) | ) ωF MathType@MTEF@5@5@+=feaagaart1ev2aaatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr4rNCHbGeaGqipDI8FfYJH8YrFfeuY=Hhbbf9v8qqaqFr0xc9pk0xbba9q8WqFfeaY=biLkVcLq=JHqpepeea0=as0Fb9pgeaYRXxe9vr0=vr0=vqpWqadeaabiGaaiaacaqaaeaadaqaaqaaaOabaeqabaGaciyBaiaacMgacaGGUbWaaeWaaeaaciGGTbGaaiyyaiaacIhadaabdaqaaiaadweacaGGOaGaeqyYdCNaaiykaaGaay5bSlaawIa7aaGaayjkaiaawMcaaaqaaiaaywW7caaMf8UaaGzbVlabeM8a3jabgIGiolaadAeaaaaa@4D10@ (10)
Figure 1: 10 alternations of optimal equiripple FIR filter of order 8 (all indicated points are alternations)
A necessary and sufficient condtion for G(ω)G(ω) size 12{G \( ω \) } {} to be an unigne function that minimizes εε size 12{ε} {} over the frequency union F is that E(ω)E(ω) size 12{E \( ω \) } {} must have at least N+2N+2 size 12{N+2} {} alternations (positive and negative peaks of ripples), which are the extremal frequencies, ω0<ω1...<ωN+1ω0<ω1...<ωN+1 size 12{ω rSub { size 8{0} } <ω rSub { size 8{1} } "." "." "." <ω rSub { size 8{N+1} } } {}, and such that
E( ω i )=E( ω i+1 )=±ε , i=1,2,...,N+1 E( ω i )=E( ω i+1 )=±ε , i=1,2,...,N+1 MathType@MTEF@5@5@+=feaagaart1ev2aaatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr4rNCHbGeaGqipDI8FfYJH8YrFfeuY=Hhbbf9v8qqaqFr0xc9pk0xbba9q8WqFfeaY=biLkVcLq=JHqpepeea0=as0Fb9pgeaYRXxe9vr0=vr0=vqpWqabeqabiGaciaacaqaaeaadaqaaqaaaOqaaiaadweacaGGOaGaeqyYdC3aaSbaaSqaaiaadMgaaeqaaOGaaiykaiabg2da9iabgkHiTiaadweacaGGOaGaeqyYdC3aaSbaaSqaaiaadMgacqGHRaWkcaaIXaaabeaakiaacMcacqGH9aqpcqGHXcqScqaH1oqzfaqabeqabaaabaaaaiaacYcafaqabeqabaaabaaaaiaadMgacqGH9aqpcaaIXaGaaiilaiaaikdacaGGSaGaaiOlaiaac6cacaGGUaGaaiilaiaad6eacqGHRaWkcaaIXaaaaa@531D@ (11)
Taking the derivative of Equation (5.60), we have
d G (ω) dω =sinω n=1 N n a n (cosω) k1 d G (ω) dω =sinω n=1 N n a n (cosω) k1 MathType@MTEF@5@5@+=feaagaart1ev2aaatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr4rNCHbGeaGqipDI8FfYJH8YrFfeuY=Hhbbf9v8qqaqFr0xc9pk0xbba9q8WqFfeaY=biLkVcLq=JHqpepeea0=as0Fb9pgeaYRXxe9vr0=vr0=vqpWqabeqabiGaciaacaqaaeaadaqaaqaaaOqaamaalaaabaGaamizamaaBaaaleaacaWGhbaabeaakiaacIcacqaHjpWDcaGGPaaabaGaamizaiabeM8a3baacqGH9aqpcqGHsislciGGZbGaaiyAaiaac6gacqaHjpWDdaaeWbqaaiaad6gacaWGHbWaaSbaaSqaaiaad6gaaeqaaOGaaiikaiGacogacaGGVbGaai4CaiabeM8a3jaacMcadaahaaWcbeqaaiaadUgacqGHsislcaaIXaaaaaqaaiaad6gacqGH9aqpcaaIXaaabaGaamOtaaqdcqGHris5aaaa@55F0@ (12)
Because sinω=0sinω=0 size 12{"sin"ω=0} {} at ω=0ω=0 size 12{ω=0} {} and ππ size 12{π} {} then there should always be a maximum or a minimum at these two frequencies but these may not be alternations (because they don’t reach the peak or bottom of the set values ±δp±δp size 12{ +- δ rSub { size 8{p} } } {} or ±δs±δs size 12{ +- δ rSub { size 8{s} } } {}).
The alternations mentioned means that the optimum filter is equiripple. The theorem specifics the least number of alternations is N+2N+2 size 12{N+2} {}, but there may be one or a few more, depending on filters. Also the adjacent alternations must be alternate sign. For example, the 8th order filter in Fig.5.25 has 10 vaid alternations (including the one at ωpωp size 12{ω rSub { size 8{p} } } {} and ωpωp size 12{ω rSub { size 8{p} } } {}) and is thus an optimal equiripple filter, whereas the 8th order filter in Fig.5.26 only 7 valid alternations and thus is not an optimal equiripple filter.
Figure 2: Alternations of an equiripple FIR filter of order 8 (The points (a), (b) and (c) are not alternations). The filter is not optimal...
Equation (5.60) shows that G(ω)G(ω) size 12{G \( ω \) } {} is an Nth order polynonial in cosωcosω size 12{"cos"ω} {}. Thus it can have at most N1N1 size 12{N - 1} {} local minimam and maximam in the frequency interval 0ωπ.G(ω)0ωπ.G(ω) size 12{0 <= ω <= π matrix { "." matrix { } } G \( ω \) } {}also has extrena at ω=0ω=0 size 12{ω=0} {} and ω=πω=π size 12{ω=π} {} as said. At the bandedge frequency ωpωp size 12{ω rSub { size 8{p} } } {}, the weighted error can be a minimum, and at the bandedge frequency ωsωs size 12{ω rSub { size 8{s} } } {} it can be a maximum. Thus there can be at most N1+2+2=N+3 N1+2+2=N+3 MathType@MTEF@5@5@+=feaagaart1ev2aaatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr4rNCHbGeaGqipDI8FfYJH8YrFfeuY=Hhbbf9v8qqaqFr0xc9pk0xbba9q8WqFfeaY=biLkVcLq=JHqpepeea0=as0Fb9pgeaYRXxe9vr0=vr0=vqpWqabeqabiGaciaacaqaaeaadaqaaqaaaOqaaiaad6eacqGHsislcaaIXaGaey4kaSIaaGOmaiabgUcaRiaaikdacqGH9aqpcaWGobGaey4kaSIaaG4maaaa@3F32@ extremal frequencies of |E(ω)| |E(ω)| MathType@MTEF@5@5@+=feaagaart1ev2aaatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr4rNCHbGeaGqipDI8FfYJH8YrFfeuY=Hhbbf9v8qqaqFr0xc9pk0xbba9q8WqFfeaY=biLkVcLq=JHqpepeea0=as0Fb9pgeaYRXxe9vr0=vr0=vqpWqabeqabiGaciaacaqaaeaadaqaaqaaaOqaaiaacYhacaWGfbGaaiikaiabeM8a3jaacMcacaGG8baaaa@3BF3@ .

Remez exchange algorithm

From the alternation theorem, to arrive at the optimum approximation we need to solve N+2 N+2 MathType@MTEF@5@5@+=feaagaart1ev2aaatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr4rNCHbGeaGqipDI8FfYJH8YrFfeuY=Hhbbf9v8qqaqFr0xc9pk0xbba9q8WqFfeaY=biLkVcLq=JHqpepeea0=as0Fb9pgeaYRXxe9vr0=vr0=vqpWqabeqabiGaciaacaqaaeaadaqaaqaaaOqaaiaad6eacqGHRaWkcaaIYaaaaa@3874@ equations
W(ω)Hd(ω)G(ω)=(1)nε,i=0,1,2,...,N+1W(ω)Hd(ω)G(ω)=(1)nε,i=0,1,2,...,N+1 size 12{W \( ω \) left [H rSub { size 8{d} } \( ω \) - G \( ω \) right ]= \( - 1 \) rSup { size 8{n} } ε, matrix { {} # {} } i=0,1,2, "." "." "." ,N+1} {}(13)
where εε size 12{ε} {} is given in Equation (5.65). The above N+2 N+2 MathType@MTEF@5@5@+=feaagaart1ev2aaatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr4rNCHbGeaGqipDI8FfYJH8YrFfeuY=Hhbbf9v8qqaqFr0xc9pk0xbba9q8WqFfeaY=biLkVcLq=JHqpepeea0=as0Fb9pgeaYRXxe9vr0=vr0=vqpWqabeqabiGaciaacaqaaeaadaqaaqaaaOqaaiaad6eacqGHRaWkcaaIYaaaaa@3874@ equations can be written in the matrix form in term of the unknown coefficients anan size 12{a rSub { size 8{n} } } {}:
[ 1 x 0 x 0 2 ... x 0 N 1 W( ω 0 ) 1 x 0 x 0 2 ... x 0 N 1 W( ω 1 ) 1 x N x N 2 ... x N N (1) N W( ω N ) 1 x N+1 x N+1 2 ... x N+1 N (1) N+1 W( ω N+1 ) ][ a 0 a 1 a L ε ]=[ G( ω 0 ) G( ω 1 ) G( ω N ) G( ω N+1 ) ] [ 1 x 0 x 0 2 ... x 0 N 1 W( ω 0 ) 1 x 0 x 0 2 ... x 0 N 1 W( ω 1 ) 1 x N x N 2 ... x N N (1) N W( ω N ) 1 x N+1 x N+1 2 ... x N+1 N (1) N+1 W( ω N+1 ) ][ a 0 a 1 a L ε ]=[ G( ω 0 ) G( ω 1 ) G( ω N ) G( ω N+1 ) ] MathType@MTEF@5@5@+=feaagaart1ev2aaatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLnhiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr4rNCHbGeaGqipDI8FfYJH8YrFfeuY=Hhbbf9v8qqaqFr0xc9pk0xbba9q8WqFfeaY=biLkVcLq=JHqpepeea0=as0Fb9pgeaYRXxe9vr0=vr0=vqpWqabeqabiGaciaacaqaaeaadaqaaqaaaOqaamaadmaaeaqabeaacaaIXaGaaGzbVlaaywW7caWG4bWaaSbaaSqaaiaaicdaaeqaaOGaaGzbVlaaywW7caWG4bWaa0baaSqaaiaaicdaaeaacaaIYaaaaOGaaGjbVlaac6cacaGGUaGaaiOlaiaaysW7caaMf8UaamiEamaaDaaaleaacaaIWaaabaGaamOtaaaakiaaywW7caaMf8+aaSaaaeaacaaIXaaabaGaam4vaiaacIcacqaHjpWDdaWgaaWcbaGaaGimaaqabaGccaGGPaaaaaqaaiaaigdacaaMf8UaaGzbVlaadIhadaWgaaWcbaGaaGimaaqabaGccaaMf8UaaGzbVlaadIhadaqhaaWcbaGaaGimaaqaaiaaikdaaaGccaaMe8UaaiOlaiaac6cacaGGUaGaaGjbVlaaywW7caWG4bWaa0baaSqaaiaaicdaaeaacaWGobaaaOGaaGzbVlaaywW7daWcaaqaaiabgkHiTiaaigdaaeaacaWGxbGaaiikaiabeM8a3naaBaaaleaacaaIXaaabeaakiaacMcaaaaabaGaeSO7I0KaaGzbVlaaywW7caaMe8UaeSO7I0KaaGzbVlaaywW7caaMe8UaaGjbVlaaysW7cqWIUlstcaaMf8UaaGzbVlaaywW7cqWIUlstaeaacaaIXaGaaGzbVlaaywW7caWG4bWaaSbaaSqaaiaad6eaaeqaaOGaaGzbVlaaywW7caWG4bWaa0baaSqaaiaad6eaaeaacaaIYaaaaOGaaGjbVlaac6cacaGGUaGaaiOlaiaaysW7caaMf8UaamiEamaaDaaaleaacaWGobaabaGaamOtaaaakiaaywW7caaMf8+aaSaaaeaacaGGOaGaeyOeI0IaaGymaiaacMcadaahaaWcbeqaaiaad6eaaaaakeaacaWGxbGaaiikaiabeM8a3naaBaaaleaacaWGobaabeaakiaacMcaaaaabaGaaGymaiaaywW7caaMf8UaamiEamaaBaaaleaacaWGobGaey4kaSIaaGymaaqabaGccaaMf8UaaGzbVlaadIhadaqhaaWcbaGaamOtaiabgUcaRiaaigdaaeaacaaIYaaaaOGaaGjbVlaac6cacaGGUaGaaiOlaiaaysW7caaMf8UaamiEamaaDaaaleaacaWGobGaey4kaSIaaGymaaqaaiaad6eaaaGccaaMf8UaaGzbVpaalaaabaGaaiikaiabgkHiTiaaigdacaGGPaWaaWbaaSqabeaacaWGobGaey4kaSIaaGymaaaaaOqaaiaadEfacaGGOaGaeqyYdC3aaSbaaSqaaiaad6eacqGHRaWkcaaIXaaabeaakiaacMcaaaaaaiaawUfacaGLDbaadaWadaabaeqabaGaamyyamaaBaaaleaacaaIWaaabeaaaOqaaaqaaiaadggadaWgaaWceaqabeaacaaIXaaabaaaaeqaaaGcbaGaeSO7I0eabaGaamyyamaaBaaalqaabeqaaiaadYeaaeaaaaqabaaakeaaaeaacqaH1oqzaaGaay5waiaaw2faaiabg2da9maadmaaeaqabeaacaWGhbGaaiikaiabeM8a3naaBaaaleaacaaIWaaabeaakiaacMcaaeaaaeaacaWGhbGaaiikaiabeM8a3naaBaaalqaabeqaaiaaigdaaeaaaaqabaGccaGGPaaabaGaeSO7I0eabaGaam4raiaacIcacqaHjpWDdaWgaaWceaqabeaacaWGobaabaaaaeqaaOGaaiykaaqaaaqaaiaadEeacaGGOaGaeqyYdC3aaSbaaSqaaiaad6eacqGHRaWkcaaIXaaabeaakiaacMcaaaGaay5waiaaw2faaaaa@FE4F@ (14)
Where xi=cosωixi=cosωi size 12{x rSub { size 8{i} } ="cos"ω rSub { size 8{i} } } {}. If the extremal frequencies ωiωi size 12{ω rSub { size 8{i} } } {} are known, the above set of equations may be solved for the unknown coefficents aiai size 12{a rSub { size 8{i} } } {} and maximum error εε size 12{ε} {}, from which the optimum