Calculated Column Custom Expression Details

  • An expression must be a number, a data column, an appropriately formatted function, or a combination of these items: [5, “X”, sin(“X”), 5sin(“X”)]
  • Supported operators are + – * / ^ ( )
  • Functions must contain their arguments in parentheses. [abs(“X”) or sqrt(2)]
  • Multiplication can be explicit and implied. [5*“X”or 5“X” or 5(“X”)]
  • Constants must be entered as numbers. Variable parameters (e.g., A, B, C) are not supported.
  • Trigonometric functions are evaluated in radians.
  • Functions can be nested as long as the proper format is used. [sqrt(abs(“X”))]

Function Syntax

Below is a list of available functions and their syntax when using the Custom Expression option for Graphical Analysis Pro calculated columns.

Function Description Syntax: Columns Syntax: Numbers Notes:
acos arccosine or inverse cosine acos(“X”) acos(0.5) ≈ 1.047 Output is in radians
asin arcsine or inverse sine asin(“X”) asin(0.5) ≈ .5236 Output is in radians
atan arctangent or inverse tangent atan(“X”) atan(1) ≈ .785 Output is in radians
atan2 2-argument arctangent  atan2(“Y”,“X”)
atan2(4,”X”)
atan2(“Y”,3)
atan2(4,3) ≈ .927
atan2(3,4) ≈ .644
The angle (in radians) between the x-axis and a line connecting the origin and the point (x,y)
cos cosine cos(“X”) cos(1.407) ≈ 0.5 Input is in radians
sin sine sin(“X”) sin(.5236) ≈ 0.5 Input is in radians
tan tangent tan(“X”) tan(0.785398) ≈ 1 Input is in radians
acosh inverse hyperbolic cosine acosh(“X”) acosh(2) ≈ 1.317
asinh inverse hyperbolic sine asinh(“X”) asinh(1) ≈ .4812
atanh inverse hyperbolic tangent atanh(“X”) atanh(.5) ≈ .5493
cosh hyperbolic cosine cosh(“X”) cosh(1.317) ≈ 2
sinh hyperbolic sine sinh(“X”) sinh(.4812) ≈ 1
tanh hyperbolic tangent tanh(“X”) tanh(.5493) ≈ .5
exp Natural or base-e exponential function (ex) exp(“X”) exp(2) ≈ 7.389
exp2 base-2 exponential function (2x) exp2(“X”) exp2(2) = 4 
expm1 ex–1 or exp(x)–1 expm1(“X”) expm1(.0005)
≈ 0.005012521
Greater accuracy for “x” values close to 0 compared to exp(x)-1.
Inverse of log1p(x).
ln Natural or base-e logarithmic function  ln(“X”) ln(2.719) ≈ 1
log common or base-10 logarithmic function log(“X”) log(1000) = 3
log2 base-2 logarithmic function (log2x) log2(“X”) log2(8) = 3
log1p ln(1+x) log1p(“X”) log1p(.0001) ≈ 0.000099995 Greater accuracy for “x” values close to 0 compared to ln(1+x).
Inverse of expm1(x)
logb floating-point base logarithmic function logb(“X”) logb(0.065) = 2
logb(6.5) = 2
logb(65) = 6
Returns the logarithm of |x|, using FLT_RADIX as base for the logarithm. (FLT_RADIX = 2)
abs absolute value abs(“X”) abs(-9.81) = 9.81
cbrt cube root cbrt(“X”) cbrt(27) = 3
hypot Hypotenuse – finds the square root of the sum of the squares of two numbers hypot(“X”, “Y”)
hypot(“X”, 12)
hypot(5,”X”)
hypot(5,12) = 13 sqrt(x2 + y2)
pow power (xy) pow(“X”,“Y”)
pow(“X”,3)
pow(5,”X”)
pow(5,3) = 125
sqrt square root sqrt(“X”) sqrt(81) = 9
erf error function or Gauss error function erf(“X”) erf(.25) ≈ 0.276
erfc Complementary error function  erfc(“X”) erfc(.25) ≈ 0.724 1 – erf(x)
cei Ceiling – finds the nearest integer greater than a given number. cei(“X”) cei(3.5) = 4
cei(-3.5) = -3
floor Floor – finds the nearest integer less than a given number floor(“X”) floor(3.5) = 3
floor(-3.5) = -4
round Rounds to the nearest integer round(“X”) round(3.5) = 4
round(-3.5) = -4
trunc Truncate – finds the nearest integer not greater than a given number. trunc(“X”) trunc(3.5) = 3
trunc(-3.5) = -3
mod Modulo – integer remainder of X/Y mod(“X”,“Y”)
mod(“X”,5)
mod(8,”X”)
mod(5,4) = 1
mod(6,4) = 2
mod(7,4) = 3
Equivalent to the expression…
x – y*trunc(x/y)
remainder ISEE version of the integer remainder of X/Y remainder(“X”,“Y”)
remainder(“X”,5)
remainder(8,“X”)
remainder(5,4) = 1
remainder(6,4) = -2
remainder(7,4) = -1
Equivalent to the expression…
x – y*round(x/y)
copysign Changes the sign of a number to match the sine of another number copysign(“X”, “Y”)
copysign(“X”, -1)
copysign(1, “X”)
copysign(-5, 1) = 5
copysign(5, -2) = -5
nextafter Computes next representable float after X in the direction of Y nextafter(“X”,“Y”) nextafter(1/0,1) = infinity https://pubs.opengroup.org/onlinepubs/009695399/functions/nextafter.html
dim Calculates the difference between two numbers and reports the difference if the value is ≥ 0 otherwise it reports 0. dim(“X”,“Y”)
dim(“X”,10)
dim(10,“X”)
dim(10,8) = 2
dim(10,9.9) = 0.1
dim(8,10) = 0
rowNumber Provides a column of values where the cell value is the row number of the cell. rowNumber() N/A The data table needs to have rows already defined. For a new Manual entry experiment, values in the calculated column are not defined unless there are values already entered in another column.

