The following table shows fixed point instrumentation results
Simulation Coverage | Code |
---|---|
100% | function OutputA = DSP(InputA) %#codegen persistent out0; %Retains variable value between function calls. |
Once | if isempty(out0) %Initialize the value for the first call. out0 = 0; end |
100% | upperThreshold = floor(2^15/10); %Set the upper threshold to 1/10 of the full positive range. lowerThreshold = -floor(2^15/10); %Set the lower threshold to 1/10 of the full negative range. |
14% | if InputA >upperThreshold %Logic to perform the Schmitt trigger function. out0 = 2^15-1; |
9% | elseif InputA <lowerThreshold out0 = 0; end |
100% | OutputA = out0; %Assign variable out0 to the output. end |
Variable Name | Type | Sim Min | Sim Max | Static Min | Static Max | Whole Number | ProposedType (Best For WL = 14) |
---|---|---|---|---|---|---|---|
InputA* | double | -7170 | 7432 | Yes | numerictype(1, 16, 0) | ||
OutputA* | double | 0 | 32767 | Yes | numerictype(1, 16, 0) | ||
lowerThreshold | double | -3276 | -3276 | Yes | numerictype(1, 13, 0) | ||
out0 | double | 0 | 32767 | Yes | numerictype(0, 15, 0) | ||
upperThreshold | double | 3276 | 3276 | Yes | numerictype(0, 12, 0) |