| Filter Design Toolbox | ![]() |
Return the fraction length for a quantizer
Syntax
f = fractionlength(q)
Description
f = fractionlength(q) returns the fraction length of quantizer q. This is useful because fraction length is valid whether the quantizer mode is floating-point or fixed-point.
Examples
For a floating-point quantizer
q = quantizer('float',[32 8]);
f = fractionlength(q);
q = quantizer('fixed',[6 4])
f = fractionlength(q);
Algorithm
For floating-point quantizers, f = w - e - 1, where w is the word length and e is the exponent length.
For fixed-point quantizers, f is part of the format [w f].
See Also
quantizer Construct a quantizer.
| firnyquist | freqz | ![]() |