Digital Filter Functions

Digital Filter functions are designed to work with analog sensors and/or truly analog signals. Signals or sensors that perform digital signal processing may not work well with these features.

The Digital Filter functions have the following parameters:

  • “Y” – a column of data to which the filter is being applied
  • “X” – the independent variable column for your data; typically Time
  • cutoff [lowCutoff, highCutoff] – the FFT frequency cutoff value used for the filter; must be a number
  • bandPassRipple – Optional value; must be a number
    • This value is the percentage of pass-band
    • Low Pass and High Pass filters are 0, which applies a Butterworth pass filter, unless otherwise specified. 
    • Band Stop and Band Pass are 0.5 unless otherwise specified.
Function Description Syntax Notes
lowPassFilter Filter data from analog sensors that have unwanted FFT frequencies above the cutoff value lowPassFilter(“Y”,“X”,cutoff, bandPassRipple)
lowPassFilter(“Signal”,“Time”,50)
lowPassFilter(“Signal”,“Time”,50,0)
For EKG data, use a 50 Hz low pass filter to remove noise from a power supply affecting your data.
highPassFilter Filter data from analog sensors that have unwanted FFT frequencies below the cutoff value highPassFilter(“Y”,“X”,cutoff, bandPassRipple)
highPassFilter(“Signal”,“Time”,1)
highPassFilter(“Signal”,“Time”,1,0)
For EMG data, use a 1 Hz high pass filter to remove noise from muscle movements such as a twitch.
bandStopFilter Filter data from analog sensors that have unwanted FFT frequencies between two cutoff values. bandStopFilter(“Y”, “X”, lowCutoff, highCutoff, bandPassRipple)
bandStopFilter(“Signal”, “Time”,50, 70)
bandStopFilter(“Signal”, “Time”,50, 70,0.5)
For voltage data, use a 50 to 70 Hz band pass filter to remove noise from a US power supply.
bandPassFilter Use this function to apply both a low pass and high pass filter using a single expression.Frequencies below the low cutoff and frequencies above the high cutoff will be filtered from the data. bandPassFilter(“Y”, “X”, lowCutoff, highCutoff, bandPassRipple)
bandPassFilter(“Signal”, “Time”,1, 50)
bandPassFilter(“Signal”, “Time”,1, 50,0.5)
For EKG or EMG data, filter frequencies below 1 Hz to remove noise from low frequency events, such as arm or leg movements, and filter frequencies above 50 hz to remove noise from a power supply.

Derivative Functions

Derivative functions are designed to find the numerical rate of change of a variable with respect to another variable, typically time. The numerical derivative is the weighted average of the slope of ‘n’ points around each point, where ‘n’ is the numberOfPoints parameter noted below.

The Derivative functions have the following parameters:

Function Description Syntax Notes
firstDerivative Finds the first derivative of data in column Y with respect to column X. firstDerivative(“Y”,“X”,numberOfPoints)
firstDerivative(“Position”,“Time”)
firstDerivative(“Position”,“Time”,7)
Use this derivative function to calculate a derivative using a different number of points; Graphical Analysis uses 7 points.
secondDerivative Finds the second derivative of data in column Y with respect to column X. secondDerivative(“Y”,“X”,numberOfPoints)
secondDerivative(“Position”,“Time”)
secondDerivative(“Position”,“Time”,7)
Use this derivative function to calculate a second derivative using a different number of points; Graphical Analysis uses 7 points.