Bloc Scicos
fr - eng

##
Construction de signal

### Contenu

- Construction de signal
  - Description
  - Boîte de dialogue
  - Propriétés par défaut
  - Fonction d'interface
  - Fonction de calcul
  - Auteurs

### Description

This block allows the user to create signals and use them as a signal source block. The signals can be created either graphically by the user or be defined by specifying two vectors, i.e., a vector for time and a vector for amplitude. These vectors define the mesh points and the signal value at intermediate points are obtained by interpolating the points. Several interpolation methods are available. This block can also generate the signal periodically. It is also possible to read data from Excel data-sheets and from formatted C data files.

### Boîte de dialogue

- Spline Method (0..7): accepted values . This parameter defines the spline method for interpolating the points. The Signal builder block computes a linear or a cubic spline or sub-spline which interpolates the points, i.e., we have for all . Several kind of splines may be computed by selecting the appropriate spline method:

  - 0: "Zero order method". This method generates a piecewise constant signal. i.e., for ,

  - 1: "Linear method". This method generates a piecewise linear signal. i.e., for ,

  - 2: "Order 2 method". The interpolation is done by passing 2-order polynomials between and . The Derivative at is identical for two adjacent polynomials. The derivative at can be selected arbitrary, so it is selected such that the sum of derivatives at all points be minimum. This condition provides a less fluctuated signal.

  - 3:"not_a_knot". The cubic spline is computed by using the following conditions (considering points ):

  - 4:"periodic". A periodic cubic spline is computed ( must verify ) by using the conditions:

    .
    In this case the value of is ignored and is used instead. Note that in order to generate a periodic signal, Periodic flag should be activated.

  - 5:"monotone". In this case a sub-spline ( is only one continuously differentiable) is computed such that is monotone on each interval:
    if , is increasing on .
    if , is decreasing on .

  - 6:"clamped". In this case the cubic spline is computed by using the end points derivatives which are set to zero, i.e.,

  - 7:"fast". In this case a sub-spline is computed by using a simple local scheme for the derivative at of the interpolation polynomial of , , , except for the end points (derivative at these points are computed from the 3 left most points and the 3 right most points).

- x: Abscissa data vector (X-axis). This vector can be either a row or a column vector of double data. This vector can be also defined in the Scicos context. The data vector can be specified by mathematical formula.

- y: Ordinate data vector (Y-axis). This vector can be either a row or a column vector of double data. Not that the size of X and Y vector should be the same. This vector can be also defined in the Scicos context. The data vector can also be specified by formula.

- Periodic signal(y/n). If y is selected, the created signal will be periodic with the period of . Note that if the Periodic spline method is selected, the output signal will be a continuous signal, otherwise the signal will be discontinuous at endpoints.

- Launch graphical window (y/n). If y is selected, by clicking on OK button, a graphical window is launched. In this 2D graphical window, the user can edit data points:

  - : Mouse left click on the window: adding a new data point

  - : Mouse right click on the window: remove a data point

  - : Mouse left double-click on a data point: edit a point's coordinates

  - : Mouse left button press/drag/release: move a data point

  - Autoscale menu: Rescaling the window to show all data points properly.

  - Spline/Method menu: Selecting the spline interpolation method.

  - Data/Clear menu removing all data points

  - Data/Data_Bounds menu Change the window size

  - Data/Load_from_text_file menu reading data points from a text data file (using C data format)

  - Data/save_to_text_file menu saving the data points to a text data file (using C data format)

  - Data/Load_from_excel menu: Reading data from an excel file.

  - Data/Periodic_signal menu: Specifying weather the created signal is periodic or not. If the signal is not periodic, the signal stays constant beyond , otherwise it is clamped to at .

  - Standards/Functions menu: Specifying Sine, Sawtooth, Pulse, and random signals.

  - Exit/Help menu: a short help on the graphic window commands

  - Exit/Exit_without_save menu: closing the graphical window, discarding all modifications in data.

  - Exit/Exit_with_save menu: closing the graphical window and saving data points.

### Propriétés par défaut

- toujours actif: oui
- direct-feedthrough: non
- détection de passage à zéro: non
- mode: non
- sorties régulières:
  - port 1 : taille [1,1] / type 1
- nombre des entrées évènementielles: 1
- nombre des sorties évènementielles: 1
- possède un état continu: non
- possède un état discret: non
- possède un état objet: non
- nom de la fonction de calcul: curve_c

### Fonction d'interface

- SCI/macros/scicos_blocks/Sources/CURVE_c.sci [voir code]

### Fonction de calcul

- SCI/routines/scicos/curve_c.c (Type 4) [voir code]

### Auteurs

Masoud Najafi, INRIA