Least-square linear-phase FIR filter design
b = firls(n,f,a)
b = firls(n,f,a,w)
b = firls(n,f,a,ftype)
b = firls(n,f,a,w,ftype)
firls
designs a linear-phase FIR filter.
This filter minimizes the weighted, integrated squared error between
an ideal piecewise linear function and the magnitude response of the
filter over a set of desired frequency bands.
Reference [1] describes the theoretical
approach behind firls
. The function solves a system
of linear equations involving an inner product matrix of size roughly n/2
using
the MATLAB^{®} \ operator.
This function designs type I, II, III, and IV linear-phase filters.
Type I and II are the defaults for n even and odd respectively. The 'hilbert'
and 'differentiator'
flags
produce type III (n even) and IV (n odd) filters. The various filter
types have different symmetries and constraints on their frequency
responses (see [2] for
details).
Linear Phase Filter Type | Filter Order | Symmetry of Coefficients | Response H(f), f = 0 | Response H(f), f = 1 (Nyquist) |
---|---|---|---|---|
Type I | Even | b(k) = b(n+2-k), k=1,..., n+1 | No restriction | No restriction |
Type II | Even | b(k) = b(n+2-k), k=1,..., n+1 | No restriction | H(1) = 0 |
Type III | Odd | b(k) = –b(n+2-k), k=1,..., n+1 | H(0) = 0 | H(1) = 0 |
Type IV | Odd | b(k) = –b(n+2-k), k=1,..., n+1 | H(0) = 0 | No restriction |
[1] Parks, T.W., and C.S. Burrus, Digital Filter Design, John Wiley & Sons, 1987, pp. 54-83.
[2] Oppenheim, A.V., and R.W. Schafer, Discrete-Time Signal Processing, Prentice-Hall, 1989, pp. 256-266.
fir1
| fir2
| firpm
| rcosdesign