Jump to content

Maximum value of multiple peaks for each step of stepwise signal

Go to solution Solved by John Cox,

Recommended Posts

Hello again 🙂

I am trying to estimate how much of a batch results in finished product.

To accomplish this my plan was to:

1. Find the maximum value of two signals for each step of the stepwise signal.

2. For each step, take the biggest value and subtract from it the stepwise signal value.

3. Display the differences (lost product) along with the start and end time of the batches (stepwise signal).


I started off by finding where the stepwise signal changed by using this formula: $b.valueSearch(5min, isNotBetween(-1000,1000))

Then I took the inverse of these points to get capsules for each step (not shown in image).


Then I tried to get the maximum values of one of the signals for each step-capsule:

$p1.aggregate(maxValue(), $s.removeLongerThan(5d), maxKey()).toStep()

Unfortunately, this did not work as intended because some peaks cross from one step to another, which creates a fake max value for that step. However, this might not cause any problems as long as the real peak from the other signal which belongs to that step is greater than the fake peak.

Another issue was that the new stepwise signal created did not match the old stepwise signal.



Hopefully there is a better method for doing this.

Edited by Learning_in_progress
Link to comment
Share on other sites

  • Seeq Team
  • Solution

Hello Learning_in_progress,

I have a few suggestions for you to try. After trying these suggestions, if you need additional help, please sign up for an upcoming Seeq Office Hours (link) where a Seeq analytics engineer can help with your remaining questions. Here are my suggestions:

1. Create a new signal which is the maximum of the blue and green signals, using this formula:


2. An easier way to create capsules for each change in the step signal is to use this formula, or the "Condition with Properties" tool located under Identify in Workbench:


3. To get the maximum value of the 2 signals over each step capsule, use the result from suggestion #1 above as "MaxOfTwoSignals" in the formula shown below. Also, if you use durationKey() instead of maxKey() as shown below, you should get a result which matches with the original step signal. 

$MaxOfTwoSignals.aggregate(maxValue(), $StepCapsules.removeLongerThan(5d), durationKey()).toStep()

Link to comment
Share on other sites

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

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...