VILLASframework
Modular co-simulation framework
Scale and offset signals

The scale hook modifies sample signals by a gain factor and optionally ads an offset. First the original signal value is multiplied by the gain, then the offset is added.

Implementation

The source code of the hook is available here: https://git.rwth-aachen.de/acs/public/villas/node/blob/master/lib/hooks/scale.cpp

Configuration

signal (string)

The name of the signal which should be scaled.

offset (float) = 0.0

The offset which is added to the signal after gain.

gain (float) = 1.0

The gain which is mulitplied to the signal before the offset is added.

Example

@include "hook-nodes.conf"
paths = (
{
in = "signal_node"
out = "file_node"
hooks = (
{
type = "scale"
signal = "sine"
offset = 100.0
scale = 55.0
}
)
}
)