Routine bas-niveau
fr -
eng
calc_init_c - routines de calcul pour initialiser des compteurs
/* calc_init_c subroutine
*
* counter value computation routine
* for vector based symbol signal
*
* Copyright (C) 2007-2011 Alan Layec
*
* This file is part of modnumlib.
*
* modnumlib is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* modnumlib is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with modnumlib; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
/* REVISION HISTORY :
* $Log$
*/
#include "modnum_lib.h"
/* calc_init_c :
*
* counter value computation routine
* for vector based symbol signal
*
* Input :
* - n : length of the input vectors (scalar)
* - m : number of vector (scalar)
* - ns : number of sample per symbol (scalar)
*
* Input/Output :
* - init : counter value (vector of size m)
*
*/
void calc_init_c(int *n, int *m, int *ns, int *init)
{
/* */
int j;
/* */
for(j=0;j<(*m);j++) {
if((*n)<init[j]) {
init[j]=init[j]-(*n);
}
else {
init[j] = ((int) (((*n) - init[j])/(*ns)) + 1 ) * (*ns) + init[j] - (*n);
}
}
return;
}
A. Layec