%% $RCSfile: sdspimpgen2.tlc,v $ %% $Revision: 1.3 $ %% $Date: 2000/06/15 20:37:42 $ %% %% Copyright 1995-2000 The MathWorks, Inc. %% %% Abstract: Discrete Impulse Generator. %% %implements "sdspimpgen2" "C" %% Function: InitializeConditions =================================================================== %% Abstract: %% During initialization set the counter to be the number of delays plus one. %% %function InitializeConditions(block, system) Output /* DSP Blockset Discrete Impulse Generator (%) - % */ %% %assign dWorkType = LibBlockDWorkDataTypeName(Counter,"") %assign Delay = SFcnParamSettings.DELAY %assign DelayLen = LibBlockDWorkWidth(Counter) %% %if DelayLen == 1 %% Scalar delay % = (%) %; %else %% Vector delay { %% Build array of delay vector elements: real_T Delay[%] = { %foreach idx = DelayLen-1 %, %endforeach %}; % *pDWork = %; %roll Idx = [0:%], lcv = %, block, "InlineRoller" %assign loopArg = (lcv == "") ? Idx : lcv pDWork[%] = (%) Delay[%] + 1; %endroll } %endif %endfunction %%%%%%%%%%%%%%%%%%%%% %% Function: Outputs ================================================================================ %% %function Outputs(block, system) Output /* DSP Blockset Discrete Impulse Generator (%) - % */ %% %% Parameters are not tunable %% %assign OUTPORT_NUM = 0 %assign outType = LibBlockOutputSignalDataTypeName(OUTPORT_NUM,"") %assign dWorkType = LibBlockDWorkDataTypeName(Counter,"") { %assign nChans = LibBlockDWorkWidth(Counter) %assign dims = LibBlockOutputSignalDimensions(OUTPORT_NUM) %assign frameSize = dims[0] %assign multipleChans = (nChans > 1) %assign multipleSamplesPerFrame = (frameSize > 1) %% %if multipleSamplesPerFrame && multipleChans % *y = %; %endif %% % *cnt = %; %% %if multipleChans const int_T nChans = %; int_T i; for(i=0; i < nChans; i++) { %endif %if multipleSamplesPerFrame const int_T frameSize = %; int_T j; for(j=0; j)0) ? (%)((*cnt)-- == (%)1) : (%)0; %else % = (*cnt != (%)0) ? (%)((*cnt)-- == (%)1) : (%)0; %endif } %else %% Single sample per frame %if multipleChans % = (*cnt != (%)0) ? (%)((*cnt)-- == (%)1) : (%)0; %else % = \ (*cnt != (%)0) ? (%)((*cnt)-- == (%)1) : (%)0; %endif %endif %% %% %if multipleChans cnt++; } %endif } %endfunction %% [EOF] sdspimpgen.tlc