boundControlRel

timed_float TPT.boundControlRel(timed_float expr, timed_float ref, timed_float percentage, [int options])

This function generates relative bounds around the time dependent expression ref(t) and checks if the signal expr(t) is encapsulated within these bounds. The bounds are specified based on the reference signal ref(t) and the percentage percentage(t) as follows:

For a sample at a given time t the result is defined as follows:

If either expr(t), ref(t), or percentage(t) are undefined at some time t, the returned signal is defined at t as follows:

Parameters:

expr Timed float expression that shall be checked

ref Reference timed float expression defining the bounds

percentage Non-negative percentage expanding the reference signal to minimum and maximum bounds

[options] (optional) if provided this option can only be TPT.STRICT.

Returns:

Signal representing offset of expr(t) from the upper/lower bounds.

Examples:

   res = TPT.Double();
   # defines res in a way to check if mysignal(t) is inside bounds
   # bounds specified by ref and percentage: (0.5*t-1)±30%
   res(t) := TPT.boundControlRel(mysignal(t), 0.5*t-1, 30);