[Master Index] [Index for /tools/hpmatlab/toolbox/signal]

firls

(/tools/hpmatlab/toolbox/signal/firls.m)


Function Synopsis

h=firls(N,F,M,W,ftype);

Help text

 FIRLS	Linear-phase FIR filter design using least-squares error minimization
	B=FIRLS(N,F,M) returns a length N+1 linear phase (real, symmetric
	coefficients) FIR filter which has the best approximation to the 
	desired frequency response described by F and M in the least squares 
	sense. F is a vector of frequency band edges in pairs, in ascending 
	order between 0 and 1. 1 corresponds to the Nyquist frequency or half
	the sampling frequency. M is a real vector the same size as F 
	which specifies the desired magnitude of the frequency response of the
	resultant filter B. The desired response is the line connecting the
	points (F(k),M(k)) and (F(k+1),M(k+1)) for odd k; FIRLS treats the 
	bands between F(k+1) and F(k+2) for odd k as "transition bands" or 
	"don't care" regions. Thus the desired magnitude is piecewise linear
	with transition bands.  The integrated squared error is minimized.

	B=FIRLS(N,F,M,W) uses the weights in W to weight the error. W has one
	entry per band (so it is half the length of F and M) which tells
	FIRLS how much emphasis to put on minimizing the integral squared error
	in each band relative to the other bands.
	
	B=FIRLS(N,F,M,'Hilbert') and B=FIRLS(N,F,M,W,'Hilbert') design filters 
	that have odd symmetry, that is, B(k) = -B(N+2-k) for k = 1, ..., N+1. 
	A special case is a Hilbert transformer which has an approx. magnitude
	of 1 across the entire band, e.g. B=FIRLS(30,[.1 .9],[1 1],'Hilbert'). 

	B=FIRLS(N,F,M,'differentiator') and B=FIRLS(N,F,M,W,'differentiator')
	also design filters with odd symmetry, but with a special weighting
	scheme for non-zero magnitude bands. The weight is assumed to be equal 
	to the inverse of frequency, squared, times the weight W. Thus the 
	filter has a much better fit at low frequency than at high frequency. 
	This designs FIR differentiators.

	See also REMEZ, FIR1, FIR2, FREQZ and FILTER.

Cross-Reference Information

This function calls
This function is called by

Produced by mat2html on Wed Feb 8 12:25:18 EST 1995
Cross-Directory links are: ON