Low level routine
eng -
fr
cw_c - noisy constant wave generator computational routine
- n : size of vectors
- ampl : level of output wave
- opt : routine options
- 1 : cosine output
- 2 : sine output
- 3 : both cosine and sine outputs
- theta_i : incremental step of angulary position
- y1 : address of real part of output vector
- y2 : address of imaginary part of output vector
/* cw_c subroutine
* Noisy Constant Wave computation
* IRCOM GROUP - Author : A.Layec
*/
/* REVISION HISTORY :
* $Log$
*/
#include "mod_num_lib.h"
/* cw_c : routine de calcul d'une onde à fréquence constante (1 ou 2 composantes)
*
* Entrées :
* n : longueur du vecteur
* ampl : amplitude de l'onde
* opt : option de la routine (1:cos, 2:sin, 3:cos et sin)
* theta_i : pas d'incrémentation de l'angle
*
* Sorties :
* y1 : adresse de départ du vecteur de sortie composante réelle
* y2 : adresse de départ du vecteur de sortie composante imaginaire
*
* Entrées/Sorties :
* theta : angle instantanée
*
* Dépendances :
* math.h
*
*/
void cw_c(int *n,double *ampl,int *opt,double *theta_i,double *y1,double *y2,double *theta)
{
/*déclaration*/
int i;
for (i=0;i<(*n);i++)
{
switch (*opt)
{
case 1 :
{
y1[i]=(*ampl)*cos((*theta));
break;
}
case 2 :
{
y2[i]=(*ampl)*sin((*theta));
break;
}
case 3 :
{
y1[i]=(*ampl)*cos((*theta));
y2[i]=(*ampl)*sin((*theta));
break;
}
}
*theta=(*theta)+(*theta_i);
}
return;
}
IRCOM Group
Alan Layec