%% $Revision: 1.1 $ %% $RCSfile: sdspihcplx2.tlc,v $ %% $Date: 1999/11/15 20:27:04 $ %% %% Copyright (c) 1995-1999 The MathWorks, Inc. All Rights Reserved. %% %% Abstract: Target file for the S-Function sdspihcplx2.c %% %implements "sdspihcplx2" "C" %% Function: Outputs ========================================================== %% %% Abstract: %% %function Outputs(block, system) Output /* DSP Blockset Inherit Complexity (%) - % */ %% %assign INPORT_IN = 0 %assign INPORT_REF = 1 %assign OUTPORT = 0 %% %assign N = LibDataInputPortWidth(OUTPORT) %assign c0 = LibBlockInputSignalIsComplex(INPORT_IN) %assign c1 = LibBlockInputSignalIsComplex(INPORT_REF) %assign need_copy = (LibBlockInputSignalBufferDstPort(INPORT_IN) != OUTPORT) %% %if(!c1) %if(!c0) /* Real -> Real */ %if need_copy %% Roll to copy input to outputs %assign rollVars = ["u0","Y"] %roll sigIdx = DataInputPort[INPORT_IN].RollRegions, lcv = RollThreshold, \ block, "Roller", rollVars %assign u = LibBlockInputSignal(INPORT_IN, "", lcv, sigIdx) %assign y = LibBlockOutputSignal(OUTPORT, "",lcv, sigIdx) % = %; %endroll %else /* Complexity of input and reference match - no code required */ %endif %else /* Complex -> Real */ %% %% Roll to copy real input to outputs %assign rollVars = ["u0","Y"] %roll sigIdx = DataInputPort[INPORT_IN].RollRegions, lcv = RollThreshold, \ block, "Roller", rollVars %assign u = LibBlockInputSignal(INPORT_IN, "", lcv, "%%") %assign y = LibBlockOutputSignal(OUTPORT, "",lcv, sigIdx) % = %; %endroll %% %endif %else %if(!c0) /* Real -> Complex */ %% Roll to copy real input to outputs %assign rollVars = ["u0","Y"] %roll sigIdx = DataInputPort[INPORT_IN].RollRegions, lcv = RollThreshold, \ block, "Roller", rollVars %assign u = LibBlockInputSignal(INPORT_IN, "", lcv, sigIdx) %assign yr = LibBlockOutputSignal(OUTPORT, "",lcv, "%%") %assign yi = LibBlockOutputSignal(OUTPORT, "",lcv, "%%") % = %; % = 0.0; %endroll %% %else %%(c1 && c0) /* Complex -> Complex */ %if need_copy %% Roll to copy input to outputs %assign rollVars = ["u0","Y"] %roll sigIdx = DataInputPort[INPORT_IN].RollRegions, lcv = RollThreshold, \ block, "Roller", rollVars %assign u = LibBlockInputSignal(INPORT_IN, "", lcv, sigIdx) %assign y = LibBlockOutputSignal(OUTPORT, "",lcv, sigIdx) % = %; %endroll %else /* Complexity of input and reference match - no code required */ %endif %endif %endif %endfunction %% Outputs %% EOF: sdspihcplx2.tlc