is to minimize the average group delay r i lt 1 for i 1 2 m u03b4 p2 u2266 a u03c9 u u2266 u03b4 p1 for u03c9 u03b5 u03c9 p the first constraint gives an equiripple pass band specification the third constraint seems trivial however it is added to circumvent spurious peaks that are frequently encountered in the transition band of the final solution after numerical optimization the thresholds in the above inequalities are derived from the initial filter template this constraint may be added to prevent possible negative group delay that may not be appropriate in some applications this problem is a constrained nonlinear optimization problem to solve it we need to digitize the frequency u03c9 such that the magnitude constraints can be put in a standard form in this case the magnitude constraints can be written as g i p u u03b4 p1 u2212 a u03c9 i u u2266 0 for 0 for u03c9 i u03b5 u03c9 p f i p u a u03c9 i u u2212 u03b4 p1 u2266 0 for u03c9 i u03b5 u03c9 p g i s u u03b4 s a u03c9 i u 0 for u03c9 i u03b5 u03c9 s g i t u u03b4 p2 u2212 a u03c9 i u 0 for u03c9.