Level detector
Overview
Use this operator to detect state transitions in signals. The operator allows to set specific detection levels and can output a One Shot trigger, or a state change of a defined period of time.To prevent noisy state switching, this operator has various hysterisis options.
This operator is often used to generate triggers (transition from 0 to 1) that are exactly 1 sample long (One Shot).
Operator ports
Input S: Floating point valuesOutput S_bool: Floating point values
Properties
Find more information about changing properties here: "Properties Viewer"TriggerLevel
type: Real valueThe input level at which the output will trigger to True (1.0).
ResetLevel
type: Real valueThe input level at which the detection will be reset (depending on the method).
Method
type: Select from the listChoose the trigger method from the drop-down list.
Select one of those presets:
HoldTimePeriod
After a trigger the output value is kept constant for the specified amount of time.
SchmittTrigger
After a trigger the output value is kept constant until the input signal crosses the Reset value.
HoldTimePeriod
After a trigger the output value is kept constant for the specified amount of time.
SchmittTrigger
After a trigger the output value is kept constant until the input signal crosses the Reset value.
HoldTimeInTime
type: Real valueThe number of seconds, the output remains in triggered (1.0) state (applicable for Method HoldTimePeriod only).
HoldTimeInSamples
type: Integer valueThe number of sample periods, the output remains in triggered (1.0) state (applicable with Method HoldTimePeriod only).
Caption
type: Word or phraseThe name of the object in the project. This name must not contain '.', '$' nor '@' characters.
For more information about the rules and usage of the Caption property, please refer to "Caption property - background and usage".
Documentation
type: See descriptionOptional documentation of this object. If this object is an operator, the Documentation text is displayed below the operator symbol.
Variable Parameters
Find more information about Variable Parameters here: "Variable Parameters"TriggerLevel
type: See descriptionThe input level at which the output will trigger to True (1.0).
ResetLevel
type: See descriptionThe input level at which the output state will be reset (depending on the method).
HoldTimeInTime
type: See descriptionThe number of seconds, the output remains in triggered (1.0) state (applicable with Method HoldTimePeriod only).
HoldTimeInSamples
type: See descriptionThe number of sample periods, the output remains in triggered (1.0) state (applicable with Method HoldTimePeriod only).
Details
The Level Detector is a key component in creating triggers of specific phenomena in your signals. The Level Detector offers ways to set an hysteresis in the detection. In fact, this operator combines a so called One Shot operator (create a pulse of shortest possible time) and a Schmitt-trigger operator (use hysteresis in level detection).The output of the Level Detector has pseudo-boolean values, which are 0 for False and 1 for True. A One Shot trigger is a pulse with the duration of one sample period, with a value of 1 (pseudo-true).
The detection is carried out for each channel individually, if you have multiple channels connected at the input.
For more information about triggers and pseudo-boolean values, and an example of the use of the Level Detector, please see here: "Pseudo-booleans and triggers".
Below is a simple demonstration of getting a trigger from a signal. Since the trigger is only one sample period long, a feedbacked Adder can be used to count the triggers.