Math
At a glance
| Operation | What it does | Result |
|---|---|---|
| Absolute Value | Replaces every sample by its absolute value |y|. Rectifies a signal that swings around zero – e.g. to read the magnitude of a lateral acceleration regardless of direction, or before a moving average of an oscillation. | Workflow step |
| Add Constant | Adds a constant offset to every sample. Removes a known zero-point error or shifts a signal for an overlay. Only for a constant offset, not for a drift. Setting: Constant | Workflow step |
| Add Signals (A + B) | Adds two signals sample by sample (A + B) on the chosen axis. Inputs are aligned to a common x-grid. Two partial flows become the total, the forces of two load cells the resulting force. Inputs: Signal A, Signal B · Setting: Normalize | New signal |
| Align Start to Zero | Shifts the x-axis so it starts at 0 s and shows seconds from start instead of date/time. Recordings made at different times then overlay and can be averaged or compared. On a data source, all channels shift together. Also for a whole data source. | Workflow step |
| Divide by Constant | Divides every sample by a constant. For unit conversion or normalization to a reference value. Setting: Constant | Workflow step |
| Divide Signals (A / B) | Divides two signals sample by sample (A / B) on the chosen axis. Inputs are aligned to a common x-grid. Choose what happens at zero divisors: NaN, a small epsilon, or an error. Inputs: Numerator, Denominator · Setting: Normalize | New signal |
| Multiply by Constant | Multiplies every sample by a constant – a gain, a unit conversion, a sign flip with −1. Setting: Constant | Workflow step |
| Multiply Signals (A × B) | Multiplies two signals sample by sample (A × B) on the chosen axis. Inputs are aligned to a common x-grid. Voltage × current = power, force × velocity = power. Inputs: Signal A, Signal B · Setting: Normalize | New signal |
| Negate | Flips the sign of every sample. Aligns a sensor that was mounted the other way round, or turns a deceleration into a positive braking value. | Workflow step |
| Shift X-Axis | Adds a constant offset to the x-axis – a time correction, e.g. to synchronize a channel that was recorded with a known delay. On a data source, all channels shift together. Setting: Offset Value · Also for a whole data source. | Workflow step |
| Subtract Signals (A − B) | Subtracts two signals sample by sample (A − B) on the chosen axis. Inputs are aligned to a common x-grid. For the deviation of a measurement from a reference, or of two sensors from each other. Inputs: Signal A, Signal B · Setting: Normalize | New signal |
| Unwrap Angle | Removes the ±period jumps of a wrapped angle so it runs on continuously – a heading or yaw angle at 360°, a steering wheel angle over several turns, an encoder position, a phase. Set the period in the signal’s unit; NaN gaps are not bridged. Setting: Period | Workflow step |
Concatenate Signals
Joins the points of several signals into one – one value per measurement becomes one curve over speed, several point clouds become one cloud. Time is not shifted: to append measurements one after another, concatenate the data sources instead.
Creates one new signal from any number of signals.
Good to know
- If every input runs steadily along x, the result is sorted by x and forms one curve. Otherwise the points keep their order and form a cloud.
- The time reference is kept only if every input has one.
- The unit is kept if all inputs have the same one. Otherwise it is left empty.
Derivative
Rate of change dy/dx: speed → acceleration, angle → angular rate. Differentiation amplifies noise – set a smoothing window to take the slope of a line fitted over that window, or lowpass first.
Added as a step to the workflow of the signal it is applied to.
| Setting | Description | Default |
|---|---|---|
| Smoothing window | Fit a line in a sliding window of this length (x-units, e.g. s) and take its slope – a low-noise derivative. Empty = point-to-point derivative. | – |
Good to know
- With a Smoothing window, given in units of the x-axis, each value is the slope of a line fitted over that window. This gives a low-noise derivative and usually works better than a lowpass followed by a plain derivative, for example for a temperature rate in K/min. The window shrinks towards the ends of the signal.
- Gaps split the signal into independent sections. Nothing is bridged across a gap.
- The unit of the result is the unit of the signal per unit of the x-axis.
Formula (Expression)
Evaluates a formula over one or more signals and creates a new signal – for math no named operation covers (dB conversion, phase via atan2, custom criteria). The inputs are s1, s2, s3…, s1_x their x-values. Prefer a named operation when one fits.
Creates one new signal from any number of signals.
| Setting | Description | Default |
|---|---|---|
| Expression | Math expression for the new y-values. Variables: s1, s2, … (y-samples per signal), s1_x / s1_z (x-/z-samples), index, pi, e. Functions: sin, cos, atan2, sqrt, log10, abs, where, clip, gradient, unwrap, mean, max, interp, … Example: sqrt(s1**2 + s2**2). | – |
More under Advanced: X Expression.
Writing a formula
| Name | Meaning |
|---|---|
s1, s2, … | the values of the inputs, in the order of the list |
s1_x, s1_z | the x- and z-values of an input |
index, pi, e | the sample number and the two constants |
Available functions:
- trigonometry:
sin,cos,tan,arcsin,arccos,arctan,atan2,sinh,cosh,tanh,deg2rad,rad2deg,unwrap - arithmetic:
exp,log,log10,log2,sqrt,abs,sign,floor,ceil,round,clip,minimum,maximum - conditions:
where(condition, a, b),isnan,nan_to_num, combined with&and| - along the signal:
gradient,diff,cumsum,interp - one number from the whole signal, ignoring missing samples:
mean,median,std,min,max,sum,percentile(s1, q)
A reduction can be mixed with a signal: s1 - mean(s1) removes the offset, 20 * log10(abs(s1)) converts to dB, where(s1 > 50, s2, nan) keeps s2 only where s1 is above 50.
Good to know
- Inputs with different sample times are interpolated onto the finest grid within the range they share. XY curves whose x-values repeat are refused.
- X Expression replaces the x-axis, for example
s1_x * 60to turn Hz into rpm. - ScryLab cannot know the unit of the result, so it is left empty.
Integral
Running integral ∫y dx from the first sample (trapezoidal rule): acceleration → velocity, power → energy, flow → volume. An offset in the input turns into a drift in the result – remove it first.
Added as a step to the workflow of the signal it is applied to.
Good to know
- The integral starts at 0. Its unit is the unit of the signal times the unit of the x-axis.
- A constant offset in the signal grows into a ramp. If the signal should average to zero, remove the offset first with a Highpass Filter, or with
s1 - mean(s1)in a Formula (Expression). - Gaps add no area. After a gap the integral continues from the value before it.
- For the total area as one number, read the metric Integral instead.