Signal Processing Toolbox Help Desk

remez

Purpose

Parks-McClellan optimal FIR filter design.

Syntax

Description

remez designs a linear-phase FIR filter using the Parks-McClellan algorithm [1]. The Parks-McClellan algorithm uses the Remez exchange algorithm and Chebyshev approximation theory to design filters with an optimal fit between the desired and actual frequency responses. The filters are optimal in the sense that the maximum error between the desired frequency response and the actual frequency response is minimized. Filters designed this way exhibit an equiripple behavior in their frequency responses and hence are sometimes called equiripple filters.

b = remez(n,f,a) returns row vector b containing the n+1 coefficients of the order n FIR filter whose frequency-amplitude characteristics match those given by vectors f and a.

The output filter coefficients (taps) in b obey the symmetry relation

Vectors f and a specify the frequency-magnitude characteristics of the filter:

The relationship between the f and a vectors in defining a desired frequency response is

remez(n,f,a,w) uses the weights in vector w to weight the fit in each frequency band. The length of w is half the length of f and a, so there is exactly one weight per band.

b = remez(n,f,a,'ftype') and

b = remez(n,f,a,w,'ftype') specify a filter type, where ftype is

Example

Graph the desired and actual frequency responses of a 17th-order Parks-McClellan bandpass filter:

Algorithm

remez is a MEX-file version of the original FORTRAN code from [1], altered to design arbitrarily long filters with arbitrarily many linear bands.

remez designs type I, II, III, and IV linear-phase filters. Type I and Type II are the defaults for n even and n odd, respectively, while Type III (n even) and Type IV (n odd) are obtained with the 'hilbert' and 'differentiator' flags. The different types of filters have different symmetries and certain constraints on their frequency responses (see reference [5] for more details):

Linear Phase Filter type


Filter Order n



Symmetry of Coefficients


Response H(f), f = 0


Response H(f), f = 1 (Nyquist)

Type I

Even

even:

No restriction

No restriction

Type II

Odd

No restriction

H(1) = 0

Type III

Even

odd:

H(0) = 0

H(1) = 0

Type IV

Odd

H(0) = 0

No restriction

Diagnostics

An appropriate diagnostic message is displayed if incorrect arguments are used:

A more serious warning message is

In the rare event that you see this message, it is possible that the filter design may still be correct. Verify the design by checking its frequency response.

See Also

butter

Butterworth analog and digital filter design.

cheby1

Chebyshev type I filter design (passband ripple).

cheby2

Chebyshev type II filter design (stopband ripple).

cremez

Complex and nonlinear-phase equiripple FIR filter design

ellip

Elliptic (Cauer) filter design.

fir1

Window-based finite impulse response filter design-- standard response.

fir2

Window-based finite impulse response filter design-- arbitrary response.

fircls

Constrained least square FIR filter design for multiband filters.

fircls1

Constrained least square filter design for lowpass and highpass linear phase FIR filters.

firls

Least square linear-phase FIR filter design.

firrcos

Raised cosine FIR filter design.

remezord

Parks-McClellan optimal FIR filter order estimation.

yulewalk

Recursive digital filter design.

References

[1] IEEE. Programs for Digital Signal Processing. IEEE Press. New York: John Wiley & Sons, 1979. Algorithm 5.1.

[2] IEEE. Selected Papers in Digital Signal Processing, II. IEEE Press. New York: John Wiley & Sons, 1979.

[3] Parks, T.W., and C.S. Burrus. Digital Filter Design. New York: John Wiley & Sons, 1987. Pg. 83.

[4] Rabiner, L.R., J.H. McClellan, and T.W. Parks. "FIR Digital Filter Design Techniques Using Weighted Chebyshev Approximations." Proc. IEEE 63 (1975).

[5] Oppenheim, A.V., and R.W. Schafer. Discrete-Time Signal Processing. Englewood Cliffs, NJ: Prentice Hall, 1989. Pgs. 256-266.



[ Previous | Help Desk | Next ]