Generated on 2021-09-29 19:16:37

The following table shows fixed point instrumentation results

Fixed-Point Report DSP_fixpt

function OutputA = DSP_fixpt(InputA)
%#codegen
fm = get_fimath();

persistent out0; %Retains variable value between function calls.
if isempty(out0) %Initialize the value for the first call.
    out0 = fi(0, 0, 15, 0, fm);
end

upperThreshold = fi(floor(2^15/10), 0, 12, 0, fm); %Set the upper threshold to 1/10 of the full positive range.
lowerThreshold = fi(-floor(2^15/10), 1, 13, 0, fm); %Set the lower threshold to 1/10 of the full negative range.
 
if InputA >upperThreshold %Logic to perform the Schmitt trigger function.
    out0(:) = 2^15-1;
elseif InputA <lowerThreshold
    out0(:) = 0;
end

OutputA = fi(out0, 1, 16, 0, fm); %Assign variable out0 to the output.
end
Variable NameTypeSim MinSim Max
InputAnumerictype(1, 16, 0)-71707432
OutputAnumerictype(1, 16, 0)032767
lowerThresholdnumerictype(1, 13, 0)-3276-3276
out0numerictype(0, 15, 0)032767
upperThresholdnumerictype(0, 12, 0)32763276