Company Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI

uencode (MathScript Function) (Windows, Not in Base Package)

LabVIEW 8.5 Help
August 2007

NI Part Number:
371361D-01

»View Product Info

Member of the filter implementation class.

Syntax

y = uencode(x, n)

y = uencode(x, n, r)

y = uencode(x, n, r, s)

Description

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.

Examples

Inputs

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.

'signed' (default) Directs LabVIEW to output signed integers with magnitudes in the range [-2^(n-1), 2^(n-1)-1].
'unsigned' Directs LabVIEW to output unsigned integers with magnitudes in the range [0, 2^n-1].

Outputs

Name Description
y Returns the quantized integers.

Examples

X = -1:0.01:1;
Y = uencode(X, 4, 1, 'signed');
X1 = udecode(Y, 4, 1);
plot(X, X1)

Related Topics

udecode


Resources


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit