This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

quantizer Object Properties

The properties associated with quantizer objects are described in the following sections in alphabetical order.

DataMode

Type of arithmetic used in quantization. This property can have the following values:

  • fixed — Signed fixed-point calculations

  • float — User-specified floating-point calculations

  • double — Double-precision floating-point calculations

  • single — Single-precision floating-point calculations

  • ufixed — Unsigned fixed-point calculations

The default value of this property is fixed.

When you set the DataMode property value to double or single, the Format property value becomes read only.

Format

Data format of a quantizer object. The interpretation of this property value depends on the value of the DataMode property.

For example, whether you specify the DataMode property with fixed- or floating-point arithmetic affects the interpretation of the data format property. For some DataMode property values, the data format property is read only.

The following table shows you how to interpret the values for the Format property value when you specify it, or how it is specified in read-only cases.

DataMode Property ValueInterpreting the Format Property Values

fixed or ufixed

You specify the Format property value as a vector. The number of bits for the quantizer object word length is the first entry of this vector, and the number of bits for the quantizer object fraction length is the second entry.

The word length can range from 2 to the limits of memory on your PC. The fraction length can range from 0 to one less than the word length.

float

You specify the Format property value as a vector. The number of bits you want for the quantizer object word length is the first entry of this vector, and the number of bits you want for the quantizer object exponent length is the second entry.

The word length can range from 2 to the limits of memory on your PC. The exponent length can range from 0 to 11.

double

The Format property value is specified automatically (is read only) when you set the DataMode property to double. The value is [64 11], specifying the word length and exponent length, respectively.

single

The Format property value is specified automatically (is read only) when you set the DataMode property to single. The value is [32 8], specifying the word length and exponent length, respectively.

OverflowMode

Overflow-handling mode. The value of the OverflowMode property can be one of the following:

  • Saturate — Overflows saturate.

    When the values of data to be quantized lie outside the range of the largest and smallest representable numbers (as specified by the data format properties), these values are quantized to the value of either the largest or smallest representable value, depending on which is closest.

  • Wrap — Overflows wrap to the range of representable values.

    When the values of data to be quantized lie outside the range of the largest and smallest representable numbers (as specified by the data format properties), these values are wrapped back into that range using modular arithmetic relative to the smallest representable number.

The default value of this property is Saturate. This property becomes a read-only property when you set the DataMode property to float, double, or single.

Note

Floating-point numbers that extend beyond the dynamic range overflow to ±inf.

RoundingMode

Rounding method. The value of the RoundingMode property can be one of the following:

  • Ceiling — Round up to the next allowable quantized value.

  • Convergent — Round to the nearest allowable quantized value. Numbers that are exactly halfway between the two nearest allowable quantized values are rounded up only if the least significant bit (after rounding) would be set to 0.

  • Zero — Round negative numbers up and positive numbers down to the next allowable quantized value.

  • Floor — Round down to the next allowable quantized value.

  • Nearest — Round to the nearest allowable quantized value. Numbers that are halfway between the two nearest allowable quantized values are rounded up.

The default value of this property is Floor.