This is machine translation

Translated by Microsoft
Mouse over text to see original. Click the button below to return to the English verison of the page.


Minimum wordlength fixed-point filter


Hq = minimizecoeffwl(Hd)
Hq = minimizecoeffwl(Hd,...,'NoiseShaping',NSFlag)
Hq = inimizecoeffwl(Hd,...,'NTrials',N)
Hq = minimizecoeffwl(Hd,...'Apasstol',Apasstol)
Hq = minimizecoeffwl(Hd,...,'Astoptol',Astoptol)
Hq = minimizecoeffwl(Hd,...,'MatchrefFilter',RefFiltFlag)


Hq = minimizecoeffwl(Hd) returns the minimum wordlength fixed-point filter object Hq that meets the design specifications of the single-stage or multistage FIR filter object Hd. Hd must be generated using fdesign and design. If Hd is a multistage filter object, the procedure minimizes the wordlength for each stage separately. minimizecoeffwl 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 = minimizecoeffwl(Hd,...,'NoiseShaping',NSFlag) enables or disables the stochastic noise-shaping procedure in the minimization of the wordlength. By default NSFlag is true. Setting NSFlag to false minimizes the wordlength without using noise-shaping.

Hq = inimizecoeffwl(Hd,...,'NTrials',N) specifies the number of Monte Carlo trials to use in the minimization. Hq is the filter with the minimum wordlength among the N trials that meets the specifications in Hd. 'NTrials' defaults to one.

Hq = minimizecoeffwl(Hd,...'Apasstol',Apasstol) specifies the passband ripple tolerance in dB. 'Apasstol' defaults to 1e-4.

Hq = minimizecoeffwl(Hd,...,'Astoptol',Astoptol) specifies the stopband tolerance in dB. 'Astoptol' defaults to 1e-2.

Hq = minimizecoeffwl(Hd,...,'MatchrefFilter',RefFiltFlag) determines whether the fixed-point filter matches the filter order and transition width of the floating-point design. Setting 'MatchRefFilter' to true returns a fixed-point filter with the same order and transition width as Hd. The 'MatchRefFilter' property defaults to false and the resulting fixed-point filter may have a different order and transition width than the floating-point design Hd.

You must have the Fixed-Point Designer™ software installed to use this function.


Minimize wordlength for lowpass FIR equiripple filter:

% Design filter with double-precision floating point
% Find minimum wordlength fixed-point filter
% with 0.15 dB stopband tolerance
% Hq.coeffwordlength is 14 bits.
% Hq1.coeffwordlength is 11 bits
legend(hfvt,'44 coefficients floating-point',...
'44 coefficients 14 bits','48 coefficients 11 bits');

Related Examples

Introduced in R2011a

Was this topic helpful?