Package: dsp
Associate input value with index value of quantization region
The ScalarQuantizerEncoder
object encodes
each input value by associating that value with the index value of
the quantization region. Then, the object outputs the index of the
associated region.
To encode an input value by associating it with an index value of the quantization region:
Define and set up your scalar quantizer encoder. See Construction.
Call step
to encode the input value
according to the properties of dsp.ScalarQuantizerEncoder
.
The behavior of step
is specific to each object in
the toolbox.
Note:
Starting in R2016b, instead of using the 
H = dsp.ScalarQuantizerEncoder
returns
a scalar quantizer encoder System object, H
.
This object maps each input value to a quantization region by comparing
the input value to the userspecified boundary points.
H = dsp.ScalarQuantizerEncoder('
returns
a scalar quantizer encoder object, PropertyName
',PropertyValue
,...)H
, with each specified
property set to the specified value.

Source of boundary points Specify how to determine the boundary points and codebook values
as 

Quantizer is bounded or unbounded Specify the quantizer as 

Boundary points of quantizer regions Specify the boundary points of quantizer regions as a vector.
The vector values must be in ascending order. Let 

Find quantizer index by linear or binary search Specify whether to find the appropriate quantizer index using
a linear search or a binary search as one of $${\text{log}}_{\text{2}}\text{(P)}$$ where P is
the number of boundary points. The default is 

Behavior when input equals boundary point Specify whether the input value is assigned to the lower indexed
region or higher indexed region when the input value equals boundary
point by selecting 

Enable output of codeword value Set this property to 

Enable output of quantization error Set this property to 

Codebook Specify the codebook as a vector of quantized output values
that correspond to each region. If the 

Enable output of clipping status Set this property to 

Data type of the index output Specify the data type of the index output from the object as: 
clone  Create an instance of an object with the same property values 
getNumInputs  Number of expected inputs to step method 
getNumOutputs  Number of outputs of step method 
isLocked  Locked status for input attributes and nontunable properties 
release  Allow property value and input characteristics changes 
step  Encode using scalar quantization 
This object implements the algorithm, inputs, and outputs described on the Scalar Quantizer Encoder block reference page. The object properties correspond to the block parameters.