Allison Buenemann Posted December 10, 2020 Share Posted December 10, 2020 FAQ: I have a condition for events of variable duration. I would like to create a new condition that comprises the first third of the time (or 4th, or 10th) of the original condition. Solution: A stepwise approach can be taken to achieve this functionality. 1. Begin with your condition loaded in the display pane. 2. Create a new Signal using Signal from Condition that calculates the total duration of each of your event capsules, interpolated as a step signal. 3. Create a new signal that is your total event duration multiplied by the proportion of the event that you would like to capture. e.g. for the first 1/3 of the event, divide your total duration signal by 3, as shown below. 4. Create an arbitrary discrete signal with a sample at the start of each of your event capsules. 5. Shift the arbitrary discrete signal in time by the value of your signal calculated in step 3. In this example, the 1/3 duration signal. Note, depending on your version of Seeq, the function to do this may be called move() or delay(). 6. Use the toCapsules() function in Formula to create a tiny (zero duration) capsule at each of your shifted, discrete samples. 7. Join the start of your original condition with the capsules created in step 6 using the composite condition tool. 3 Link to comment Share on other sites More sharing options...
Seeq Team Joe Reckamp Posted December 10, 2020 Seeq Team Share Posted December 10, 2020 For those Formula-savvy users, a one Formula approach to this would be as follows where you would define your percentage of the capsule in the first line: $percent = 10%.tosignal().resample(1s) $condition.transform($capsule ->{ $movetime = $capsule.duration()*$percent.toScalars($capsule).first() capsule($capsule.startKey(),$capsule.startKey()+$movetime)}) 4 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now