/* sousecht_c subroutine * Down-Sampling Computation * IRCOM GROUP - Author : A.Layec * * Copyright (C) 2007 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" /* sousech_c routine de calcul de sous-échantillonnage en temporel * * Entrées : * n : taille du vecteur original * nech : facteur de sous-échantillonnage * init_c : valeur initiale du compteur * u : vecteur d'entrée à sous-échantillonner * Sorties : * y : vecteur de sortie * */ void sousecht_c(int *n,int *nech,int *init_c,double *u,double*y) { /*Déclaration des variables compteurs*/ int i,j; int count; /*Récupère valeur initiale du compteur*/ count=*init_c; /*raz j*/ j=0; /*Pour tous les échantillons du vecteur d'entrée*/ for(i=0;i<(*n);i++) { /*if(i==(count-1))*/ if(i==count) { y[j]=u[i]; count += (*nech); j++; } } return; }