You are on page 1of 3

ParksMcClellan filter design algorithm

The ParksMcClellan algorithm, published by James McClellan and Thomas Parks in 1972, is an iterative algorithm for finding the optimal Chebyshev finite impulse response (FIR) filter. The Parks McClellan algorithm is utilized to design and implement efficient and optimal FIR filters. It uses an indirect method for finding the optimal filter coefficients. The goal of the algorithm is to minimize the error in the pass and stop bands by utilizing the Chebyshev approximation. The ParksMcClellan algorithm is a variation of the Remez exchange algorithm, with the change that it is specifically designed for FIR filters. It has become a standard method for FIR filter design.

The algorithm
The ParksMcClellan Algorithm is implemented using the following steps: 1. Initialization: Choose an extremal set of frequences { i }. 2. Finite Set Approximation: Calculate the best Chebyshev approximation on the present (m) extremal set, giving a value for the min-max error on the present extremal set. 3. Interpolation: Calculate the error function E() over the entire set of frequencies using (2). 4. Look for local maxima of |E ()| on the set . 5. If max()|E ()| > , then update the extremal set to {i } by picking new frequencies (m) where |E ()| has its local maxima. Make sure that the error alternates on the ordered set of frequencies as described in (4) and (5). Return to Step 2 and iterate. 6. If max()|E ()| , then the algorithm is complete. Use the set {i } and the interpolation formula to compute an inverse discrete Fourier transform to obtain the filter coefficients. The ParksMcClellan Algorithm may be restated as the following steps: 1. Make an initial guess of the L+2 extremal frequencies. 2. Compute using the equation given. 3. Using Lagrange Interpolation, we compute the dense set of samples of A() over the passband and stopband. 4. Determine the new L+2 largest extrema. 5. If the alternation theorem is not satisfied, then we go back to (2) and iterate until the alternation theorem is satisfied. 6. If the alternation theorem is satisfied, then we compute h(n) and we are done. To gain a basic understanding of the ParksMcClellan Algorithm mentioned above, we can rewrite the algorithm above in a simpler form as: 1. Guess the positions of the extrema are evenly spaced in the pass and stop band. 2. Perform polynomial interpolation and re-estimate positions of the local extrema. 3. Move extrema to new positions and iterate until the extrema stop shifting.
[4] (m) (m) (0) (m) (m) (m+1) (m) (0) [1]

Explanation
The picture above on the right displays the various extremal frequencies for the plot shown. The extremal frequencies are the maximum and minimum points in the stop and pass bands. The stop band ripple is the lower portion of ripples on the bottom right of the plot and the pass band ripple is the upper portion of the ripples on the top left of the plot. The dashed lines going across the plot indicate the or maximum error. Given the positions of the extremal frequencies, there is a formula for the optimum or optimum error. Since we do not know the optimum or the exact positions of the extrema on the first attempt, we iterate. Effectively, we assume the positions of the extrema initially, and calculate . We then re-estimate and move the extrema and recalculate , or the error. We repeat this process until stops changing. The algorithm will cause the error to converge, generally within [5] ten to twelve iterations.

Additional notes
Before applying the Chebyshev approximation, a set of steps were necessary: 1. Define the set of basis function for the approximation, and 2. Exploit the fact that the pass and stop bands of bandpass filters would always be separated [1] by transition regions. Since FIR filters could be reduced to the sum of cosines case, the same core program could be used to perform all possible linear-phase FIR filters. In contrast to the Maximum Ripple approach, the band edges could now be specified ahead of time. To achieve an efficient implementation of the optimal filter design using the Park-McClellan algorithm, two difficulties have to be overcome: 1. Defining a flexible exchange strategy, and 2. Implementing a robust interpolation method.
[1]

In some sense, the programming involved the implementation and adaptation of a known algorithm for use in FIR filter design. Two faces of the exchange strategy were taken to make the program more efficient: 1. Allocating the extremal frequencies between the pass and stop bands, and 2. Enabling movement of the extremals between the bands as the program iterated.
[1]

At initialization, the number of extremals in the pass and stop band could be assigned by using the ratio of the sizes of the bands. Furthermore, the pass and stop band edge would always be placed in the extremal set, and the program's logic kept those edge frequencies in the extremal set. The movement between bands was controlled by comparing the size of the errors at all the candidate extremal frequencies and taking the largest. The second element of the algorithm was the interpolation step needed to evaluate the error function. They used a method called the Barycentric form of Lagrange interpolation, which was very robust. All conditions for the ParksMcClellan algorithm are based on Chebyshev's alternation theorem. The alternation theorem states that the polynomial of degree L that minimizes the maximum error will have at least L+2 extrema. The optimal frequency response will barely reach the maximum ripple [5] bounds. The extrema must occur at the pass and stop band edges and at either =0 or = or

both. Now the derivative of a polynomial of degree L is a polynomial of degree L-1, which can be zero [5] at most at L-1 places. So the maximum number of local extrema is the L-1 local extrema plus the 4 band edges, giving a total of L+3 extrema.

Pass and stop bands of a filter designed by the ParksMcClellan algorithm The y-axis is the frequency response H() and the x-axis are the various radian frequencies, i. It can be noted that the two frequences marked on the x-axis, p and s. pindicates the pass band cutoff frequency and s indicates the stop band cutoff frequency. The ripple like plot on the upper left is the pass band ripple and the ripple on the bottom right is the stop band ripple. The two dashed lines on the top left of the graph in dicate the p and the two dashed lines on the bottom right indicate the s. All other frequencies listed indicate the extremal frequencies of the frequency response plot. As a result there are six extremal frequencies, and then we add the pass band and stop band frequencies to give a total of eight extremal frequencies on the plot.

You might also like