System object: dsp.VectorQuantizerEncoder
Perform vector quantization encoding
INDEX = step(H,INPUT)
INDEX = step(H,...,CODEBOOK)
INDEX = step(H,...,WEIGHTS)
[..., CODEWORD] = step(H, ...)
[..., QERR] = step(H, ...)
INDEX = step(H,INPUT) returns INDEX, a scalar or column vector representing the quantization region(s) to which INPUT belongs. INPUT can be a column vector of size k-by-1 or an M multichannel matrix of dimensions k-by-M, where k is the length of each codeword in the codebook. All inputs to the object can be real floating-point or fixed-point values and must be of the same data type. The output index values can be signed or unsigned integers.
INDEX = step(H,...,CODEBOOK) uses the codebook given in input CODEBOOK, a k-by-N matrix with N codewords each of length k. This option is available when the CodebookSource property is Input port.
INDEX = step(H,...,WEIGHTS) uses the input vector WEIGHTS to emphasize or de-emphasize certain input values when calculating the distortion measure. WEIGHTS must be a vector of length equal to the number of rows of INPUT. This option is available when the DistortionMeasure property is Weighted squared error and the WeightsSource property is Input port.
[..., CODEWORD] = step(H, ...) outputs the CODEWORD values that correspond to each index value when the CodewordOutputPort property is true.
[..., QERR] = step(H, ...) outputs the quantization error QERR for each input value when the QuantizationErrorOutputPort property is true.
Note: H specifies the System object™ on which to run this step method.
The object performs an initialization the first time the step method is executed. This initialization locks nontunable properties and input specifications, such as dimensions, complexity, and data type of the input data. If you change a nontunable property or an input specification, the System object issues an error. To change nontunable properties or inputs, you must first call the release method to unlock the object.