Formula & Computation Tab

  • Description
    • Enter a brief description that will be displayed in channel selection lists.
  • Expression
    • Enter the math expression you want to calculate in this section.
  • Data file to validate the math function
    • Select a file containing a list of channel names. This enables you to access the choice of available channels in the Insert channel area.
    • WinDarab will use this to test the syntax of the expression.
  • Insert Math Function
    • This is a list of all available operators, filters, and functions

Selecting a Channel

  • Channel names should always be enclosed in braces. Alternatively, you can insert a channel in an expression by using the Insert Channel area
    • {default} is a wild-card that can be used. See Default Channels
  • A formula is not limited to a single line. If a formula is too long or complex for one line, you can split it by using multiple lines.

Selecting a Function

A user can select a math function from the Insert Math Function section

  • Information about each function can be found via intellisense or in Mathematical Expressions

Compute Function

This area is used to determine the sampling rate for calculating a math function.

Depending on the configuration for recording data, data is sampled at varying intervals. As a result, the number of samples per unit of time may vary.

Depending on the meaning of the variables in a math calculation, it may be necessary to vary the sampling rate. This setting determines the quality and speed of processing.

for every <x> sample:

This setting calculates the function independent of the samples that were recorded, and which belong to channels included in the formula. Calculations are instead carried out for each <x>th sample of

  • of all referenced channels: calculates every <x> sample point of all referenced channels
  • of the fastest channel: calculates every <x> sample point of the fastest channel
  • of the selected channel: calculates every <x> sample point of the selected channel
  • of the slowest channel: calculates every <x> sample point of the slowest channel

Note: If WinDarab searches for the fastest channel it ignores standard channels such as xtime or xdist because they are included in every block and thus would always be the fastest channels. If you would indeed like to make a calculation for these samples, you must select the 'of the selected channel'.

Compute function with a period of <x> ms:

WinDarab calculates the function at a specified minimum time interval.

  • WinDarab is able to perform a calculation only if sample positions are valid. As a result, WinDarab always searches for the sample separated from the previous sample by at least the specified value. It is therefore possible that the intervals vary – but they are always at least as big as the specified value.

Include Relevant Timestamps

Some math channels work better if relevant timestamps are included to the math function. E.g., functions like “LapSigma” reset their result if a laptrigger is passed. However, values can be incorrect at the laptrigger boundary if this timestamp (exactly at laptrigger) isn’t included in the selected timeline. This new option ensures that the timestamps of the laptriggers are included in the math channels timeline and the math channel has a value at these positions.

Note: The used math functions in a math formula control if relevant timestamps exist and which they are (an example is LapSigma which adds the timestamps of the laptriggers to the math channel).

Computing Example

Assume there are two channels (v_wheel_rb and v_wheel_rf) with different sampling rates (100 ms and 130 ms) and you want to create a math-channel to calculate the average of these channels.

You can create a math-channel with the expression “({v_wheel_rb} + {v_wheel_rf})/2”.

The Image below shows the two channels in the upper area and the math-channel with the computing-configurations “every sample from the fastest channel”, “every sample from the slowest channel”, “every 150 ms” (from top to bottom in the bottom area).

As you can see, the blue math-channel has the same sample-points as the blue channel (fastest).

The red math-channel has the same sample-points as the red channel (slowest). The green math-channel has its own sample-points that are not in any way linked to the included channels sample-points.

The sample-points that are not on the channels-points are interpolated by the surrounding sample-points of the channel. As an example, the blue math-channel uses the exact values from the blue channel and interpolates (where the sample-points are not at the same point by a coincident) the red channel.

Format Tab

All the settings pertaining to the display of a math channel are made in the “Format” tab.

Numerical Format

Make the settings for the numeric display of the channel values. You can choose either a “decimal”, “hexadecimal” or “binary” format. If you choose the decimal format, you can specify the width of the entry field as well as the number of decimal places.

Range of Values

Use this area to set the range of values (from - to) and the unit of measure to be used in the default channel display.