Data Lab node

Events

Turns a Signal into events: threshold crossings (rising, falling, either, with hysteresis so noise does not chatter) or local peaks and troughs: a top counts once the signal has come back down by Prominence (a bottom once it has come back up), and Min Distance (ms) is the shortest gap between two events. Event is a one-frame pulse the frame the sample arrives; Count and Rate (per second) cover the window; Interval is the last gap, Times the events’ ages in seconds (negative = ago). Beats from an envelope, blinks from an EEG channel, taps from an accelerometer.

Inputs

PortTypeDefault
SignalThe Data Lab signal to analyse — a Signal node's output, a Window, or any float array with its sample rate. Multi-channel signals are handled per channel.structure—
ChannelThe channel watched for events.int0
ModeRising / falling / any threshold crossing (with hysteresis), or local Peaks / Troughs (with a prominence).int0
ThresholdThe level a crossing passes, in the Signal’s unit.float0.5
HysteresisDead band around the threshold so noise does not fire twice; the signal must go above threshold + h and back below threshold − h.float0.02
ProminenceA peak must stand this far above the lowest value within Min Distance around it.float0.1
Min DistanceMinimum time between two events, ms.float50
ResetRising edge forgets every recorded event.boolfalse

Outputs

PortType
Eventbool
Countint
Ratefloat
Intervalfloat
Mean Intervalfloat
Timesfloat
Valuefloat

How It Works

Events turns a continuous Signal into discrete events, in two families.

Threshold crossings — rising, falling or either, with Hysteresis so a noisy signal sitting on the threshold does not chatter.

Peaks and troughs — and here the definition is the important part: a top counts only once the signal has come back down by Prominence (a bottom once it has come back up), so a wiggle smaller than that is never a peak. Min Distance (ms) sets the shortest gap between two events.

Event is a one-frame pulse on the frame the sample arrives, which is exactly what Do Once, a counter or a trigger port wants. Count and Rate (per second) cover the window, Interval is the last gap and Mean Interval its average, and Times carries the events' ages in seconds (negative meaning "ago").

Use Cases

  • Beats from an envelope — Envelope into Events in peak mode is a serviceable beat detector for any signal, not just audio.
  • Blinks from an EEG channel — A prominence-based peak detector finds them without a model.
  • Taps from an accelerometer — Threshold with hysteresis and a minimum distance.
  • Count things — Rate is a live "how often is this happening" for a readout.
  • Trigger anything — The one-frame pulse fires a Video Player, an Image Capture, a Timeline or a note.

Tips

  • Prominence is the knob that separates real peaks from ripples. Set it from the data's own noise level.
  • Min Distance encodes what you know about the process — beats cannot be 5 ms apart, so say so.
  • Smooth or envelope the signal before thresholding; raw data almost always chatters.
  • Hysteresis should be a few times the noise amplitude, not a fraction of it.
  • Mean Interval inverted is a stable rate estimate — steadier than Rate on sparse events.

Open Events in the interactive catalog →

Events is one of 381 nodes in Grafit Pro.

Free download. Every feature for 7 days, no card. Then €99.99 once — or keep playing your projects as a Player.

More Data Lab nodes