MATLAB 帮助中心
使用 quantizer 对象量化数值数据,但不会对 eps 为接近 +1 的范围内的数值进行量化
quantizer
eps
+1
y = unitquantize(q,x)
[y1,y2,…] = unitquantize(q,x1,x2,…)
y = unitquantize(q,x) 使用 quantizer 对象 q 来量化 x 中的数值数据。unitquantize 的工作方式与 quantize 相同,只是在 eps(q) 为接近 +1 的范围内的数值被精确设置为等于 +1。
y
q
x
unitquantize
quantize
(q)
[y1,y2,…] = unitquantize(q,x1,x2,…) 等效于 y1 = unitquantize(q,x1), y2 = unitquantize(q,x2), …,以此类推。
[y1,y2,…]
x1,x2,…
y1 = unitquantize(q,x1), y2 = unitquantize(q,x2), …
示例
全部折叠
使用 unitquantize 和 quantizer 对象来量化数据。
x = (0.8:.1:1.2)'; q = quantizer('fixed','floor','saturate',[4 3]); y = unitquantize(q,x); z = [x y] e = 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
unitquantize 量化 x 的元素,但与 +1 的差值在 eps 范围内的数值除外。
x = [1 pi/4]; q = quantizer([8,7]) y1 = quantize(q,x) y2 = unitquantize(q,x)
q = DataMode = fixed RoundMode = floor OverflowMode = saturate Format = [8 7] Warning: 1 overflow(s) occurred in the fi quantize operation. y1 = 0.9922 0.7812 y2 = 1.0000 0.7812
用于量化的数据类型属性,指定为 quantizer 对象。
示例: q = quantizer('fixed','ceil','saturate',[5 4]);
q = quantizer('fixed','ceil','saturate',[5 4]);
要量化的数据,指定为标量、向量、矩阵、多维数组、元胞数组或结构体。
当 x 是数值数组时,x 的每个元素均经过量化。
当 x 是元胞数组时,该元胞数组的每个数值元素都经过量化。
当 x 是结构体时,x 的每个数值字段均经过量化。
unitquantize 不会更改 x 的非数值元素或字段,也不会对非数值发出警告。与 +1 的差值在 eps(q) 范围内的数值被设置为精确等于 +1。
数据类型: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | logical | struct | cell 复数支持: 是
single
double
int8
int16
int32
int64
uint8
uint16
uint32
uint64
logical
struct
cell
要量化的数据(作为单独的元素),指定为标量、向量、矩阵、多维数组、元胞数组或结构体。
在 R2008a 中推出
eps | quantize | quantizer
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
选择网站
选择网站以获取翻译的可用内容,以及查看当地活动和优惠。根据您的位置,我们建议您选择:。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
欧洲
亚太
联系您当地的办事处