Signal Processing Toolbox Help Desk

cremez

Purpose

Complex and nonlinear-phase equiripple FIR filter design

Syntax

Description

cremez allows arbitrary frequency-domain constraints to be specified for the design of a possibly complex FIR filter. The Chebyshev (or minimax) filter error is optimized, producing equiripple FIR filter designs.

b = cremez(n,f,'fresp') returns a length n+1 FIR filter with the best approximation to the desired frequency response as returned by function fresp. f is a vector of frequency bandedge pairs, specified in the range -1 and 1, where 1 corresponds to half the sampling frequency (the Nyquist frequency). The frequencies must be in increasing order, and f must have even length. The frequency bands span f(k) to f(k+1) for k odd; the intervals f(k+1) to f(k+2) for k odd are "transition bands" or "don't care" regions during optimization.

b = cremez(n,f,'fresp',w) uses the real, non-negative weights in vector w to weight the fit in each frequency band. The length of w is half the length of f, so there is exactly one weight per band.

b = cremez(n,f,{'fresp',p1,p2,...},...) supplies optional parameters p1, p2, ..., to the frequency response function fresp. Predefined frequency response functions for 'fresp' include the following design filters with the appropriate frequency response. For all of the predefined frequency response functions, the symmetry option 'sym' defaults to 'even' if no negative frequencies are contained in f and d = 0; otherwise 'sym' defaults to 'none'. (See the 'sym' option below for details.) For all of the predefined frequency response functions, d specifies a group-delay offset such that the filter response will have a group delay of n/2+d in units of the sample interval. Negative values create less delay; positive values create more delay. By default, d = 0.

b = cremez(n,f,a,w) is a synonym for b = cremez(n,f,{'multiband',a},w).

b = cremez(..., 'sym') imposes a symmetry constraint on the impulse response of the design, where 'sym' may be

If any 'sym' option other than 'none' is specified, the band edges should only be specified over positive frequencies; the negative frequency region will be filled in from symmetry. If not specified, the 'fresp' function will be queried for a default setting.

b = cremez(..., 'skip_stage2') disables the second-stage optimization algorithm, which executes only when cremez determines that an optimal solution has not been reached by the standard Remez error-exchange. Disabling this algorithm may increase the speed of computation, but may incur a reduction in accuracy. By default, the second-stage optimization is enabled.

b = cremez(..., 'debug') enables the display of intermediate results during the filter design, where 'debug' may be one of 'trace', 'plots', 'both', or 'off'. By default, it is set to 'off'.

Note that any combination of the 'sym', 'debug', and 'skip_stage2' options may be specified.

[b,delta] = cremez(...) returns the maximum ripple height delta.

[b,delta,opt] = cremez(...) returns a structure opt of optional results computed by cremez and contains the following fields:

opt.fgrid, frequency grid vector used for the filter design optimization

opt.H, frequency response for each point in opt.fgrid

opt.error, error at each point in opt.fgrid

opt.fextr, vector of extremal frequencies

Example

Design a 31-tap, linear-phase, lowpass filter:

Remarks

User-definable functions may be used, instead of the predefined frequency response functions for 'fresp'. The function is called from within cremez using the following syntax:

[dh,dw] = fresp(n,f,gf,w,p1,p2,...) where

Additionally, a preliminary call is made to 'fresp' to determine the default symmetry property 'sym'. This call is made using the syntax:

sym = fresp('defaults',{n,f,[],w,p1,p2,...})

The arguments may be used in determining an appropriate symmetry default as necessary. The function private/lowpass.m may be useful as a template for generating new frequency response functions.

Algorithm

An extended version of the Remez exchange method is implemented for the complex case. This exchange method obtains the optimal filter when the equiripple nature of the filter is restricted to have n+2 extremals. When it does not converge, the algorithm switches to an ascent-descent algorithm that takes over to finish the convergence to the optimal solution. See the references for further details.

Diagnostics

The following diagnostic messages arise from incorrect usage of cremez:

See Also

fir1

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

fir2

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

firls

Least square linear-phase FIR filter design.

remez

Parks-McClellan optimal FIR filter design.

private/bandpass

Bandpass filter design function.

private/bandstop

Bandstop filter design function.

private/ differentiator

Differentiator filter design function.

private/highpass

Highpass filter design function.

private/hilbfilt

Hilbert filter design function.

private/lowpass

Lowpass filter design function.

private/multiband

Multiband filter design function.

References

[1] Karam, L.J., and J.H. McClellan. "Complex Chebyshev Approximation for FIR Filter Design." IEEE Trans. on Circuits and Systems II. March 1995. Pgs. 207-216.

[2] Karam, L.J. Design of Complex Digital FIR Filters in the Chebyshev Sense. Ph.D. Thesis, Georgia Institute of Technology, March 1995.

[3] Demjanjov, V.F., and V.N. Malozemov. Introduction to Minimax. New York: John Wiley & Sons, 1974.



[ Previous | Help Desk | Next ]