Low level routine
fr -
eng
demodgen_c - generic symbol demodulator computational routine
- n :
size of vectors
- m :
number of states of the modulation
- i_c :
input vector of I component
- q_c :
input vector of Q component
- u_r :
input vector of value of symbols (real part)
- u_i :
input vector of value of symbols (imaginary part)
- y :
output vector of symbols
/* 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;
}
INRIA Alan Layec