TM
Block Preview

Introduction

The Baseline Restorer TM block performs real-time baseline estimation on a time-multiplexed input signal. Its main function is to compute the average (baseline) of the incoming signal samples over a defined integration period, and to pause this calculation when an event (trigger) is detected.

This ensures that transient signal excursions (pulses) do not bias the baseline estimation, which is critical for accurate pulse-height analysis in spectroscopy applications.

The block processes multiple samples per clock cycle (TM-phase multiplexed data), making it suitable for high-speed digitizers operating at effective sampling rates of hundreds of MHz to GHz.

Pin Description

DATA_IN Input WordWidth × TM bit TM
Time-multiplexed input signal whose baseline has to be calculated. Width is WordWidth × TM bits, containing TM parallel samples.
Default: Must be connected
TRIGGER Input 1 bit BIT
Input signal indicating a pulse event. When HIGH, suspends baseline calculation for the duration specified by BL_HOLD. This is a scalar (1-bit) signal that applies to all TM phases.
Default: 0
M_LENGTH Input 1 bit INT
Exponent for the baseline averaging window size. The number of samples in the average is 2^M_LENGTH × TM. Minimum value: 3 (8 samples × TM), Maximum: limited by MaxLength property. Example: M_LENGTH=9 with TM=4 gives 512×4 = 2048 samples.
Default: 9
BL_HOLD Input 1 bit INT
Number of TM-sample intervals during which baseline calculation is suspended after a trigger. Hold time = BL_HOLD × TM × clock_period. Example: BL_HOLD=50, TM=4, clock=2ns → hold=400ns.
Default: 550
FLUSH Input 1 bit BIT
Input signal to reset and restart the baseline calculation. When HIGH, clears the accumulator and starts a fresh baseline computation.
Default: 0
CE Input 1 bit BIT
Clock enable for the baseline calculation process. When LOW, the block pauses computation.
Default: 1
CLK Input 1 bit BIT
System clock input. All internal operations are synchronous to the rising edge of CLK.
Default: Default Board Clock
RESET Input 1 bit BIT
Synchronous reset input. Clears all internal state and restarts baseline computation.
Default: Default Board Reset
BASELINE Output WordWidth bit BIT VECTOR
Output signal carrying the computed baseline value. Width equals WordWidth bits (same as single-sample input width). This is a scalar value representing the average across all TM phases.
BASELINE_VALID Output 1 bit BIT
Output flag indicating when the baseline computation is valid. Goes HIGH after the first complete averaging window has been processed.
HOLD_TIME Output 48 bit BIT VECTOR
48-bit counter showing the cumulative time spent in hold state. Useful for monitoring dead-time in high-rate applications.
RUNNING_NOT_HOLD Output 1 bit BIT
Status output indicating the block’s operating state. HIGH when actively integrating samples, LOW when in hold (suspended) state.

Properties

Property window

Word Width WordWidth

Width of the input data in bits

Bit-width of each sample within the TM frame. Applies to DATA_IN and BASELINE signals. Acceptable range: 4 … 32, default 16.

Default: 16

Range: 4 – 32

Maximum Length MaxLength

Maximum number of samples for the moving average

Maximum number of samples that can be used for baseline calculation. Determines the maximum allowed value for M_LENGTH. Available values: 1024, 2048, 4096, 8192, default 1024.

Default: 1024

Options: 1024 2048 4096 8192

Time Mux TimeMultiplexing

Set number of samples for each clock cycle

Number of parallel samples processed per clock cycle (TM factor). Available values: 2, 4, 8, 16, 32, default 4.

Default: 4

Options: 2 4 8 16 32

Usage

Functional Overview

Baseline calculation principle

The figure shows:

  • TRIGGER: The trigger signal that initiates the hold period
  • BASELINE INHIBIT: The period during which baseline calculation is suspended (to exclude the pulse)
  • BASELINE LENGTH: The integration window for computing the average

How It Works

The input signal arrives through the DATA_IN port, carrying TM-phase multiplexed samples — i.e., multiple samples per clock cycle. The trigger signal (TRIGGER) used to suspend the baseline computation is a global, scalar signal (not phase-specific). This means that even if the trigger occurred in only one TM phase, the baseline integration is paused for all phases equally.

This simplification reduces the complexity of the logic and resource usage while still providing accurate baseline estimation.


Baseline Window Size

The baseline is computed over a number of samples defined by the M_LENGTH input. The window size is calculated using the formula:

$$ \text{Baseline Length} = 2^{\text{M_LENGTH}} \times \text{TM} $$

M_LENGTH value Number of samples (with TM=4)
5 32 × 4 = 128
6 64 × 4 = 256
7 128 × 4 = 512
8 256 × 4 = 1024
9 512 × 4 = 2048
10 1024 × 4 = 4096
11 2048 × 4 = 8192

Hold Duration

When a trigger occurs, the computation is suspended for a duration defined by the BL_HOLD input. This value specifies the number of time-multiplexed samples (not clock cycles) during which the baseline will be inhibited.

The actual hold duration in time units is:

$$ \text{Hold Time} = \text{BL_HOLD} \times \text{TM} \times T_{clk} $$

where $T_{clk}$ is the clock period.

Example: If the clock period is 2 ns, TM = 4, and BL_HOLD = 50, the hold duration will be: $$50 \times 4 \times 2,\text{ns} = 400,\text{ns}$$


Timing Diagram

 

The diagram shows:

  • When TRIGGER goes high, the HOLD signal activates
  • During the hold period, BASELINE output remains frozen (samples are excluded)
  • After the hold period ends, baseline integration resumes and a new BASELINE value is computed

Output Signals

  • BASELINE: The computed baseline value (moving average of input samples)
  • BASELINE_VALID: Asserts HIGH when the first valid baseline has been computed after integration
  • RUNNING_NOT_HOLD: HIGH when the block is actively integrating (not in hold state)
  • HOLD_TIME: Counter showing the number of TM-sample intervals during which the block is in hold

Typical Applications

  • Pulse-height analysis (PHA) in gamma-ray spectroscopy
  • Baseline correction for Multi-Channel Analyzers (MCA)
  • Signal conditioning for scintillator/SiPM detectors
  • Real-time DC offset removal in high-rate environments