Signal Digitizer#

Classes representing signal digitizers.

class Digitizer(sampling_rate, bit_depth='10bit', saturation_levels='auto')[source]#

Bases: object

Simulates the digitization and saturation process for detector signals.

This class models the conversion of continuous (analog) detector signals into discrete digital values, accounting for the sampling rate and bit-depth of the digitizer. It also handles saturation effects by limiting the signal within defined bounds, which is critical for preventing unrealistic values when the input signal exceeds the device’s dynamic range.

Parameters:
  • sampling_rate (Quantity) – The sampling frequency of the digitizer in hertz (Hz), defining how frequently the analog signal is sampled.

  • bit_depth (Union[int, str]) – The number of quantization levels for the digitizer. This can be provided either as an integer (e.g., 12) or as a descriptive string (e.g., ‘12bit’).

  • saturation_levels (Union[str, Tuple[Quantity, Quantity]]) – The saturation limits for the digitizer. This can be specified as a tuple containing the lower and upper bounds (each a Quantity with appropriate units), or as ‘auto’ to allow the digitizer to set these bounds dynamically based on the signal characteristics.

sampling_rate#

The digitizer’s sampling rate in Hz.

Type:

Quantity

bit_depth#

The bit-depth or the number of discrete levels available for digitizing the analog signal.

Type:

Union[int, str]

saturation_levels#

The defined saturation range as a tuple (lower bound, upper bound) or ‘auto’ if the limits are determined dynamically.

Type:

Union[str, Tuple[Quantity, Quantity]]

Notes

Accurate digitization is essential for faithfully representing the detector’s output, while proper handling of saturation prevents clipping of the signal when it exceeds the digitizer’s dynamic range. This class provides the flexibility to configure both the sampling resolution and saturation behavior for simulation purposes.

property bandwidth: Quantity#

Automatically calculates the bandwidth based on the sampling frequency.

Returns:

The bandwidth of the detector, which is half the sampling frequency (Nyquist limit).

Return type:

Quantity

bit_depth: int | str = '10bit'#
capture_signal(signal)[source]#

Processes and captures the final signal by applying noise and saturation.

Parameters:

signal (Series)

Return type:

Tuple[Quantity, Quantity, Quantity]

get_saturation_values(signal)[source]#
Parameters:

signal (Series)

Return type:

Tuple[Quantity, Quantity]

get_time_series(run_time)[source]#
Parameters:

run_time (Quantity)

Return type:

Quantity

sampling_rate: Quantity#
saturation_levels: str | Tuple[Quantity, Quantity] | Quantity = 'auto'#