If in > hi, output 1. If in < lo, output 0. Otherwise, repeat the last sample of output, assumed to be 0 at initialization. In sclang-flavored pseudocode:out[i] = if(in[i] < lo[i]) { 0 } { if(in[i] > hi[i]) { 1 } { out[i-1] } };
in > hi
in < lo
Signal to be tested.
Low threshold.
High threshold.