CrossingMonitoring model

Requirements.Examples.Elementary.SignalAnalysis.CrossingMonitoring  ยท source

Icon of CrossingMonitoring

Example for CrossingMonitoring (output is true for a positive threshold crossing of the input and false for a negative threshold crossing)

Extends Modelica.Icons.Example

Using signal analysis block CrossingMonitoring as

results in

simulation result

The input of CrossingMonitoring is a sine of amplitude 1 and frequency 2 Hz, the threshold is 0.5. The Boolean output becomes true when the sine crosses 0.5 in positive direction and false when it crosses 0.5 in negative direction, so it is true for a part of every period of 0.5 s. Counting the rising edges of this output gives the frequency of the signal, as used in the MaxRisingFrequency examples.

Components and variables

NameTypeDescription
sineModelica.Blocks.Sources.SineSine of amplitude 1 at 2 Hz
crossingMon1Requirements.SignalAnalysis.CrossingMonitoringTrue from an upward crossing of 0.5 until the next downward crossing