/* demodgen_c subroutine * Generic Symbol Demodulator * * Copyright (C) 2007-2009 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" /* demodgen_c routine de calcul de numéro symbole * générique. * * Entrées : * n : longueur des vecteurs (scalaire) * m : nombre d'état de modulation (scalaire) * i_c : valeur de la composante i (vecteur de sortie 1) * q_c : valeur de la composante q (vecteur de sortie 2) * u_r : valeur état réel (vecteur) * u_i : valeur état imaginaire (vecteur) * Sorties : * y : vecteur du numéro symbole * */ void demodgen_c(int *n,int *m,double *i_c,double *q_c,double *u_r,double *u_i,double *y) { /*Déclaration des variables compteurs*/ int k,i; for(i=0;i<(*n);i++) { /*pour chaque éléments des vecteurs des états*/ for(k=0;k<(*m);k++) { /*test si les entrées correspondent à un élément *des vecteurs des états */ if ((i_c[i]==u_r[k])&&(q_c[i]==u_i[k])) { /*Met à jour numéro symbole*/ y[i]=(double)k; break; } } } return; }