Signal Processing Toolbox | Help Desk |
fircls
Constrained least square FIR filter design for multiband filters.
b = fircls(n,f,amp,up,lo)
fircls(n,f,amp,up,lo,'design_flag
')
b = fircls(n,f,amp,up,lo)
generates a length n+1
linear phase FIR filter b
. The frequency-magnitude characteristics of this filter match those given by vectors f
and amp
:
f
is a vector of transition frequencies in the range from 0 to 1, where 1 corresponds to half the sampling frequency (the Nyquist frequency). The first point of f
must be 0 and the last point 1. The frequency points must be in increasing order.
amp
is a vector describing the piecewise constant desired amplitude of the frequency response. The length of amp
is equal to the number of bands in the response and should be equal to length(f)-1
.
up
and lo
are vectors with the same length as amp
. They define the upper and lower bounds for the frequency response in each band.
fircls(n,f,amp,up,lo,'design_flag
')
enables you to monitor the filter design, where design_flag
can be
trace
, for a textual display of the design table used in the design
plots
, for plots of the filter's magnitude, group delay, and zeros and poles
both
, for both the textual display and plots
n = 50; f = [0 0.4 0.8 1]; amp = [0 1 0]; up = [0.02 1.02 0.01]; lo = [-0.02 0.98 -0.01]; b = fircls(n,f,amp,up,lo,'plots') %plots magnitude responseNOTE
![]()
lo
equal to 0 in the stopbands, a nonnegative frequency response amplitude can be obtained. Such filters can be spectrally factored to obtain minimum phase filters.
The algorithm is a multiple exchange algorithm that uses Lagrange multipliers and Kuhn-Tucker conditions on each iteration.
Constrained least square filter design for lowpass and highpass linear phase FIR filters. |
|