Signal creator/generator
This block allows users 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.
- Spline Method (0..7): accepted values are 0, 1, 2, 3, 4, 5, 6, 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
.
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 (x_i,y_i) and
(x_i+1,y_i+1) (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, 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 n points x_1,...,x_n) :
- 4:"periodic". A periodic cubic spline is computed (y
must verify y_1=y_n) by using the conditions :
.
In this case the value of y_n is ignored and y_1 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 (S is only one
continuously differentiable) is computed such that S is monotone
on each interval:
- 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 x_i of the
interpolation polynomial of (x_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: 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 t_n. 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 t_n, otherwise it is clamped
to y_1 at t_n.
- 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.
- always active: yes
- direct-feedthrough: no
- zero-crossing: no
- mode: no
- regular outputs:
- port 1 : size [1,1] / type 1
- number/sizes of activation inputs: 1
- number/sizes of activation outputs: 1
- continuous-time state: no
- discrete-time state: no
- object discrete-time state: no
- name of computational function: curve_c
- SCI/macros/scicos_blocks/Sources/CURVE_c.sci [view code]
Masoud Najafi, INRIA