TM
Block Preview

Introduction

The Trigger Derivative TM core implements a derivative-based discriminator designed for time-multiplexed (TM) data streams, commonly used in high-speed nuclear and particle physics data-acquisition systems. The core processes TM_Factor parallel samples per clock cycle, computing the discrete derivative for each channel and triggering when the derivative crosses the user-defined threshold. This approach is particularly effective for detecting fast signal edges in noisy environments, where leading-edge triggers may produce false positives on slowly varying baselines.

Pin Description

DATA_IN Input WordSize × TM_Factor bit TM
Time-multiplexed input samples to be processed. Width is WordSize × TM_Factor bits, containing TM_Factor parallel samples. Each sample is WordSize bits wide (signed representation).
Default: Must be connected
THRESHOLD Input WordSize bit BIT VECTOR
Comparator reference level V_{thr} with bit-width equal to WordSize. The derivative is compared against this threshold; a trigger occurs when derivative >= threshold.
Default: 0
INHIBIT Input 1 bit INT
Unsigned integer specifying the number of clock cycles during which new triggers are suppressed after each TRIGGER pulse (dead-time). Set to 0 for no inhibition.
Default: 0
POLARITY Input 1 bit BIT

Selects derivative polarity.

  • 1 – detect positive derivatives (rising edges): derivative = x[n] - x[n-d]
  • 0 – detect negative derivatives (falling edges): derivative = x[n-d] - x[n] Width = 1 bit.
Default: 1
CE Input 1 bit BIT
Clock-enable. The core processes data only when CE=1; otherwise the internal state is frozen and outputs keep their last value except TRIGGER, which is forced low.
Default: 1
CLK Input 1 bit BIT
System sampling clock. All internal operations are synchronous to the rising edge of CLK.
Default: Default Board Clock
RESET Input 1 bit BIT
Synchronous active-high reset. Clears derivative history buffers, trigger state and inhibition counter.
Default: Default Board Reset
DATA_OUT Output WordSize × TM_Factor bit TM
Pass-through of the input data. Width equals WordSize × TM_Factor bits.
DERIVATE Output WordSize × TM_Factor bit TM
Computed derivative for each TM channel. Width equals WordSize × TM_Factor bits. Each WordSize-bit segment contains the derivative for the corresponding TM channel.
TRIGGER Output 1 bit BIT
Single-cycle pulse generated when any TM channel satisfies the trigger condition. Can be used to timestamp the event or to start downstream processing.
TRIGGER_TM Output TM_Factor bit TM
Time-multiplexed trigger vector. Each bit corresponds to one TM channel; bit i is set if channel i triggered. Width equals TM_Factor bits.
TRIGGER_TM_WHERE Output ceil(log2(TM_Factor)) bit BIT VECTOR
Binary-encoded index of the first TM channel that triggered. Width equals ceil(log2(TM_Factor)) bits. Useful for determining the precise timing of the trigger within the TM frame.

Properties

Property window

Word Size WordSize

Set the number of bits of the data bus

Bit-width of each sample within the TM frame. Applies to DATA_IN, THRESHOLD, DATA_OUT and DERIVATE signals. Acceptable range: 2 … 64, default 16.

Default: 16

Range: 2 – 64

Time Mux TimeMultiplexing

Set number of samples for each clock cycle

Number of parallel samples processed per clock cycle (TM_Factor). Determines the effective sampling rate multiplication. Available values: 2, 4, 8, 16, 32, default 4.

Default: 4

Options: 2 4 8 16 32

Decorrelation noise_filter

Set the derivative decorrelation d coefficient in the expression y = x[n] - x[n-d]

Default: 1

Range: 0 – 256

Decorrelation Decorrelation
Decorrelation delay d for the derivative computation. The derivative is computed as x[n] - x[n-d] (or inverted for negative polarity). A value of 1 computes the standard first difference; larger values skip intermediate samples, providing noise rejection at the cost of reduced timing precision. Acceptable range: 0 … 256, default 1.

Usage

Functional overview

Let

  • x[n] be the digitised input sample at time slot n within the TM frame
  • d – Decorrelation delay (noise_filter parameter)
  • V_{thr} – threshold
  • p – polarity bit (1 = positive derivative, 0 = negative derivative)

Derivative computation

For each of the TM_Factor parallel channels, the core computes a decorrelated derivative:

$$ \Delta x[n] ;=; \begin{cases} x[n] - x[n-d] & \text{if } p=1 \ x[n-d] - x[n] & \text{if } p=0 \end{cases} $$

where d is the decorrelation delay set by the Decorrelation property. A larger d value provides better noise immunity by comparing samples that are further apart in time.

Trigger decision

$$ \text{TRIGGER}[n] ;=; \begin{cases} 1 & \text{if } \Delta x[n] \ge V_{thr} \land \text{not inhibited} \ 0 & \text{otherwise} \end{cases} $$

The trigger is generated on the first TM channel (in time order) that satisfies the condition within each clock cycle. After each trigger, new triggers are inhibited for INHIBIT clock cycles.

Time-multiplexed outputs

The core provides multiple trigger-related outputs:

  • TRIGGER – single-bit pulse, asserted for one clock cycle when any TM channel triggers
  • TRIGGER_TM – TM_Factor-bit vector indicating which specific TM channel(s) triggered
  • TRIGGER_TM_WHERE – binary-encoded index of the first triggering TM channel
 

Timing

  • The derivative is computed with a latency of 1 clock cycle from the input.
  • TRIGGER and TRIGGER_TM are issued synchronously with the derivative computation.
  • DATA_OUT provides a pass-through of the input data (no additional delay).
  • DERIVATE output is available with 1 clock cycle latency.

Typical applications

  • Fast pulse detection in scintillator/SiPM readout systems
  • Constant-fraction discriminator pre-stage
  • Edge detection in high-speed digitizer applications
  • Zero-crossing detection with noise rejection