# tip Converting a Saw-Tooth Signal into a Continuously Increasing Signal

## Recommended Posts

### Background:

Sensors or calculated tags that totalize a value over time often need to be reset due to maxing out the range of the sensor or the number of available digits in the calculation database. This can create a saw-tooth signal that resets every time this range maximum is reached. In actuality, the signal is constantly increasing rather than building up to the range max and then stepping down to zero to begin counting back up towards the max.

### Solution:

Use Seeq Formula to convert the saw-tooth signal into a continuously increasing signal bounded in time by some reset period determined by the Subject Matter Expert.

1. In this example we begin with a saw-tooth counter signal that resets every time the sensor reaches its range max of 100.

2. Use Seeq Formula to convert the sawtooth signal into a continuous, increasing signal. Note that in order for Seeq to do this calculation, a bounding condition is required. This can either be a repeating periodic condition, or a condition created using the custom condition tool.

This can be done in one step using the following code:

```//creates a bounding condition for running sum calculation
\$reset = years()

//calculates running delta of signal between each sample, compares to zero to ignore negative running delta values,
//calculates the running sum of the running delta signal over the bounding condition
\$signal
.runningDelta()
.max(0)
.runningAggregate(sum(),\$reset)```

Content verified MAY2024

Edited by Amanda Chng
Content verified MAY2024
• 3
##### Share on other sites

• 2 years later...

How do create a formula to generate a signal that is the slope of the Continous Signal value calculated every minute?

##### Share on other sites

• Seeq Team

Hi Brian,

Please check out the derivative() function in the Formula. If the current sampling interval in your continuous signal is not 1min, you can incorporate resample() function.

Example:

`\$signal.resample(1min).derivative()`