EdgeDetect Block
Detects rising, falling, or any change in the input signal. Outputs 1 on detected edge, 0 otherwise.
Open EdgeDetect in BlockWerk →# EdgeDetect Block
Description
Detects changes in the input signal. Can detect rising edges (input increases), falling edges (input decreases), or any change.
Mathematical Model
rising: y[n] = 1 if u[n] > u[n-1], else 0
falling: y[n] = 1 if u[n] < u[n-1], else 0
either: y[n] = 1 if u[n] ≠ u[n-1], else 0
First sample: y[0] = 0 for all modes.
Parameters
mode
Detection mode:
- rising: Detect when input increases (replaces DetectIncrease)
- falling: Detect when input decreases
- either: Detect any change in either direction
Remarks
- Pulse width: Output is high for exactly one simulation timestep per detected edge
- First sample: Always outputs 0 on the first sample (no prior state available)
- Noise sensitivity: EdgeDetect triggers on any change; pre-filter noisy signals before edge detection
- Rising vs falling: Use
risingfor positive-going thresholds,fallingfor negative-going - Either mode: Detects any change in either direction; useful for change-of-state triggers
See Also
- Comparator: Threshold-based comparison
- IntervalTest: Range-based detection