转换和量化数据
量化为定点和浮点数据类型,在数据类型之间转换
设计定点算法时,请使用 cast
、zeros
、ones
、eye
和 subsasgn
将核心算法与数据类型定义分隔开。这些函数允许您在同一代码中使用双精度、单精度和定点数据类型。Manual Fixed-Point Conversion Best Practices说明如何获得从泛型 MATLAB® 代码转换为高效定点实现。
要使用双精度仿真全精度算术,并仅在算法输出端进行量化,请使用 quantizenumeric
。
要仿真具有任意字长和指数长度的浮点数据,请使用 quantizer
对象和关联的对象函数。
函数
主题
- Transformations for Quantized Data
How to transform quantized data between representations.
- Manual Fixed-Point Conversion Best Practices
Get from generic MATLAB code to an efficient fixed-point implementation using manual fixed-point conversion.