# Calculations on the Same Signal Across Time Periods

## Recommended Posts

• Seeq Team

A common analytics need is to calculate changes in a signal's value over different time periods (such as hourly or daily). One example is calculating the change in a tank level signal as a way to infer flow rates, production, amount transferred, etc. While the Seeq Formula derivative() function is often useful in these situations, in some cases the user may want to simply calculate the signal change over a specified time period (perhaps once/hour).

While there are many ways to do this in Seeq, two efficient ways are: 1) using the Delta statistic in Signal from Condition and 2) using \$signal-\$signal.delay() in Formula.

Here is an example to illustrate:

We have a tank level signal shown in lane 1 and we have calculated the hourly change in the tank level by two different methods (the results are shown in lane 2):

The first method to calculate the level change per hour uses an Hourly condition (created using the Periodic Condition tool to generate the green capsules). Then, Signal from Condition is used to generate the Hourly Level Change (Signal from Condition) in lane 2, by selecting the Delta statistic over the Hourly bounding condition:

The second method uses the delay() function in Formula, subtracting the one hour delayed level from the current value of the level signal. This generates the Hourly Level Change (Formula Delay Function) in lane 2

Note that this approach creates an hourly level difference for each sample point, where the first approach generates a level difference result once per hour.

Also note that the user could choose to filter (smooth) the level signal and then apply the level difference calculations, if they desire a more smoothed calculation result. There are several filtering options in Seeq. The agileFilter() function would work well for the level signal in the example.

## Create an account or sign in to comment

You need to be a member in order to leave a comment

## Create an account

Sign up for a new account in our community. It's easy!

Register a new account