# Introduction to DSP - filtering: design by equiripple method

 FIR filter coefficients can be calculated using the window method. But the window methoddoes not correspond to any known form of optimisation. In fact it can be shown that the window method is not optimal - by which we mean, it does not produce the lowest possible number of filter coefficients that just meets the requirement. The art of FIR filter design by the window method lies in choosing the window function which meets your requirement with the minimum number of filter coefficients. If the window method design is not good enough we have two choices: use another window function and try again do something clever Remez Exchange algorithm is something clever. It uses a mathematical optimisation method. The following explanation is not mathematically correct, but since we are trying to get an idea of what is going on, and not trying to duplicate the thinking of geniuses, it is worth going through anyway. Using the window method to design a filter we might proceed manually as follows: choose a window function that we think will do calculate the filter coefficients check the actual filter's frequency response against the design goal if it overperforms, reduce the number of filter coefficients or relax the window function design try again until we find the filter with the lowest number of filter coefficients possible In a way, this is what the Remez Exchange algorithm does automatically. It iterates between the filter coefficients and the actual frequency response until it finds the filter that just meets the specification with the lowest possible number of filter coefficients. Actually, the Remez Exchange algorithm never really calculates the frequency response: but it does keep comparing the actual with the design goal. Remez was a Russian. Two Americans - Parks and McLellan - wrote a FORTRAN program to implement the Remez algorithm. So this type of filter designi s often called a Parks McLellan filter design. The Remez/Parks McLellan method produces a filter which just meets the specification without overperforming. Many of the window method designs actually perform better as you move further away from the passband: this is wasted performance, and means they are using more filter coefficients than they need. Similarly, many of the window method designs actually perform better than the specification within the passband: this is also wasted performance, and means they are using more filter coefficients than they need. The Remez/Parks McLellan method performs just as well as the specification but no better: one might say it produces the worst possible design that just meets the specification at the lowest possible cost - almost a definition of practical engineering. So Remez/Parks McLellan designs have equal ripple - up to the specification but no more - in both passband and stopband. This is why they are often called equiripple designs. The equiripple design produces the most efficient filters - that is, filters that just meet the specification with the least number of coefficients. But there are reasons why they might not be used in all cases: a particular filter shape may be desired, hence a choice of a particular window function equiripple is very time consuming - a design that takes a few seconds to complete using the window method can easily take ten or twenty minutes with the equiripple method the window method is very simple and easy to include in a program - for example, where one had to calculate a new filter according to some dynamically changing parameters there is no guarantee that the Remez Exchange algorithm will converge - it may converge to a false result (hence equiripple designs should always be checked): or it may not converge ever (resulting in hung computers, divide by zero errors and all sorts of other horrors) We hope you have found this course module to be helpful. Please contact us with your comments or suggestions.