constraincoeffwl
Constrain coefficient word length
Syntax
Hq = constraincoeffwl(Hd,wordlength)
Hq = constraincoeffwl(Hd,wordlength,'Ntrials',N)
Hq = constraincoeffwl(Hd,wordlength,...,'NoiseShaping',NSFlag)
Hq = constraincoeffwl(Hd,wordlength,...,'Apasstol',Apasstol)
Hq = constraincoeffwl(Hd,wordlength,...,'Astoptol',Astoptol)
Description
Hq = constraincoeffwl(Hd,wordlength)
returns a fixed-point filter
Hq
meeting the design specifications of the single-stage or
multistage FIR filter object Hd
with a wordlength of at most
wordlength
bits. For multistage filters,
wordlength
can either be a scalar or vector. If
wordlength
is a scalar, the same word length is used for all
stages. If wordlength
is a vector, each stage uses the corresponding
element in the vector. The vector length must equal the number of stages.
Hd
must be generated using fdesign
and
design
. constraincoeffwl
uses a stochastic
noise-shaping procedure by default to minimize the wordlength. To obtain repeatable
results on successive function calls, initialize the uniform random number generator
rand
Hq = constraincoeffwl(Hd,wordlength,'Ntrials',N)
specifies
the number of Monte Carlo trials to use. Hq
is
first filter among the trials to meet the specifications in Hd
with
a wordlength of at most wordlength
.
Hq = constraincoeffwl(Hd,wordlength,...,'NoiseShaping',NSFlag)
enables or
disables the stochastic noise-shaping procedure in the constraint of the word length. By
default NSFlag
is true
. Setting
NSFlag
to false
constrains the word length
without using noise-shaping.
Hq = constraincoeffwl(Hd,wordlength,...,'Apasstol',Apasstol)
specifies
the passband ripple tolerance in dB. 'Apasstol'
defaults
to 1e-4
.
Hq = constraincoeffwl(Hd,wordlength,...,'Astoptol',Astoptol)
specifies
the stopband tolerance in dB. 'Astoptol'
defaults
to 1e-2
You must have the Fixed-Point Designer™ software installed to use this function.
Examples
Version History
Introduced in R2011a