Scicos Block
eng - fr


Additive White Gaussian Noise Channel block

\epsfig{file=AWGN_f.eps,width=90.00pt}

Contents

Palette

Description

This block realizes an additive white gaussian noise channel. It adds noisy samples to the regular input vector and the regular output can be expressed with the following formula :

$\displaystyle y_{k}=u_{k}+\tilde{n}_{k}
$

where $ u_{k}$ is the k element of the complex regular input (the first input is the real part and the second is the imaginary part), $ y_{k}$ is the complex output vector and $ \tilde{n}_{k}$ the complex noisy sample computed with the box Muller Law formula.

This blocks always computes complex noisy samples, but as shown in the super-block equivalent model, it can be used for real signals by only using the first regular input/output.

Super block equivalent model

\epsfig{file=AWGN_f_sblock_equiv.eps,height=9cm}

Dialog box

\begin{figure}\begin{center}
\epsfig{file=AWGN_f_gui.eps,width=260pt}
\end{center}\end{figure}

Default properties

Interfacing function

AWGN_f.sci

Computational function (type 4)


/*
 * awgn Scicos Additive White Gaussian Noise channel block
 * Type 4 simulation function ver 1.0 - scilab-3.0
 * 23 décembre 2004 - IRCOM GROUP - Author : A.Layec
 */
 
/* REVISION HISTORY :
 * $Log$
 */
 
#include "scicos_block.h"

/* Cette fonction de simulation calcule un vecteur aléatoire gaussien
 * par la méthode "Muler Box" et l'ajoute au vecteur complexe d'entrée
 *
 * y1[i]=u1[i]+mean+sigma*sqrt(-log(rand1))*cos(2*%pi*rand2) 
 * y2[i]=u2[i]+mean+sigma*sqrt(-log(rand1))*sin(2*%pi*rand2)  
 *
 * où mean et sigma sont des paramètres et rand1 et rand2 sont
 * des variables aléatoires uniformément réparties
 *
 * entrée régulière : u1[0..nu-1] vecteur des parties rélles des échantillons d'entrée
 *                    u2[0..nu-1] vecteur des parties imaginaires des échantillons d'entrée
 * sortie régulière : y1[0..ny-1] vecteur des parties rélles des échantillons de sortie
 *                    y2[0..ny-1] vecteur de parties imaginaires des échantillons de sortie
 * entrée évènementielle : Dates de déclenchement
 * sortie évènementeille : néant
 *
 * paramètre entier : néant
 * paramètre réel : rpar[0] : valeur du sigma
 *                  rpar[1] : valeur de la moyenne
 */

/*prototype*/
void awgn(scicos_block *block,int flag)
{
  /*déclaration des variables*/
  double *u1,*u2;
  double *y1,*y2;
  int k;
  int ny;

  /*récupération de l'adresses des ports réguliers*/
  u1=(double *)block->inptr[0];
  u2=(double *)block->inptr[1];
  y1=(double *)block->outptr[0];
  y2=(double *)block->outptr[1];

  /*récupère taille de sortie*/
  ny=block->outsz[0];
  
  /*Le flag 1 calcule le registre de sortie y*/
  if(flag==1)
  {
   /*Appel noiseiq_c*/
   noiseiq_c(&ny,&block->rpar[0],&block->rpar[1],&y1[0],&y2[0]);
   
   /*Appel complxa_c*/
   cmplxa_c(&ny,(k=1,&k),&u1[0],&u2[0],&y1[0],&y2[0],&y1[0],&y2[0]);
  }
}

See also

Authors

IRCOM Group Alan Layec