Edge Detect
LogicDetects changes in the input signal. Can detect rising edges (input increases), falling edges (input decreases), or any change.
Mathematical Model
First sample: y[0] = 0 for all modes.
Inputs & Outputs
| Direction | ID | Label | Type | Status |
|---|---|---|---|---|
| → In | in |
In | number | Required |
| ← Out | out |
Out | boolean | Output |
Parameters
| Parameters | Label | Type | Default | Description |
|---|---|---|---|---|
mode |
Detection Mode | select | rising |
|
threshold |
Threshold | number | 0.5 |
Signal level separating low from high. An edge is a crossing of this level; move it outside the noise band to avoid spurious edges. |
initialState |
Initial State | number | 0 |
Usage Examples
- Zie de ingebouwde voorbeelden in de handleiding voor een demonstratie van dit blok.
Remarks & Best Practices
- 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
Related Components
- Comparator: Threshold-based comparison
- IntervalTest: Range-based detection