Matlab 使用定点toolboxt模拟DSP';行为

Matlab 使用定点toolboxt模拟DSP';行为,matlab,fixed-point,Matlab,Fixed Point,我正在使用模拟设备DSP,我想对算法进行一些模拟。由此,我指定了我的体系结构: F = fimath('MaxProductWordLength', 40, ... 'MaxSumWordLength', 40, ... 'OverflowAction', 'Saturate', ... 'ProductMode', 'KeepLSB', ... 'RoundingMethod', 'Floor', ... 'SumMode', 'KeepLSB', ..

我正在使用模拟设备DSP,我想对算法进行一些模拟。由此,我指定了我的体系结构:

F = fimath('MaxProductWordLength', 40, ...
    'MaxSumWordLength', 40, ...
    'OverflowAction', 'Saturate', ...
    'ProductMode', 'KeepLSB', ...
    'RoundingMethod', 'Floor', ...
    'SumMode', 'KeepLSB', ...
    'SumFractionLength', 8, ...
    'SumFixedExponent', 40, ...
    'ProductFixedExponent', 40, ...    
    'SumWordLength', 40);

R = numerictype(1, 40, 8);
然后我可以声明一些数字并进行乘法运算:

a = fi(32.25, R, F);
b = fi(1234, R, F);
c = fi(0.1, R, F);
a*b+c
输出的格式如下:

        WordLength: 40
    FractionLength: 16
如何强制Matlab将数字保留在指定类型(Q32.8)上

同样的问题也发生在
a*b

ans = 
3.2768e+04
      DataTypeMode: Fixed-point: binary point scaling
        Signedness: Signed
        WordLength: 32
    FractionLength: 16

    RoundingMethod: Floor
    OverflowAction: Saturate
       ProductMode: KeepLSB
 ProductWordLength: 32
           SumMode: KeepLSB
     SumWordLength: 40
     CastBeforeSum: true
我不想要Q16.16,但想要Q40.8…

ProductWordLength:32

试着把它改成40

我不确定这个处理器,但有些处理器有乘法和移位,所以我通常使用较短的乘积长度来模拟乘法和移位