Quantize except numbers within eps
of +1
y = unitquantize(q, x)
[y1,y2,...] = unitquantize(q,x1,x2,...)
y = unitquantize(q, x)
works the same as quantize
except
that numbers within eps(q)
of +1
are
made exactly equal to +1
.
[y1,y2,...] = unitquantize(q,x1,x2,...)
is
equivalent to y1 = unitquantize(q,x1), y2 = unitquantize(q,x2),...
This example demonstrates the use of unitquantize
with
a quantizer
object q
and a vector x
.
q = quantizer('fixed','floor','saturate',[4 3]); x = (0.8:.1:1.2)'; y = unitquantize(q,x); z = [x y] e = eps(q)
This quantization outputs an array containing the original values
of x
and the quantized values of x
,
followed by the value of eps(q)
:
z = 0.8000 0.7500 0.9000 1.0000 1.0000 1.0000 1.1000 1.0000 1.2000 1.0000 e = 0.1250
eps
| quantize
| quantizer
| unitquantizer