Scicos Block
eng - fr


Complex vector multiplier block

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

Contents

Palette

Description

This block realizes the complex vector multiplication. There have four regular inputs, wich corresponds respectively of the first input vector (u1 is the real part and u2 the imaginary part) and the second input vector (u3 is the real part and u4 the imaginary part) of size nu. Defined the complex multiplication with the formula :

$\displaystyle \tilde{C}\,=\,\tilde{A} \tilde{B}
$

where $ \tilde{C}$ is the complex number output and $ \tilde{A}$,$ \tilde{B}$ two complex number inputs.

$\displaystyle y_{1}+jy_{2}\,=\,\left(u_{1}+ju_{2}\right)\left(u_{3}+ju_{4}\right)
$

$\displaystyle \,=\,\left(u_{1}u_{3}-u_{2}u_{4}\right)+j\left(u_{1}u_{4}+u_{2}u_{3}\right)
$

The n element of the output complex vector is then computed as follow :

$\displaystyle y_{1}(n)\,=\,u_{1}(n)u_{3}(n)-u_{2}(n)u_{4}(n)
$

$\displaystyle y_{2}(n)\,=\,u_{1}(n)u_{4}(n)+u_{2}(n)u_{3}(n)
$

Dialog box

\begin{figure}\begin{center}
\epsfig{file=VECTMULTCMPLX_f_gui.eps,width=300pt}
\end{center}\end{figure}

Default properties

Interfacing function

VECTMULTCMPLX_f.sci

Computational function (type 4)


/* vectmultcmplx Scicos complexe vector multiplication
 * Type 4 simulation function ver 1.0 - scilab-3.0
 * 3 janvier 2005 - IRCOM GROUP - Author : A.Layec
 */

/* REVISION HISTORY :
 * $Log$
 */
  
#include "machine.h"
#include "scicos_block.h"

/* Cette fonction réalise la multiplication de deux vecteurs complexes.
 * y1=u1*u3-u2*u4
 * y2=u1*u4+u2*u3
 * entrées régulières : u1[0..nu-1] : parties réelles du vecteur 1
 *                      u2[0..nu-1] : parties imaginaires du vecteur 1
 *                      u3[0..nu-1] : parties réelles du vecteur 2
 *                      u4[0..nu-1] : parties imaginaires du vecteur 2
 * sorties régulière : y1[0..nu-1] : parties réelles du vecteur de sortie
 *                     y2[0..nu-1] : parties imaginaires du vecteur de sortie
 */

/*prototype*/
void vectmultcmplx(scicos_block *block,int flag)
{
  /*Déclaration*/
  double *y1,*y2;
  double *u1,*u2;
  double *u3,*u4;
  int i,nu;

  /*Récupération des adresses des ports réguliers*/
  y1=(double *)block->outptr[0];
  y2=(double *)block->outptr[1];
  u1=(double *)block->inptr[0];
  u2=(double *)block->inptr[1];
  u3=(double *)block->inptr[2];
  u4=(double *)block->inptr[3];

  /*Récupération de la taille d'entrée*/
  nu=block->insz[0];

  /*Réalise la multiplication vectorielle complexe*/
  /*Appel cmplxm_c*/
  cmplxm_c(&nu,&u1[0],&u2[0],&u3[0],&u4[0],&y1[0],&y2[0]);
}

Authors

IRCOM Group Alan Layec