Member of the filter implementation class.
y = uencode(x, n)
y = uencode(x, n, r)
y = uencode(x, n, r, s)
Uses quantization to convert floating-point inputs to integer outputs. Quantization transforms real or complex floating-point numbers into integers. You can use uencode to solve overflow problems.
| Name | Description | ||||
| x | Specifies the real or complex numbers to encode. The elements of x must fall in the range [-r, r]. LabVIEW treats the elements outside of this range as overflows and saturates the overflows. | ||||
| n | Specifies the level of quantization. n is a positive integer between 2 and 32. If n is in the range [2, 8], the output data type is int8/uint8. If n is in the range [9, 16], the output data type is int16/uint16. If n is in the range [17, 32], the output data type is int32/uint32. | ||||
| r | Specifies the range of x. r is a positive number. The default is 1. | ||||
| s | Specifies the data type of the outputs. s accepts the following values.
|
| Name | Description |
| y | Returns the quantized integers. |
X = -1:0.01:1;
Y = uencode(X, 4, 1, 'signed');
X1 = udecode(Y, 4, 1);
plot(X, X1)