Analyzing time ranges around events

When analyzing measurement data, a condition alone may not be sufficient to identify the relevant data. You may also need to include data before or after an event, detect when a condition starts or ends, or compare current signal values with values from an earlier point in time.

Use Data Operator utility functions to create signals that represent such temporal relationships using the Add calculated signal operation. You can then use these calculated signals in subsequent operations, for example to extract the corresponding time ranges with the Slice files by condition operation.

For details about the supported syntax and available functions, see Formulas and conditions.

The following example creates a Boolean signal that identifies a time window around the start of a braking event. This signal is then combined with another condition to find points at which the engine leaves a high-load state while a braking event occurs nearby.

  1. In the Sources step of the Create job tab, add the measurement files that contain the signal data you want to analyze.

  2. In the Operations step, click and select Add calculated signal from the list.

  3. Create a Boolean signal that identifies a time window around the start of a braking event:

    • In the Output signal name field, enter brakingStarted.

    • In the Formula field, enter:

      do.shift_edges(do.detect_rising_edge(do.differentiate(vehicleSpeed, time) < 0), start_offset=-5, end_offset=5)

      The resulting signal is true for the time window from five seconds before to five seconds after the start of each braking event.

  4. In the Operations step, click and select Slice files by condition from the list.

  5. In the Slice files by condition operation, select Condition.

  6. In the Condition field, combine the calculated Boolean signal with an additional expression:

    brakingStarted and do.detect_falling_edge(engineSpeed > 4000)

    The condition identifies the points at which the engine leaves the range above 4000 while the corresponding point is within five seconds before or after the start of a braking event.

  7. In the Destination step, select the destination format and folder, then click Start job.

  8. Once the job is finished, go to the Jobs progress tab.

  9. On the respective job card, click Open destination folder.

  10. The output contains the data points that satisfy both temporal conditions.