# 5.3. Optimal approach of equal ripple in the stop-band and passband – Digital Filters Design for Signal and Image Processing

## 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 Hr(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. Figure 5.18. Frequency response of a normalized passband filter

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 Hr(f) to be the sole solution approximating the desired frequency response Hideal(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 (fi) 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 fp as the maximum frequency of the passband and fa as the minimal frequency of the attenuated band, we can represent the desired response as follows: 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 fi 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 fi;

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 Hr(fi). Using the initial formula in equation (5.66), we can easily evaluate Hr (fi) as follows: 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 Hr (f) on a selected dense interval of frequencies. The frequency response in this interval is expressed from Hr (fi) as follows: where 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 fi 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 fi 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 (fp, fa δ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 = fafp.