VILLASframework
Modular co-simulation framework
|
The Signal Generator node-type is a simple signal generator which can be used to generate sine, square, ramp, triangle or random signals at user definable frequencies, rates, amplitudes.
Most commonly it is used for testing when no real simulation data is available.
Note: There is also the villas-signal
tool which has a similar purpose.
This node-type does not have any special library dependencies. It is always available.
The source code of the node-type is available here: https://git.rwth-aachen.de/acs/public/villas/node/blob/master/lib/nodes/signal_generator.cpp
The type of signal which should be generated:
random
: a random walk with normal distributed step sizes will be generated.sine
: a sine signal will be generated.square
: a square / rectangle wave will be generated.triangle
: a triangle wave will be generated.ramp
: the generator will produce a ramp signal in the interval [ 0, 1 / f ]
.counter
: increasing integer counter is generated.constant
: a constant value generated.mixed
: the signals of of each sample are generated by cycling over all remaing signal types.pulse
: generates pulses with a set frequency, phase and widthThe number of signals which each of the generated samples should contain.
The rate at which sample should be generated by the node.
The amplitude of the signal when signal (string: "random" | "sine" | "square" | "triangle" | "ramp" | "counter" | "constant" | "mixed" | "pulse") is one of sine
, square
or triangle
.
The frequency of the signal when signal (string: "random" | "sine" | "square" | "triangle" | "ramp" | "counter" | "constant" | "mixed" | "pulse") is one of sine
, square
, triangle
,pulse
or ramp
.
Tha pase of the signal when signal (string: "random" | "sine" | "square" | "triangle" | "ramp" | "counter" | "constant" | "mixed" | "pulse") is one of sine
or pulse
.
The width of the pulse, with respect to the rate
The low value of the pulse signal.
The high value of the pulse signal.
The standard deviation of the normal distributed steps if signal (string: "random" | "sine" | "square" | "triangle" | "ramp" | "counter" | "constant" | "mixed" | "pulse") is random
.
Adds a constant offset to each of the generated signals.
Limit the number of generated output samples by this node-type. A negative number disables the limitation.
Wait 1 / rate
seconds between emitting each sample.
If true
, the Signal Generator node-type will count missed steps and warn the user during every iteration about missed steps. Especially at high rates, it can be beneficial for performance to set this flag to false
. Warnings would namely cause system calls which will slow the node down even more, and thus cause even more missed steps.