Skip to main content

Average Signal Values

The average hook calculates arithmetic mean over a set of signals and insert it as a new value to the samples.

Implementation​

The source code of the hook is available here: https://github.com/VILLASframework/node/blob/master/lib/hooks/average.cpp

Configuration​

offset
required
integer

The signal offset at which the average signal should be inserted.

Examples:

  • 0 inserts the averaged signal before all other signals in the sample
  • 1 inserts the averaged signal after the first signal.
signals
Array of strings

A list of signal names to which this hook should be applied

enabled
boolean
Default: true

An optional field which can be used to disable a hook.

priority
integer
Default: 99

The priority of this hook which determines the order in which hooks are executed. Hooks with a lwoer priority are executed before ones with a higher priority.

If no priority is configured, hooks are executed in the order they are configured in the configuration file.

{
  • "offset": 0,
  • "signals": [
    ],
  • "enabled": true,
  • "priority": 99
}

Example​

node/etc/examples/hooks/average.conf
@include "hook-nodes.conf"

paths = (
{
in = "signal_node"
out = "file_node"

hooks = (
{
type = "average"

signals = [ "sine", "square" ]
offset = 0
}
)
}
)