%% $Revision: 1.11 $ %% $RCSfile: sdspihcplx.tlc,v $ %% $Date: 2000/06/15 20:37:41 $ %% %% Copyright 1995-2000 The MathWorks, Inc. %% %% Abstract: Target file for the S-Function sdspihcplx.c %% %implements "sdspihcplx" "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: sdspihcplx.tlc