# Sigbuilder

Signal creator/generator

### Block Screenshot

### Contents

### Description

The Signal Builder block is a superblock containing a block whose output event port is connected to its input event port. This event feedback gives the possibility to generate events at discontinuous point of the signal. The generated events automatically restart the numerical solver and avoids numerical problems. The generated event is also made available to the user for possible use. Remind that if higher interpolation methods are used, the events are generated only at the beginning and at the end of the signal.

### Parameters

**Spline method (0…7)**: Accepted values are 0, 1, 2, 3, 4, 5, 6 or 7. This parameter defines the spline method for interpolating the points. The Signal builder block computes a linear or a cubic spline or sub-spline*S*which interpolates the (x_{i},y_{i}) points, i.e., we have S(x_{i}) = y_{i}for all*i=1,…,n*. Available methods are described here-below:**0 : "Zero order method"**. This method generates a piecewise constant signal. i.e., for t_{i}≤ t < t_{i+1}, y(t) = y_{i}. This method is available for all data types.**Linear method**. This method generates a piecewise linear signal, i.e., for t_{i}≤ t < t_{i+1}, y(t) = y_{i}+ (y_{i+1}- y_{i}) (t - t_{i}) / (t_{i+1}- t_{i}).**NATURAL method**. The interpolation is done by passing 2-order polynomials between (x_{i}, y_{i}) and (x_{i+1}, y_{i+1}). The Derivative at (x_{i}, y_{i}) is identical for two adjacent polynomials. The derivative at (x_{1}, y_{1}) can be selected arbitrary: It is selected such that the sum of derivatives at all points be minimum. This condition provides a less fluctuated signal.**NOT_A_KNOT method**. The cubic spline is computed by using the following conditions (considering*n*points x_{i}, …, x_{n}) :S ^{(3)}(x_{2}^{-}) = S^{(3)}(x_{2}^{+})S ^{(3)}(x_{n-1}^{-}) = S^{(3)}(x_{n-1}^{+})**Periodic**. A periodic cubic spline is computed (*y*must verify*y*) by using the conditions: x_{1}=y_{n}_{i}, …, x_{n}:S′(x _{1}) = S′(x_{n})S″(x _{1}) = S″(x_{n})In this case, the value of

*y*is ignored and_{n}*y*is used instead. Note that, in order to generate a periodic signal, the_{1}*Periodic*flag must be activated.**Monotone**. In this case a sub-spline (*S*is only 1-continuously differentiable) is computed such that*S*is monotone on each interval:- if y
_{i}≤ y_{i+1}:*S*is increasing on [x_{i}, x_{i+1}] - Otherwise:
*S*is decreasing on [x_{i}, x_{i+1}]

- if y
**Clamped**. In this case, the cubic spline*S*is computed by using the end points derivatives which are set to zero, i.e.S′(x _{1}) = S′(x_{n}) = 0**Fast**. In this case, a sub-spline is computed by using a simple local scheme for the derivative at*x*of the interpolation polynomial of [ (x_{i}_{i-1}, y_{i-1}), (x_{i}, y_{i}), (x_{i+1}, y_{i+1}) ], except for the end points (derivative at these points are computed from the 3 left most points and the 3 right most points).

**x :**Row or column vector of abscissae (X-axis), as decimal numbers. This vector can be also defined in the Scicos context. It can be specified by a Scilab expression.**y :**Row or column vector of ordinates (Y-axis), as decimal numbers. This vector can be also defined in the Scicos context. It can be specified by a Scilab expression.**Periodic signal (y/n)**: If`y`

is selected, the created signal will be periodic with the period of*t*. Note that if the_{n}*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, clicking on the`OK`

button opens a graphical window, in whch the user can edit data points:Mouse left click on the window : Adds a new data point Mouse right click on the window : Removes a data point. Mouse left double-click on a data point : Edits a point's coordinates Mouse left button press/drag/release : Moves a data point Autoscale menu : Rescales the window to show all data points properly. Spline/Method menu : Selects the spline interpolation method. Data/Clear menu : Removes all data points. Data/Data_Bounds menu : Changes the window size. Data/Load_from_text_file menu : Reads data points from a text data file (using C data format). Data/save_to_text_file menu : Saves the data points to a text data file (using C data format). Data/Load_from_excel menu : Reads data from an excel file. Data/Periodic_signal menu : Specifies weather the created signal is periodic or not. If the signal is not periodic, the signal stays constant beyond *t*. Otherwise it is clamped to_{n}*y*at_{1}*t*._{n}Standards/Functions menu : Chooses a Sine, Sawtooth, Pulse, or random signal. Exit/Help menu : Short help on the graphic window commands. Exit/Exit_without_save menu : Closes the graphical window, discarding all modifications in data. Exit/Exit_with_save menu : Closes the graphical window and saving data points.

### Default properties

**always active:**no**direct-feedthrough:**no**zero-crossing:**no**mode:**no**regular outputs:****- port 1 : size [-1,1] / type 1****number/sizes of activation inputs:**0**number/sizes of activation outputs:**1**continuous-time state:**no**discrete-time state:**no**object discrete-time state:**no**name of computational function:***csuper*

### Interfacing function

SCI/modules/scicos_blocks/macros/Sources/Sigbuilder.sci

## Comments

Add a comment:Please login to comment this page.