Low level routine
fr - eng


modpsk_c - M-ary phase shift keying modulator computational routine

Parameters

File content


/* modpsk_c subroutine
 * Phase Shift Keying Modulator
 * 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 <math.h>

#include "modnum_lib.h"

/* modpsk_c routine de calcul des composantes I et Q en fonction
 * d'un numéro symbole codé par états de phase (psk)
 *
 * Entrées :
 * n   : longueur des vecteurs (scalaire)
 * m   : nombre d'état Attention - ici scalaire
 * u   : numéro symbole (vecteur d'entrée)
 * Sorties :
 * i_c : valeur de la composante i (vecteur de sortie 1)
 * q_c : valeur de la composante q (vecteur de sortie 2)
 *
 * Dépendances :
 * math.h
 */

void modpsk_c(int *n,int *m,double *u,double *i_c, double *q_c)
{
 /*Déclaration des variables compteurs*/
 int k,i;

 for(i=0;i<(*n);i++)
 {
  /*récupération de la valeur du port d'entrée*/
  k=(int)u[i];
  /*Calcul des composantes i et q*/
  i_c[i]=cos(M_PI*(2*k+1)/(*m));
  q_c[i]=-sin(M_PI*(2*k+1)/(*m));
 }
 return;
}

Authors

IRCOM Group Alan Layec