To simulate digitization noise, the easiest way I found was to use the MathFunction block, found in the CDS_PARTS model, under simLinkParts.
The MathFunction block supports square of input value, square root of input value, reciprocal of input value, and modulo of two input values.
The last is useful because it casts the input values as integers before taking the modulo.By placing this block after the saturation block (set to +/- 32768), adding 32768.5, choosing the 2nd input to be larger than 2 * 32768 (100,000 in this case), and then subtracting 32768, we wind up with a rounding function.
The above method has been applied to the c1spy model in the CI and SO out sub-blocks. |