## 5.3. Optimal approach of equal ripple in the stop-band and passband

Finding an optimal solution to the problem of the amplitude approximation of specifications is obtained by minimizing a distance criterion between the theoretical frequency responses and those brought about by synthesis.

To present this approach, we will consider a low-pass linear phase FIR filter of type II (see equations (5.30) and (5.31)); that is, with a symmetrical impulse response and a choice of *N* odd response.

We then introduce the quantities:

We have seen that in equations (5.30) and (5.31), the related transfer function satisfies the formula:

Taking into account equation (5.56), equation (5.57) is written as follows:

To simplify matters, we only consider the quantity *H _{r}*(

*f*), which determines the amplitude:

The problem is in estimating the coefficients *b*(*n*) so that the frequency response is optimal by distributing the approximation error in the passband and the attenuated band.

We write δ_{1} and δ_{2} respectively for the maximum ripple level in the passband and attenuated band.

According to Chebyshev's alternance theorem on the polynomial approximation theory, for *H _{r}*(

*f*) to be the sole solution approximating the desired frequency response

*H*(

_{ideal}*f*) in a sub-interval C of , a necessary and sufficient condition is that the error function:

presents at least extrema for a range of frequencies in C (with *m* integer).

According to this principle, we obtain for frequencies (i.e., *m* = 1) ranging in increasing order an error function that alternatively takes the opposing values:

We then propose δ as the maximum error value (*f _{i}*) for .

This principle remains valid when we introduce a weighting function *W*(*f*) on the error, so that:

This function *W*(*f*) allows us to condition the relative error in the passband and the stop-band (according to the specifications being used). With low-pass filters, we can introduce, for example, the following formula:

If we introduce *f _{p}* as the maximum frequency of the passband and

*f*as the minimal frequency of the attenuated band, we can represent the desired response as follows:

_{a}With equations (5.62), (5.63), and (5.64), we then have:

The problem of estimating the coefficients *b*(*n*) is then reformulated as follows:

From the results obtained in equation (5.66) obtained for we can obtain a matricial relation to estimate the coefficients of the impulse response *b*(*n*):

The Remez algorithm is a procedure used to determine the range of frequencies *f _{i}* and the corresponding maximum error δ necessary for the resolution of the matricial system in equation (5.67). The steps of this approach are as follows:

– *step 1* is the initialization phase that consists of selecting the order of the filter and the initial range of frequencies *f _{i}*;

– *step* 2 is the calculation of the corresponding maximum error δ based on equation (5.67) and leading to:

where:

– *step* 3 is the evaluation of *H _{r}*(

*f*). Using the initial formula in equation (5.66), we can easily evaluate

_{i}*H*(

_{r}*f*) as follows:

_{i}– *step* 4 is the evaluation of the error for a dense interval of frequencies. To know if δ is really the maximum, the Lagrange interpolation makes it possible to estimate the values of *H _{r}* (

*f*) on a selected dense interval of frequencies. The frequency response in this interval is expressed from

*H*(

_{r}*f*) as follows:

_{i}We can deduce from this the error occurring between the desired filter and the obtained filter on the dense interval of frequencies:

If for all the frequencies of the dense domain, the optimal solution is found. Otherwise, another range of frequencies *f _{i}* must be chosen and we begin the procedure again from Step 2.

COMMENT 5.3.– the order of the filter can be modified.

– *Step* 5 is the calculation of the coefficients of the impulse response of the filter.

Once Step 3 has been validated, the optimal values *f _{i}* as well as δ are used to calculate the coefficients

*b*(

*n*) from the matricial system in equation (5.67).

COMMENT 5.4.– in order to avoid the matricial inversion, a technique based on the fast Fourier transform exists and can be used.

The advantage of this technique as relates to the windowing method is related to the control of specifications parameters (*f _{p}*,

*f*δ

_{a}_{1}, δ

_{2}), which are difficult to adjust with other methods. As well, the approach used in the Kaiser technique allows for an estimated order with the following formula:

where Δ*f* is the width of the transition band represented by Δ*f* = *f _{a}* −

*f*.

_{p}