matlab scaled,Scaled Doubles

What is the Difference between Scaled Double and Double Data Types?

The storage container for both the scaled double and double data types is

floating-point double. Therefore both data type override settings,

Double and Scaled double, provide the range and

precision advantages of floating-point doubles. Scaled doubles retain the information

about the specified data type and scaling, but doubles do not retain this information.

Because scaled doubles retain the information about the specified scaling, they can also

be used for overflow detection.

Consider an example where you want to store a value of 0.75001

degrees Celsius in a data type sfix16_En13. For this data type:

The slope is S=2−13.

The bias is B=0.

Using the scaling equation V≈V~=SQ+B, where V is the real-world value and

Q is the stored integer value:

B=0.

V~=SQ=2−13Q=0.75001.

Because the storage container of the data type sfix16_En13 is 16

bits, the stored integer Q can only be represented as an integer within

these 16 bits. Therefore, the ideal value of Q is quantized to

6144, causing precision loss.

If you override the data type sfix16_En13 with

Double, the data type changes to Double and you

lose the information about the scaling. The stored-value equals the real-world value

0.75001.

If you override the data type sfix16_En13 with Scaled

Double, the data type changes to flts16_En13. The scaling

is still given by _En13 and is identical to that of the original data

type. The only difference is the storage container used to hold the stored value which is

now double so the stored-value is 6144.08192. This

example shows one advantage of using scaled doubles: the virtual elimination of

quantization errors.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值