Low level routine
fr - eng


perrdsm_c - phase noise computation of a modulated Delta-Sigma fractionnal divider routine

Module

Parameters

File content


/* perrdsm_c subroutine
 * phase error of dsm fractional synthesizer
 * (Bram De Muer's model)
 *
 * Copyright (C) 2007,2008 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"

/* perrdsm_c routine de calcul de l'erreur de phase d'un synthetiseur de fréquence
 *           fractionnaire introduit par un modulateur sigma-delta
 *
 * Entrées :
 * flag : 1 : calcul sorties
 *        2 : calcul compteurs
 * n    : dimension 1 de la matrice d'entrée  (scalaire)
 * m    : dimension 2 de la matrice de sortie (scalaire)
 * M    : nombre d'états du modulateur sigma-delta (vecteur taille n*m)
 * K    : état du modulateur sigma-delta (vecteur taille n*m)
 * i    : compteur K/M (vecteur taille n*m )
 * j    : compteur 1/N (vecteur taille n*m )
 * u    : entrée modulateur sigma-delta (vecteur taille n*m)
 *
 * Sorties :
 * y : matrice de sortie
 *
 */
void perrdsm_c(int *flag,int *n,int *m,int *M,int *K,int *i,int *j,int *u,int *y)
{
 /*déclaration des variables compteurs*/
 int k;

 switch(*flag)
 {

  /* sortie */
  case 1  : {
             for (k=0;k<(*m)*(*n);k++) {
               y[k]=(int) (j[k]*M[k] - i[k]*K[k]);
             }
             break;
            }

  /* état discret */
  case 2  : {
             for (k=0;k<(*m)*(*n);k++) {
               i[k]++;     /* K/M */
               j[k]+=u[k]; /* 1/N */
             }
             break;
            }

 }

 return;
}

Authors

A.Layec INRIA