firpmord
Parks-McClellan optimal FIR filter order estimation
Syntax
[n,fo,ao,w] = firpmord(f,a,dev)
[n,fo,ao,w] = firpmord(f,a,dev,fs)
c = firpmord(f,a,dev,fs,'cell')
Description
[n,fo,ao,w] = firpmord(f,a,dev)
finds the approximate order, normalized frequency band edges, frequency band amplitudes, and weights that meet input specificationsf
,a
, anddev
。
f
is a vector of frequency band edges (between 0 andFs/2, whereFsis the sampling frequency), anda
is a vector specifying the desired amplitude on the bands defined byf
。The length off
is two less than twice the length ofa
。The desired function is piecewise constant.dev
is a vector the same size asa
that specifies the maximum allowable deviation or ripples between the frequency response and the desired amplitude of the output filter for each band.
Usefirpm
with the resulting ordern
, frequency vectorfo
, amplitude response vectorao
, and weightsw
to design the filterb
which approximately meets the specifications given byfirpmord
input parametersf
,a
, anddev
。
b = firpm(n,fo,ao,w)
[n,fo,ao,w] = firpmord(f,a,dev,fs)
specifies a sampling frequencyfs
。fs
默认为2赫兹,暗示的奈奎斯特频率1 Hz. You can therefore specify band edges scaled to a particular application's sampling frequency.
c = firpmord(f,a,dev,fs,'cell')
generates a cell-array whose elements are the parameters tofirpm
。
Note
In some cases,firpmord
underestimates or overestimates the ordern
。If the filter does not meet the specifications, try a higher order such asn+1
orn+2
。
Examples
Algorithms
firpmord
uses the algorithm suggested in[1]。这种冰毒od is inaccurate for band edges close to either 0 or the Nyquist frequency,fs/2
。
References
[1] Rabiner, Lawrence R., and Otto Herrmann. “The Predictability of Certain Optimum Finite-Impulse-Response Digital Filters.”IEEE®Transactions on Circuit Theory。Vol. 20, Number 4, 1973, pp. 401–408.
[2] Rabiner, Lawrence R., and Bernard Gold.Theory and Application of Digital Signal Processing.Englewood Cliffs, NJ: Prentice-Hall, 1975, pp. 156–157.