Filter Design Toolbox    
quantizer

Construct a quantizer

Syntax

Description

q = quantizer creates a quantizer with properties set to their default values.

q = quantizer('PropertyName1',PropertyValue1,...) uses property name/ property value pairs.

q = quantizer(PropertyValue1,PropertyValue2,...) creates a quantizer with the listed property values. When two values conflict, quantizer sets the last property value in the list. Property values are unique; you can set the property names by specifying just the property values in the command.

q = quantizer(a) where a is a structure whose field names are property names, sets the properties named in each field name with the values contained in the structure.

q = quantizer(pn,pv) sets the named properties specified in the cell array of strings pn to the corresponding values in the cell array pv.

These are the quantizer property values, sorted by associated property name:

Property Name
 

Property Value
Description
Mode
'double'
Double-precision mode. Override all other parameters.

'float'
Custom-precision floating-point mode.

'fixed'
Signed fixed-point mode.

'single'
Single-precision mode. Override all other parameters.

'ufixed'
Unsigned fixed-point mode.
Roundmode
'ceil'
Round towards negative infinity.

'convergent'
Convergent rounding.

'fix'
Round towards zero.

'floor'
Round towards positive infinity.

'round'
Round towards nearest.
Overflowmode (fixed-point only)
'saturate'
Saturate at max value on overflow.

'wrap'
Wrap on overflow.
Format
[wordlength exponentlength]
The format for fixed or ufixed mode.

[wordlength exponentlength]
The format for float mode.

The default property values for a quantizer are

Along with the preceding properties, quantizers have read-only properties: 'max', 'min', 'noverflows', 'nunderflows', and 'noperations'. They can be accessed through quantizer/get or q.max, q.min, q.noverflows, q.nunderflows, and q.noperations, but they cannot be set. They are updated during the quantizer/quantize method, and are reset by the quantizer/reset method.

The following table lists the read-only quantizer properties:

Property Name
Description
'max'
Maximum value before quantizing
'min'
Minimum value before quantizing
'noverflows'
Number of overflows
'nunderflows'
Number of underflows.
'noperations'
Number of data points quantized

[qcoefficient,qinput,qoutput,qmultilplicand,qproduct,qsum] =...
quantizer(F)
returns property values associated with the quantized FFT F for the twiddle factors, input, output, product, and sum quantizers.

[q1, q2,...] = quantizer(F, formatName1, formatName2,...) returns quantizers q1, q2,..., associated with formatName1,formatName2,..., where format k is a string that can be one of 'twiddle', 'input', 'output', 'multiplicand', 'product', or 'sum'.

Examples

The following example operations are equivalent.

Setting quantizer properties by listing property values only in the command.

Using a structure a to set quantizer properties.

Using property name and property value cell arrays pn and pv to set quantizer properties.

Using property name/property value pairs to configure a quantizer.

See Also
quantize, set


  quantize radix 

Learn more about the latest releases of MathWorks products:

 © 1994-2009 The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS