delay4.c

Go to the documentation of this file.
00001 #include "scicos_block.h"
00002 
00003 void delay4(scicos_block *block,int flag)
00004 {
00005   /* Copyright INRIA
00006    
00007      Scicos block simulator
00008      Ouputs nx*dt delayed input */
00009 
00010   double* y=block->outptr[0];
00011   double* z=block->z;
00012   int nz=block->nz;
00013   double* u=block->inptr[0];
00014   
00015   int i;
00016   
00017   if (flag ==1 || flag ==4 || flag ==6){
00018     y[0]=z[0];
00019   }else if (flag == 2){
00020     /*  shift buffer */
00021     for (i=0; i<=nz-2; i++){
00022       z[i]=z[i+1];
00023     }
00024     /* add new point to the buffer */
00025     z[nz-1]=u[0];
00026   }
00027 }
00028 
00029     

Generated on Sun Mar 4 15:03:59 2007 for Scilab [trunk] by  doxygen 1.5.1